Sie sind auf Seite 1von 7

Program for Practical Record File

C++ Programs
1. Write a menu driven program to do the following:
Input an integer and check for Prime number
Input an integer and check for Armstrong number
Input an integer and check for Palindromic number
Input an integer and check for Fibonacci number
Exit from the menu and quit the program

2. Write a menu driven program to do the following:


Input an integer; count number of digits of the inputted integer and display the result on the
screen
Input an integer; find sum and product of digits of the inputted integer and display the sum and
product on the screen
Input an integer; find product of odd digits (digits not divisible by 2) and sum of even digits
(digits divisible by 2) of the inputted integer and display the sum and product on the screen
Input an integer; find sum and product of reciprocal of digits (ignoring zero) of the inputted
integer and display the sum and product on the screen
Input an integer; find the sum of squares and sum of cubes of digits of the inputted integer and
display the output on the screen
Input an integer; obtain a new integer by reversing the digits of the inputted integer and display
the result on the screen
Exit from the menu and quit the program

3. Write a menu driven program to do the following:


Input two integers; calculate their HCF and display HCF
Input two integers; display all the Armstrong Numbers between two inputted integers
Input two integers; display all the Prime Numbers between two inputted integers
Exit from the menu and quit the program
Note: Use setw()/printf() to display Armstrong Numbers and Prime Numbers

4. Write a menu driven program to do the following:


Input two integers; calculate their LCM and display LCM on the screen
Input two integers; display all the Palindromic Numbers between two inputted integers
Input two integers; display all the Fibonacci Numbers between two inputted integers
Exit from the menu and quit the program
Note: Use setw()/printf() to display Palindromic Numbers and Fibonacci Numbers

5. Declare a structure student with following data members:


Roll Number (integer type)
Name (string of 20 characters)
Theory Marks (floating point type marks between 0 and 70, value to be inputted)
Practical Marks (floating point type marks between 0 and 30, value to be inputted)
Total Marks (floating point type Theory Marks + Practical Marks)
Create an array of student with MAX (at least 10) elements. Write a menu driven program to do the
following:
Input values in the array
Display the array display the array in a tabular format using printf()
Sort the array using selection sort on student roll
Search on student roll using binary search

Class XII Page 1 / 7 Subject: Computer Science (083)


Program for Practical Record File
Search on student name using linear search
Display Roll Number, Name and Marks when marks is greater than equal to 50 and less than
equal to 70
Exit from the menu and quit the program

6. Declare a structure student with following data members:


Roll Number (integer type)
Name (string of 20 characters)
Theory Marks (floating point type marks between 0 and 70, value to be inputted)
Practical Marks (floating point type marks between 0 and 30, value to be inputted)
Total Marks (floating point type sum of Theory Marks + Practical Marks)
Create an array of student with MAX (at least 10) elements. Write a menu driven program to do the
following:
Input values in the array
Display the array display the array in a tabular format using printf()
Sort the array using bubble sort on student name
Search on student name using binary search
Search on student roll using linear search
Display Roll Number, Name and Marks when marks is more than 90
Exit from the menu and quit the program

7. Declare a structure student with following data members:


Roll Number (integer type)
Name (string of 20 characters)
Theory Marks (floating point type marks between 0 and 70, value to be inputted)
Practical Marks (floating point type marks between 0 and 30, value to be inputted)
Total Marks (floating point type sum of Theory Marks + Practical Marks)
Create an array of student with MAX (at least 10) elements. Write a menu driven program to do the
following:
Input values in the array
Display the array display the array in a tabular format using printf()
Sort the array using insertion sort on student roll
Search on student roll using binary search
Search on student name using linear search
Display Roll Number, Name and Marks when marks is less than 40
Exit from the menu and quit the program

8. Create a string with 80 characters. Write a menu driven program to do the following without using
any functions from the header files <ctype.h> and string.h>:
Input a string; convert it into lowercase and display the output on the screen
Input a string; convert it into uppercase and display the output on the screen
Input a string; toggle the case of the inputted string; display the output on the screen
Input a string; count and display number of uppercase, lowercase and digits in the string
Input a string; check whether the inputted string is a Palindrome or not
Exit from the menu and quit the program

9. Declare a structure student with following data members:


Roll Number (integer type)
Name (string of 20 characters)

Class XII Page 2 / 7 Subject: Computer Science (083)


