You are on page 1of 5

LIST OF EXPERIMENTS

SUBJECT: COMPUTER SCIENCE


CODE: 083
CLASS: XII
SESSION: 2015 2016
1.
2.
3.
4.
5.
7.

12.

20.
21.

31.

Introduction to computer
Topics covered
Introduction to OOP
Introduction to C++ programming language
Expt. 1: Write a C++ program to display the message WELCOME TO C++ PROGRAMMING LANGUAGE. (4 types)
6. Introduction to Assignment Operator (=)
Expt. 2(a): Write a C++ program to calculate the simple interest for an amount 10000 at the rate of 5% per annum for 6 years.
8. Expt. 2(b): Write a C++ program to find the value of the expression (a2b3/c)+((a+bx)2/d)-ax+b where a=1.1, b=2.2,
c=7, d=1 and x=3
9. Expt. 2(c): Write a C++ program to implement shorthand notations.
10. Introduction to I/O statements.
11. Statements in c++ ( Sequence statement, Selection statement, Iteration statement)
Expt. 3(a): Write a C++ program to find sum, average and product of 3 numbers.
13. Expt. 3(b)(i): Write a C++ program to print the message You can vote if your age is greater than equal to 18 years by using
Only if statement.
14. Expt.3(b)(ii): Write a C++ program to print the message You can vote if your age is greater than equal to 18 years by using
if..else statement.
15. Expt.3(b)(iii):Write a C++ program to print the days of the week (e.g. 1 for Sunday, 2 for Monday etc) by using (i) if..else (ii)
nested if
16. Expt.3(b)(iv):Write a C++ program to print the days of the week (e.g. a/A for Sunday, b/B for Monday etc) by using (i) if..else
(ii) nested if
17. Expt.3(b)(v):Write a C++ program to print 5 function calculator by using (i) if..else
(ii) Nested if
18. Expt.3(c)(i):Write a C++ program to print the days of the week by using switch ..case
19. Expt.3(c)(ii):Write a C++ program to print 5 function calculator by using switch ..case
Iteration statements (for, while, do..while)
Expt.4(a): To find the sum, average and product of n natural numbers. (3 separate programs for each loop-for, while and
do..while)
22. Expt.4(b): To find the sum of the following series:
x + x2/2! + x3/3! + x4/4! + + xn/n!
23. Expt.4(c): To find the sum of the following series:
y y2/3! + y3/5! y4/7! + +y4/(2n-1)!
24. User defined programmes (Any 2 nos of programmes selected by the user)
25. Functions in c++
26. Expt.5: Declare an user defined function display( ), to print the message Work hard. Try, Try again (2 types)
27. Character assignment
28. Expt.6: Declare an user defined function display( ), to assign a grade and display it (i) using library function (ii) without using
library function.
29. String assignment
30. Expt.7:Declare an user defined function output( ), to assign a string and display it.
Formating character and strings by using library functions
32. Expt.8: Declare an user defined function to input your grade which consists only a single character and display it by using (i) I/O
statement (ii) Library function.
33. Expt. 9: Declare an user define function to input your name, address, class, section, grade and percentage and display it. [String
input gets( ) and puts( )]
34. Default arguments
35. Expt.10: Raising a number n to a power p is the same as multiplying n by itself p times. Write a function called power() that
takes 2 arguments, a double value for n and an int value for p and return the result as double value. Use default argument of two 2
for p so that if this argument is omitted that number would be squared. Write the main() that gets value from the user .
36. Invoking of a function(Call / Pass by value and reference)

37. Expt.11: Declare an user defined function called Zero_small() that has two integer arguments being passed by reference sets the
smaller of the two numbers to zero . Write the main program.
38. Expt.12: Write a function called Swap() that has two integer arguments being passed by value and swaps the two numbers.
39. Function Overloading
40. Expt.13: Write a c++ program to find the area of a square, triangle, rectangle and circle by using function overloading concept .
41. Recursion
42. Expt.14: By using recursion concept find the factorial of an integer.
43. Arrays (1D and 2D).
44. Expt.15(a). To find sum, average and product of n numbers

45. Expt.15(b). To input and display a 2D matrix.


