XIIC List of Practicals
XIIC List of Practicals
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
Program to count the number of objects created using static variable of the
class.
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
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)
(iv)
23 Given the following LAB table, write SQL command for the questions (i) to
(vi) and give the output of (iv).
LAB
No
ItemName
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)