Program for Practical Record File
Marks (floating point type)
Create three arrays of student arr1 with 10 elements, arr2 with 10 elements and arr3 with 20
elements. Write a menu driven program to do the following:
Input values in the array arr1 sort the array using Insertion sort on Marks in descending order
Input values in the array arr2 sort the array using Selection sort on Marks in descending order
Merge the arrays arr1 and arr2 on Marks to obtain the third array arr3 (in descending order)
Display the merged array in a tabular format using printf()
Exit from the menu and quit the program

10. Declare a structure student with following data members:


Roll Number (integer type)
Name (string of 20 characters)
Marks (floating point type)
Create three arrays of student arr1 with 10 elements, arr2 with 10 elements and arr3 with 20
elements. Write a menu driven program to do the following:
Input values in the array arr1 sort the array using Bubble sort on Name
Input values in the array arr2 sort the array using Insertion sort on Name
Merge the arrays arr1 and arr2 on Name to obtain the third array arr3
Display the merged array in a tabular format using printf()
Exit from the menu and quit the program

11. Declare a class employee with following specification:


Private data members
Employee Code (integer type)
Employee Name (string of 20 characters)
Employee Salary (floating point type)
Public member functions are:
Input values from the keyboard in the data members
Display the data members in a tabular / column format using printf()
Access function to return value stored in Employee Code
Write an interactive menu driven to do the following:
Add an object of the type employee in binary file (Binary data file name EMP.DAT)
Display all objects of the type employee stored in the binary file
Display employee details from the binary file by inputting Name and Code of the employee
Input an Employee Code and delete that record from the binary file
Exit from the menu and quit the program

12. Declare a class employee with following specification:


Private data members
Employee Code (integer type)
Employee Name (string of 20 characters)
Employee Salary (floating point type)
Public member functions are:
Input values from the keyboard in the data members
Display the data members in a tabular format using printf()
Access function for Employee |Code and for Employee Name
Write an interactive menu driven to do the following:
Add an object of the type employee in binary file (Binary data file name EMP.DAT)
Display all objects of the type employee stored in the binary file
Class XII Page 3 / 7 Subject: Computer Science (083)
Program for Practical Record File
Display employee details from the binary file by inputting Name and Code of the employee
Input an Employee Name and delete that record from the binary file
Exit from the menu and quit the program

13. Declare a class employee with following specification:


Private data members
Employee Code (integer type)
Employee Name (string of 20 characters)
Employee Salary (floating point type)
Public member functions are:
Input values from the keyboard in the data members
Input value in the data member Employee Salary
Display the data members in a tabular format using printf()
Access function for Employee |Code and for Employee Name
Write an interactive menu driven to do the following:
Add an object of the type employee in binary file (Binary data file name EMP.DAT)
Display all objects of the type employee stored in the binary file
Display employee details from the binary file by inputting Name and Code of the employee
Input an Employee Code and Employee Name; update Employee Salary in the binary file
Exit from the menu and quit the program

14. Declare a class employee with following specification:


Private data members
Employee Code (integer type)
Employee Name (string of 20 characters)
Employee Salary (floating point type)
Public member functions are:
Input values from the keyboard in the data members
Display the data members in a tabular format using printf()
Access function to return value stored in Employee Salary
Update Employee Salary (updated salary is passed as a parameter to the function)
Write an interactive menu driven to do the following:
Add an object of the type employee in binary file (Binary data file name EMP.DAT)
Display all objects of the type employee stored in the binary file
Input Salary and display employee details when Employee Salary is more than inputted Salary
Input Salary and display employee details when Employee Salary is less than inputted Salary
Update Employee Salary of every employee by 15% and updated all the records in the binary file
Exit from the menu and quit the program

15. STUDENT.TXT is a text file containing First Name (one word), Subject (BIOLOGY,
PSYCHOLOGY, ECONOMICS), Marks out of 100 and Grades (A1, A2, B1, B2, ). Every line is
separated by new line character. Write a menu driven program in C++ to do the following:
Append n (n is a local variable) records in the file
Display the text file on the screen
Calculate and display total number student and number of students in each subject
Calculate and display average marks for every subject
Count and display number students getting grade A1 and A2
Exit from the menu and quit the program

Class XII Page 4 / 7 Subject: Computer Science (083)


Program for Practical Record File
16. STUDENT.TXT is a text file containing Name (one word), Subject (BIOLOGY, PSYCHOLOGY,
ECONOMICS), Marks out of 100 and Grades (A1, A2, B1, B2, ). Every line is separated by new
line character. Write a menu driven program in C++ to do the following:
Append n (n is a local variable) records in the file
Display the text file on the screen
Calculate and display total number students getting 90 above subject wise
Calculate and display highest marks and lowest marks for every subject
Count and display number of student getting grades B1, B2
Exit from the menu and quit the program