46. Classes and objects.
47.Class without member( )
48. Expt.16: Consider the class simple to find simple interest. Data members of class simple are ~
P ,R ,T ,SI
double
Write a c++ program to input , calculate and display the simple interest as prt/100 without using member().
49. Class with member( ) defined in public visibility mode
50. Expt.17(a): Define a class Flight with the following member specifications.
o A data member Flight number of type integer
o A data member Destination of type string
o A data member Distance of type float
o A data member Fuel of type float
PUBLIC MEMBERS~
A function FEEDINFO() to allow the user to enter values for Flight Number, Destination, Distance & call function
CALFUEL() to calculate the quantity of Fuel.
A member function CALFUEL() to calculate the value of Fuel as per the following criteria:
DISTANCE
FUEL
<= 1000
500
More than 1000 & <=2000
1100
More than 2000
2200
A function SHOWINFO() to allow user to view the content of all the data member
51. Expt.17(b): Define a class library to represent a book in a library. Include the following members:~
Book number, Book name, Author, Publisher, Price, No. of Copies issued
Member functions~(i) To assign initial values
(ii) To issue book after checking for its availability
(iii) To return a book
(iv) To display book information
52. Class with member() defined in private visibility mode
53. Expt.18(a): Define a class Student with the following member specificationsPrivate members are~
o Admno
integer
o Sname
20 character
o eng,math,science float

Calctot()
to return the percentage as (eng+math+science)/3
Public members

Input()
to read all the data members and invoke calctot()

Output()
to display all the data members.
54. Expt.18(b): Define a class worker. Data members of class worker are ~
wno
intger
wname
20 characters
hrwrk, wgrate
float (hours worked and wage rate per hour)
totwage
float (hrwrk*wgrate)
calcwg( )
A function to find hrwrk*wgrate with float return type
Public members are~
in_data( )
A function to accept values for wno, wname, hrwrk, wgrate and invoke calcwg() to calculate totwage
out_data( )
A function to display all the data members on the screen.
You should give detailed function definition
55. Class with array
56. Expt.19(a): Define a class student with the following specifications:
roll_no
intger

name
20 characters
Class
8 characters
marks[5]
integer
percentage
float
Calculate( )
A function that calculates overall percentage of marks and returns the percentage of marks.
Public members are~
Readmarks( )
A function that reads marks and invokes Calculate()
Displaymarks( )
A function that prints all the data members on the screen.
You should give detailed function definition
57. Expt.19(b): Declare a class to represent bank account of 10 customers with the following data members:
Name the Depositor, Account Number, Type of Account (S FOR SAVINGS and C for Current Account), and Balance
amount.
The class also contains the following member functions:
(a) To initialize data members.
(b) To deposit money.
(c) For withdrawal of money after checking the minimum
balance (minimum balance is
Rs 1000)
(d) To display the data members.
58. Expt.19(c): Define a class Directory with the following member specifications:~
Private members are
Docunames an array of strings of size [10][25] (to represent all the names of documents inside Directory)
Freespace long (to represent total number of bytes available in Directory)

Occupied
long(to represent total number of bytes used in directory)
Public members are_

Newdocuentry( )
Function to accept values of Docunames, Freespace and occupied from the user

Retfreespace( )
Function that returns the value of total kilobytes available. (1 KB=1024 Bytes)

Showfiles( )
Function that displays all the members
59. Class with function arguments
60. Expt.20: Define a class BOOK with the following specificationsPrivate members are
o BOOK_NO
integer type
o BOOK_Title
20 characters
o PRICE
float (price per copy)

TOTAL_COST()
A function to calculate the total cost for N number of copies, where N is passed to the
function as argument
Public members are_

INPUT()
Function to read BOOK_NO,BOOK_TITLE, PRICE

PURCHASE() Function to ask the user to input the number of copies to be purchased. It invokes TOTAL_COST() and
prints the total cost to be paid by the user.
61. Introduction to constructors and destructors
62. Default Constructor
63. Expt.21(a): Define a class AREA. Data members are ~
p,r,ar
double
Public Members:

A constructor function to value of p ( ) as 3.1416

