Anda di halaman 1dari 5

Class-XII( Computer Science)

Write a program to create and accept 5 items details and store them in an
array of structure. Elements are itemno, itemname, quantity and rate.
Program should accept details from user. Then search a particular item on the
basis of itemname

Write a program to implement function overloading by calculating simple


interest. Overload the function with one float parameter, two float prameters,
three float parameters.

Write a program to represent a book which contains private data as bookno,


bookname and price. Member functions getdata() and putdata() for reading
and writing the details. Find the total price for 3 books.

Program to count the number of objects created using static variable of the
class.

Define a class Serial in C++ with the following specifications:


Private members of class Serial
Serialcode integer, Title 20 characters, Duration float, Noofepisodes integers
Public member function of class Serial
A constructor function to initialise Duration as 30 and noofepisodes as 10.
Newserial function to accept values for serialcode and Title.
Otherenteries( ) function to assign the values of Duration and Noofepisodes
with the help of corresponding values passed as parameters to this function.
Dispdata( ) function to display all the data members on the screen

Define a class Flight in C++ with the following specification:


Private Members:
Flight Number int, Destination String, Distance Float, Fuel of type float
A Member Function CalFuel( ) to calculate the value of fuel as per the
following criteria:
Distance Fuel <=1000 500
more than 1000 and <=2000 1100
more than 2000 2200
Public Members:
A function Feed_Info( ) to allow user to enter values for Flight Number,
Destination, Distance & Call Function CalFuel( ) to calculate the quantity of
fuel.
A Function Show_Fuel( ) to allow user to view the content of all the data
member

Define a class Employee with ecode, Ename, doj(date of joining) as


priotected data members, get() and show() public member functions, Derive
a class Daily Wager from employee with additional members wage perhour,
no.of hours worked as protected data members and getd() & showd() public
function, Derive a class payment from Daily Wager with members date,
amount as private data members and showp() (display details) public
function.

Write a program to read text file and count the words starting with A

Write a program to create a binary file emp.dat and do functions for ADD
and DISPLAY records. Use the class Employee.
(Data members :empno,ename, basic pay Member functions readdata() and
printdata() for reading and displaying details.

10 Write a program to create a binary file student.dat and display the details
of a particular student whose rollno is given by the user. The class definition
is as follows.
class student
{ int rollno, mark;
char sname[10];
public: int retrollno() {return rollno;}
void display() ;
};
11

Write a program to create a binary file phone.dat containing records of the


following class type.
class phonelist
{ char name[20], address[30],areacode[5],phoneno[15];
public: void register(); void show();
void checkcode(char acd[ ]) { return strcmp(areacode,ACD); }
};
Write a function Transfer() in C++, that would copy all those records which

have areacode as DEL from phone.dat to phoneback.dat


12 Write a program to implement Binary Search
13 Write a program to sort an array using Selection Sort
14 Write a program to implement merging of two arrays.
15 Write a program to sort array of strings using bubble sort
16 Write a program to input 1D array and convert it as 2D array
Ex: 1D array 1 2 3 4 5
2D Array should be 0 0 0 0 1
00012
00123
01234
12345
17 Write a program to input a matrix and transpose it
18 Implement Stack using array (Push, Pop, display)
19 Implement Dynamic Stack in Class (Push, Pop, display)
20 Implement Queue using array (addition, deletion, display)
21 Implement Queue Using Linked List (addition, deletion, display)
22 Write SQL commands for (i) to (iv) and write output for (v)and (vi) on the
basis of Teacher relation given below.
Given the following GRADUATE relation. Write SQL commands.
SNO
1
2
3
4
5
6
7
8
9
10

NAME
KARAN
DEV
DIVYA
ARUN
SABINA
JOHN
RAVI
RUBINA
VIKASH
MOHAN

STIPEND
400
450
300
350
500
400
250
450
500
300

SUBJECT
Physics
Comp.Sc.
Chemistry
Physics
Mathematics
Chemistry
Physics
Mathematics
Comp.Sc.
Mathematics

AVERAGE
68
68
62
63
70
55
64
68
62
57

DIV
1
1
2
1
1
2
1
1
1
2

List the names of those students who have obtained DIV 1 sorted by name.
(i)
(ii)
(iii)

Display a report listing name, stipend, subject and amount of


stipend received in a year assuming that the stipend is paid every
month.
To count the number of students who are either Physics or
Comp.Sc. graduate.
To insert a new row in the graduate table:
11,KAJOL,300,Comp.Sc.,75,1

(iv)

Give the output of following SQL statement based on table


Graduate:
(a) Select MIN(Average) from graduate where subject=Physics;
(b) Select SUM(Stipend) from graduate where DIV=2;
(c) Select AVG(stipend) from graduate where average>=65;
(d) Select COUNT(distinct subject) from graduate;

23 Given the following LAB table, write SQL command for the questions (i) to
(vi) and give the output of (iv).
LAB
No

ItemName

Cost Per Quanti


Dateof
Warranty Operational
Item
ty
purchase

1 Computer

60000

21/5/96

2 Printer

15000

21/5/97

3 Scanner

18000

29/8/98

4 Camera

21000

13/10/96

5 Switch

8000

31/10/99

6 UPS

5000

21/5/96

7 Router

25000

11/1/2000

(i) To select the ItemName,which are within the Warranty period till present
date.
(ii) To display all the itemName whose name starts with C.
(iii) To list the ItemName in ascending order of the date of purchase where
quantity is more than 3.
(iv)
Give the output of the following SQL commands:
(a)
select min(DISTINCT Quantity) from LAB;
(b)
select max(Warranty) from LAB;

(c)
v)
vi)

select sum(CostPerItem) from Lab;


Update the ItemName to Web Cam where ItemName ends witha
Create a new table MyLab which will have the same structure of Lab
table. The rows will not be copied