Vous êtes sur la page 1sur 4

Army Public School No.

1 Jabalpur
Practical List – Computer Science
Class – XII
Issue Date :- 14– 12 – 2018 Last Date:- 08 – 01 – 2019

Q1. Write a menu driven program in C++ to perform following operation on string without using built in
functions using function.
(i) Find the length of the string (ii) Compare two string (iii) Concatenate two string.
Q2. Write a C++ program for Matrix Addition.
Q3. Write a C++ program for Matrix Multiplication.
Q4. Write a C++ program for Palindrome Numbers.
Q5. Define a class Teacher with the following specification (including Main ( ) )
private members:
name 20 characters
subject 10 characters
Basic, DA, HRA float
salary float
Calculate ( ) function computes the salary and returns it. ( Salary is sum of
Basic+DA+HRA)
public members:
Readdata( ) function accepts the data values and invoke the calculate ( ).
Displaydata( ) function prints the data on the screen.
Q6. Define a class Serial in C++ with the following specificarion: (including Main ( ) )
private members of class Serial:
Serialcode integer
Title 20 character
Duration float
Noofepisodes integer
public members of class Serial:
A constructor function to initialize Duration 30 and Noofepisodes as 10
Newserial ( ) function to accept values for Serialcode and Title.
Otherentries( ) funection to assign the value of Duration and Noofepisodes with the
help of corresponding values passed as parameters to this function.
Dispdata ( ) function to display all the datamembers on the screen.
Q7. Define a class Garments in C++ with the following specificarion: (including Main ( ) )
private members of class Garments
GCode of type string
GType of type string
GSize of type integer
GFabric of type string
GPrice of type float
A function Assign ( ) which calculate and assign the value of GPrice as follows:
For the value of GFabric “ COTTON”
GType GPrice
TROUSER 1300
SHIRT 1100
For the Fabric other than COTTON the above mentioned GPrice gets reduced by 10%
public members of class Garments
A constructor to assign initial values of GCode, GType, and GFabric with the word
“NOT ALLOTTED” and GSize and GPrice with 0.
A function Input( ) to input the values of the data members GCode,GType, GSize,
and GFabric and invoke the function Assign ( ).
A function Display( ) which displays the contents of all the data members for a
Garment.
Q8. Write a C++ program to read a line of text from the keyboard and display the following information
on the screen (i) Number of Words. (ii) No. of Characters
Q9. Write a C ++ program using arrays to store price list of 20 items and print the largest price as well as
the sum of all prices.
Q10. Write a C++ program to implement searching in a file that has record maintained through class.
Q11. Write a C ++ program that perform insertion of a record in a file.
Q12. Write a C ++ program that display the size of a file in bytes.
Q13. Write a C ++ program that perform deletion of a record from a file.
Q14. Write a C ++ program that perform Linear search operation using arrays.
Q15. Write a C ++ program that perform Binary search operation using arrays.
Q16. Write a C ++ program that perform Selection sort operation using arrays.
Q17. Write a C ++ program that perform Bubble sort operation using arrays.
Q18. Each node of STACK contain:
 Rollno
 Age
 Pointer Field
TOP is the first node of stack. Write a menu driven program in C++ :
 To push
 To pop
Q19. Write a C++ program that perform insertion of an element in a linked queue.
Q20. Write a C++ program that perform insertion and deletion of an element in circular queue.
Q21. Consider the following tables Item and Customer. Write SQL commands for the statements
(I ) to ( iv ) and give output for SQL queries (v) to ( viii )
Table: ITEM
i_ID ItemName Manufacturer Price
PC01 Personal Computer ABC 35000
LC05 Laptop ABC 55000
PC03 Personal Computer XYZ 32000
PC06 Personal Computer COMP 37000
LC03 Laptop POR 57000

Table: CUSTOMER
c_ID CustomerName City i_ID
01 S Roy Delhi LC03
06 H Singh Mumbai PC03
12 N Pandey Delhi PC06
15 V Sharma Delhi LC03
16 S Agrawal Bangalore PC01

(i) To display the details of those Customers whose City is Delhi.


(ii) To display the details of item whose Price is in the range of 35000 to 55000.( Both values
included)
(iii) To display the CustomerName, City from table Customer, and ItemName and Price from
table Item, with their corresponding matching i_ID.
(iv) To increase the Price of all items by 1000 in the table Item.
(v) SELECT ItemName, Max(Price), Count(*) from Item GROUP BY ItemName;
(vi) SELECT CustomerName, Manufacturer FROM Item,Customer WHERE
Item.Item_ID = Customer.Item_ID;
(vii) SELECT DISTINCT City FROM Customer;
(viii) SELECT ItemNAme, Price * 100 FROM Item WHERE Manufacturer = ‘ ABC ‘ ;

Q22. Consider the following tales Consignor and Consignee. Write SQL commands for the statement (i)
to (iv) and give output for SQL queries (v) to (viii).
Table : CONSIGNOR
CnorID CnorName CnorAddress City
ND01 R Singhal 24, ABC Enclave New Delhi
ND02 Amit Kumar 123, Palm Avenue New Delhi
MU15 R Kohli 5 / A, South Street Mumbai
MU50 S Kumar 27 – K, Westend Mumbai

Table : CONSIGNEE
CneeID CnorID CneeName CneeAddress CneeCity
MU05 ND01 Rahul Kishore 5, Park Avenue Mumbai
ND08 ND02 P Dhingra 16 / J, Moore Enclave New Delhi
KO19 MU15 A P Roy 2A, Central Avenue Kolkata
MU32 ND02 S Mittal P 245, AB Colony Mumbai
ND48 MU50 B P Jain 13, Block D, A Vihar New Delhi
(i) To display the names of all Consignor from Mumbai.
(ii) To display the CneeID, CnorName, CnorAddress, CneeName, CneeAddress for every
Consignee.
(iii) To display Consignee detail in ascending order of CneeName.
(iv) To display number of Consignors from each city.
(v) SELECT DISTINCT City FROM CONSIGNEE;
(vi) SELECT A.CnorName, B.CneeName FROM Consignor A, Consignee B WHERE
A.Cnor ID = B.CnorID AND B.CneeCity = ‘ Mumbai ’ ;
(vii) SELECT CneeName,CneeAddress FROM Consignee WHERE CneeCity NOT IN ( ‘
Mumbai ‘ , ‘ Kolkata ‘ ) ;
(viii) SELECT CneeID, CneeName FROM Consignee Where CnorID = ‘ MU15 ‘ OR
CnorID = ‘ ND01 ‘ ;

(HOD CS / IP)
Army Public School Mhow

Vous aimerez peut-être aussi