A function read() which allows user to enter values for r (radius)

A function calc() which calculates the area of a circle as pr2

A function write() which displays area of circle


64. Expt.21(b): Define a class TravelPlan in c++ with the following descriptions:

PlanCode
of type long

Place
of type character array(string)

Number_of_travellers
of type integer

Number_of_buses
of type integer
Public Members:

A constructor to assign initial values of Plancode as 1001, Place as Agra, Number_of_travellers as 5,


Number_of_buses as 1

A function NewPlan() which allows user to enter PlanCode, Place and Number_of_travellers. Also assign the
value of Number_of_buses as per the following conditions:
Number_of_travellers
Number_of_buses
Less than 20
1
Equal to or more than 20 and less than 40
2

Equal to 40 or more than 40

A function ShowPlan() to display the content of all the data members on the screen
65. Parameterized Constructor
66. Expt.22:Define a class serial. Data members~
o Serialcode
integer
o Title
20 characters
o Durationfloat
o Noofepisodes
integer
Public member function of class serial are~
A constructor
function to initialize 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.
67. Copy Constructor
68. Expt.23: Write a c++ program to show the implementation of copy constructor.
69. Destructor
70. Expt. 24: Write a c++ program to show the implementation of destructor.
71. Inheritance
72. Expt.25: Write a c++ program to implement
(a) Single inheritance
(b) Multilevel inheritance
(c) Multiple inheritance
(d) Hybrid inheritance
(e) Hierarchical inheritance
73. Data structure operation (Sorting)
74. Expt.26: Declare an user defined function in c++ to sort an array by using
(a) Bubble sort
(b) Insertion sort
(c) Selection sort
75. Data structure operation (Searching)
76. Expt.27. Declare an user defined function in c++ seach an element from a given array by using
(a) Binary search
(b) Linear search
77. Data structure operation (Merging)
78. Expt.28. Declare an user defined function in c++ to merge two arrays.
79. Data structure operation (Linked lists, Stacks, Queues)
80. Expt.29: Write a complete c++ program to implement Linked list
81. Expt.30. Write a complete c++ program to implement Stack
82. Expt.31. Write a complete c++ program to implement Queue
83. File handling(Text file)
84. Expt.32(a):Declare an user defined function to count the no of alphabets present in a text file como.txt.
85. Expt.32(b):Declare an user defined function in c++ which reads one line at a time from the disk file TEST.TXT and
displays it in monitor. Your program has to read all the contents of the file. Assume the length of the line not to exceed 80
characters.
86. File handling(Binary file)
87. Expt.33(a): Given a binary file STUDENT.DAT , containing records of the
following class Student type.
class Student
{
char S_Admno[10];
char S_Name[30];
int percentage;
public:
void EnterData()
{
Gets(S_Admno);
Gets(S_Name);
Cin>>percentage;
}
void DisplayData()
{
cout <<setw(12)<<S_Admo;
cout<<setw(32)<<S_Name;
cout<<setw(3)<<Percentage<<endl;

}
int ReturnPercentage(){return Percentage;}
};
Write a function in C++, that would read contents of file STUDENT.DAT and
display the details of those students
whose percentage is 75.
88. Expt.33(b): Assuming the class EMPLO?YEE given below, write functions in C++ to perform following:
(1) Write the objects of EMPLOYEE to a binary file.
(2) Reads the objects of EMPLOYEE from binary file and display them on screen.
class EMPLOYEE
{
int ENO;
char ENAME[0];
public:
void GETIT(){cin>>ENO; gets(ENAME);}
void SHOWIT(){cout>>ENO<<ENAME;<<endl;}
};
89. Structured Query Language
90. Expt.34(a): SQL table Student
91. Expt.34(b):SQL table Supplier
92. Expt.34(c):SQL table Sports.
93. Expt.34(d):SQL table Consignor and Consignee.
94. Expt.34(e):SQL table implementation with constraints.
95. Implementation of Boolean algebra through C++
96. Expt.35:C++ program to prepare truth table for the expression XY+Z
97. Network and Communications
98. Expt.36: Knowledge Supplement organization
99. Open Source Concepts
100.Terminologies

*********

You might also like