0% found this document useful (0 votes)
40 views3 pages

STD XII Prac Programs

Uploaded by

Mark Pereira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views3 pages

STD XII Prac Programs

Uploaded by

Mark Pereira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

LONG PROGRAMS

1. Define a class named BINARY consisting of the following members:


i) list: an array of type short integer of size 30 under private visibility label.
ii) N : of type short unsigned integer (indicates total number of elements to be

iii) Define a default constructor

iv) search

binary search technique.


Write a relevant main function to complete the program.

2. Define a class named BUBBLE consisting of the following members:


i) list: an array of type short integer of size 30 under private visibility label.
ii) N : of type short unsigned integer(indicates total number of elements to be accepted

iii) Define a default constructor

iv) sort
bubble sort technique(sort in ASCENDING order).
v) show
Write a relevant main function to complete the Program.

3. Define a class named SELECT consisting of the following members:


i) list: an array of type short integer of size 30 under private.
ii) N :of type short unsigned integer.(indicates total number of elements to be accepted

iii) Define a default constructor

iv) sort
selection sort technique (sort in ASCENDING
order).
v) show
array.
Write a relevant main function to complete the program.
4. Define a class named INSERT consisting of the following members:
i) list: an array of type short integer of size 30 under private visibility label.
ii) N : of type short unsigned integer(indicates total number of elements to be accepted

iii) Define a default constructo

iv) sort
insertion sort technique (sort in ASCENDING order).
v) show
Write a relevant main function to complete the program.

5. Define a class named MERGE consisting of the following members:


i) A,B,C: 1-D arrays of type short integer of size 50 each under private visibility
label.
ii) M,N : of type short unsigned integer (indicates total number of elements in A
and B respectively ) under private visibility label.
iii) Define a default constructor
accept the numbers in the arrays A and B (both in ascending order). It further

iv) process merging


of all elements in A and B to obtain array C in ASCENDING order for display.
Write a relevant main function to complete the program.

6. Define a class named MATRIX consisting of the following members:


i) M.N,Q:of type short unsigned integer under private visibility label.
ii) A,B,C: 2-D arrays of size 10x10 each under private visibility label.
iii) Define a default constructor to accept data members M,N and Q
(Where MxN is size of A and NxQ is size of B). It also accepts 2-D array A and B.

iv) product

Write a relevant main function to complete the program.

7. Define a class named BILL with the following members:


i) item_code: of type unsigned short integer under private visibility label.
ii) item _name: a character array of size 30 under private visibility label.

iii) unit_price,total : of type float under private visibility label.


iv) quantity: of type unsigned short integer under private visibility label.
v) get data
item_name,unit_price and quantity. It computes total as quantity * unit_price.
put data
item_code, item_name,unit _price,quantity and total.
Write a menu driven main function to
a) Create
b) Display
form.
SAMPLE OUTPUT
ITEM CODE ITEM NAME UNIT-PRICE QUANTITY TOTAL
1000 PEN 10.00 5 50.00
2000 PENCIL 5.00 3 15.00
8. Write a menu driven program to implement a singly linked list in which each node consists
of the following data fields:
i) M.N,Q: of type short unsigned integer under private visibility
label.
ii) roll- of type unsigned short integer.
iii) name- an array of maximum 30 characters.
iv) percent- of type float
And perform the following operations:
a) Creation
b) Display the linear linked list in the following format:

9. Write a menu driven program to implement a stack using singly linked list in which each
node consists of a single data field of type character and performs the following operations:
i) push a node onto the stack
ii) pop the top node from the stack
Displaying data field of all the nodes in the stack horizontally.

10. Write a menu driven program to implement a queue using singly linked list in which each
node consists of a single data field of type character and performs the following operations:
i) Appending a node into the queue.
ii) Deleting the first node in the queue.
Displaying data field of all the nodes in the queue horizontally.

You might also like