Professional Documents
Culture Documents
C++ Programming
SNo
.
Program Description
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
Dat
e
#1/6
Nn
Sign
.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
Create a class Person with data members name, address and phone number
and member functions readinfo() and showinfo(). From Person class derive
class Student with additional data members and member functions to show
and display details. Using the Student class derive a class Graduate Student
with additional data members and member functions to show and display
details.
Create a class Clothing with data members code, type, size and material
and member functions to enter, show and calculate prize of each item by
the material i.e. if Material is cotton price is 1500, if Lycra then 1200. Write
constructor (to assign initial values) and destructor of the class and show its
working.
Create a class Bank with data members account no, name, address, balance
and data members to read, display, withdraw and deposit amount.
(minimum balance 1000)
Create objects to show working.
Write a program to implement call by reference using pointer
Write a program using pointers to show array elements using a pointer and
perform arithmetic operations on the array elements (1D Array)
Write an interactive C++ program to open a text file and then display the
following:
1) Number of vowels
2) Number of digits
3) Number of words
Declare a structure telerec in C++, containing name (20 characters) and
telephone number. Write a program to maintain a file of telephone records.
The program should allow the following functions on the file:
1) To append records in the file.
2) Display the name for a given telephone number. If the telephone
number does not exist then display error message "record not found".
A blood bank maintains a data file that contains the following information
for every donor: Name, Date of Birth, Telephone number, Blood group.
Write a program in C++ to do the following:
1) Given a blood group, display name, date of birth and phone number of
all the persons of the given blood group.
2) Append records in the file.
3) Input a telephone number and modify the corresponding record.
Write a menu driven program in C++ to perform the following functions on a
binary file BOOK.DAT containing objects of the following class:
class Book
{
int BookNo;
char Book_name[20];
float price;
public:
void input();
void display();
int getbno() {return Book_no;}
void setprice();
};
1. Append Records
2. Modify a record for a given book no.
3. Search for a record with a given Book name
Write a menu driven program which allows the user to perform the
following operations on a one dimensional array:
Insertion, deletion, searching, sorting (bubble, selection, insertion),
display.
The program should automatically perform binary search if the array is
sorted and linear search otherwise.
#2/6
24.
25.
26.
27.
28.
29.
30.
31.
Write a program to input integer data in two arrays. Input arrays one in
ascending order and the other one in descending order and then merge
them into a third array so that the data in the third array is in ascending
order.
Write a program to input elements of a 2D array and write functions to
print:
1) Upper diagonal of the matrix
2) Lower diagonal of the matrix
3) Diagonal elements of the matrix
Write a program to implement a linked list
Write a menu driven program which allows the user to perform the
following operations on a stack (Array implementation):
1) Push
2) Pop
3) Display
Write a menu driven program which allows the user to perform the
following operations on a queue (Array implementation):
1) Insert
2) Delete
3) Display
Write a menu driven program which allows the user to perform the
following operations on a stack (Linked implementation):
1) Push
2) Pop
3) Display
Write a menu driven program which allows the user to perform the
following functions on a queue of Employees (Linked implementation):
1) Insert
2) Delete
3) Display
Write a menu driven program which allows the user to perform the
following functions on a circular queue (Array implementation):
1) Insert
2) Delete
3) Display
#3/6
Name
John
Smith
George
Lara
K George
Johnson
Lucy
Bill
Morphy
Sarah
Henry
Salary
29000
35000
32000
38000
32000
37000
36000
42000
35000
40000
33000
DName
Sales
Finance
Admin
IT
HR
Logistics
Address
33 Elm St
440 US 110
24 Friends Street
9 Fifth Cross
12 Moore Street
121 Harris St
11 Red Road
87 Lake View
900 Park Street
124 Greenway St
109 Halt Road
Table: Department
MinSal
25000
30000
25000
25000
30000
15000
City
Paris
Upton
New Delhi
Washington
London
Boston
New Delhi
London
London
Boston
Boston
MaxSal
32000
50000
40000
45000
48000
23000
Dept
10
20
20
30
20
40
40
50
50
30
10
HOD
111
102
110
106
108
Simple Select
5.
Display the details of all the employees.
6.
Display the Dept number, Dept Name and HOD of all the departments.
7.
Display the Minimum Salary of all departments with their department names.
8.
Display the records of all the employees along with their annual salaries. The Salary column of the table
contains monthly salaries of the employees. The new column should be given the name Annual Salary.
Conditional Select using Where Clause
#4/6
9.
Display the details of all the employees who are working in London.
10.
Display the names of all the employees whose salary is greater than 40000
11.
Using NULL
12.
Display the details of all the department who has no HOD assigned.
Display the various department numbers from the table Employee. A department number should be
displayed only once.
Using Logical Operators (NOT, AND, OR)
15.
Display the details of all the employees of department 10 who have salary above 32000.
16.
17.
Display the details of all the employees who are getting a salary of more than 30000 in the department
10.
Display the names and salaries of all the employees who are not working in department 20.
18.
Display the names and salaries of all the employees who are working neither in New Delhi nor in Boston
19.
Display the names of all the employees who are working in department 20 or 30.
20.
Display the details of all the employees whose salary is between 32000 and 38000.
Using IN Operator
21.
Display the names of all the employees who are working in department 20 or 30. (Using IN operator)
22.
Display the names and salaries of all the employees who are working neither in New Delhi nor in Boston
(Using IN operator)
Using BETWEEN Operator
23.
Display the details of all the employees whose salary is between 32000 and 38000.
(Using BETWEEN operator)
Using LIKE Operator
24.
Display the name, salary, and age of all the employees whose names start with M.
25.
Display the name, salary, and age of all the employees whose names end with a.
26.
Display the name, salary, and age of all the employees whose names contain a
27.
Display the name, salary, and age of all the employees whose names do not contain a
28.
Display the details of all the employees whose names contain a as the second character.
Display the highest and the lowest salaries being paid in department 10.
#5/6
31.
Display the details of all the employees in the descending order of their names.
34.
Display the details of all the employees in the ascending order of their City and within City in the
descending order of their salaries.
Using GROUP BY clause
35.
Display the total number of employees in each department.
36.
Display the highest salary, lowest salary, and average salary of each department.
37.
Display the average salary of employees in each department only for those departments in which average
salary is more than 35000.
Using UPDATE, DELETE, ALTER TABLE
38.
39.
Delete the records of all the employees whose salary is below 30000.
40.
Delete the records of all the employees of department 10 having salary less than 30000.
41.
44.
Display the details of employees who are HOD and working in Boston
45.
Display the name of the department and the name of the corresponding HOD for all the departments.
#6/6