17. STUDENT.TXT is a text file containing Name (one word), Subject (BIOLOGY, PSYCHOLOGY,
ECONOMICS), Marks out of 100 and Grades (A1, A2, B1, B2, ). Every line is separated by new
line character. Write a menu driven program in C++ to do the following:
Append n (n is a local variable) records in the file
Copy details of BIOLOGY student into another text file BIO.TXT, copy details of ECONOMICS
student into another text file ECO.TXT and copy details of PSYCHOLOGY student into another
text file PSYC.TXT; display the text files on the screen
Copy details of students who have obtained 90 and above into another text file MARK90.TXT;
display the text file MARK90.TXT on the screen
Copy details of students who have obtained either A1 or A2 into another text file A1A2.TXT;
display the text file A1A2.TXT on the screen
Exit from the menu and quit the program

18. Write a menu driven program to implement a linked queue. Queue contains:
Roll Number (integer type)
Name (string 20 characters)
Marks (floating point type marks >=0 and <=100)
The menu should contain following options:
Insert add a student information in the queue
Delete a student information from the queue
Display the content of queue
Exit from the menu and quit the program

19. Write a menu driven program to implement a static queue using an array with at least 10 elements.
Queue contains:
Roll Number (integer type)
Name (string 20 characters)
Marks (floating point type marks >=0 and <=100)
The menu should contain following options:
Insert add a student information in the queue
Delete a student information from the queue
Display the content of queue
Exit from the menu and quit the program

20. Write a menu driven program to implement a linked stack. Stack contains:
Name (string 20 characters)
Theory Marks (floating point type marks between 0 and 70, value to be inputted)
Practical Marks (floating point type marks between 0 and 30, value to be inputted)
Total Marks (floating point type sum of Theory Marks and Practical Marks)
The menu should contain following options:
Class XII Page 5 / 7 Subject: Computer Science (083)
Program for Practical Record File
Insert add a student information in the stack
Delete a student information from the stack
Display the content of stack
Exit from the menu and quit the program

21. Write a menu driven program to implement a stack using a dynamic array having at least 10
elements. Stack contains:
Name (string 20 characters)
Theory Marks (floating point type marks between 0 and 70, value to be inputted)
Practical Marks (floating point type marks between 0 and 30, value to be inputted)
Total Marks (floating point type sum of Theory Marks and Practical Marks)
The menu should contain following options:
Insert add a student information in the stack
Delete a student information from the stack
Display the content of stack
Exit from the menu and quit the program

22. Create a square matrix of integers with size MAX (MAX>=5). Write a menu driven program to:
Assign random values to all elements of the array (>=10 and <=99); obtain a new matrix which
the transpose of the existing matrix; display the both the matrices in matrix format on the screen
Assign random values to all elements of the array (>=10 and <=99); display the matrix in matrix
format; find the sum and product of elements of every row; display the results on the screen
Assign random values to all elements of the array (>=10 and <=99); display the matrix in matrix
format; find the sum and product elements of every column; display the results on the screen
Assign random values to all elements of the array (>=10 and <=99); display the matrix in matrix
format, obtain the sum and product of two diagonal elements separately; display the results on
the screen
Exit from the menu and quit the program

SQL Questions
1. Display details of all the girl students

2. Display details of students belonging to Class 12

3. Display details of students belonging to PEACE house

4. Display the details of student who joined the school in 2002 using AND operator

5. Display the details of student who joined the school in 2002 using BETWEEN operator

6. Display Admission Number, Name, Class and Area of student either from MANGAF or
FAHAHEEL or ABU HALIFA using OR operator

7. Display Admission Number, Name, Class and Area of student either from MANGAF or
FAHAHEEL or ABU HALIFA using IN operator

8. Display details of student whose name starts with A

9. Display details of student whose name ends with N

10. Display the details of student sorted on Name

Class XII Page 6 / 7 Subject: Computer Science (083)


Program for Practical Record File

11. Display the details of student sorted on Class and then on Section

12. Display the names of all the 4 Houses

13. Count the number student belonging to HARMONY House

14. Display average Bus Fees paid by the student

15. Display total Bus Fees paid by the student

16. Display maximum and minimum Bus Fees paid by the student

17. Count and display number of student belonging to each Class then Section wise

18. Count and display number of student belonging to each Class wise then House wise

19. Display sum of Bus Fees collected from every Class

20. Display average of Bus Fees collected from every Class

Class XII Page 7 / 7 Subject: Computer Science (083)

Das könnte Ihnen auch gefallen