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)

value to be inputted)  Practical Marks (floating point type – marks between 0 and 30. value to be inputted)  Practical Marks (floating point type – marks between 0 and 30. 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) . convert it into lowercase and display the output on the screen  Input a string. 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.h>:  Input a string. 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. check whether the inputted string is a Palindrome or not  Exit from the menu and quit the program 9. 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. count and display number of uppercase. Program for Practical Record File  Search on student name using linear search  Display Roll Number. convert it into uppercase and display the output on the screen  Input a string. lowercase and digits in the string  Input a string. 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.h> and string. Name and Marks when marks is less than 40  Exit from the menu and quit the program 8. Name and Marks when marks is more than 90  Exit from the menu and quit the program 7. toggle the case of the inputted string. Create a string with 80 characters. display the output on the screen  Input a string. Write a menu driven program to do the following without using any functions from the header files <ctype. 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 greater than equal to 50 and less than equal to 70  Exit from the menu and quit the program 6.

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.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. arr2 with 10 elements and arr3 with 20 elements. arr2 with 10 elements and arr3 with 20 elements. Program for Practical Record File  Marks (floating point type) Create three arrays of student arr1 with 10 elements. 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. 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. 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) . 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 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. …). 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. Subject (BIOLOGY.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. Every line is separated by new line character. B1. ECONOMICS).TXT is a text file containing First Name (one word). Marks out of 100 and Grades (A1. B2. PSYCHOLOGY. A2. 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) .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. 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. STUDENT.

Program for Practical Record File 16. Subject (BIOLOGY.TXT. …).TXT on the screen  Exit from the menu and quit the program 18. Write a menu driven program to implement a static queue using an array with at least 10 elements. ECONOMICS). Every line is separated by new line character. Marks out of 100 and Grades (A1. …). B2  Exit from the menu and quit the program 17. display the text file A1A2. Every line is separated by new line character. ECONOMICS).TXT is a text file containing Name (one word). PSYCHOLOGY.TXT is a text file containing Name (one word). B1. STUDENT. B1. A2. 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) . B2. STUDENT. Write a menu driven program to implement a linked queue.TXT. Stack contains:  Name (string 20 characters)  Theory Marks (floating point type – marks between 0 and 70. Write a menu driven program to implement a linked stack. PSYCHOLOGY.TXT and copy details of PSYCHOLOGY student into another text file PSYC. Subject (BIOLOGY. display the text files on the screen  Copy details of students who have obtained 90 and above into another text file MARK90.TXT. Marks out of 100 and Grades (A1. copy details of ECONOMICS student into another text file ECO.TXT. value to be inputted)  Practical Marks (floating point type – marks between 0 and 30. 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 on the screen  Copy details of students who have obtained either A1 or A2 into another text file A1A2. B2. display the text file MARK90. 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. A2. 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. 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.

obtain a new matrix which the transpose of the existing matrix. 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. display the results on the screen  Assign random values to all elements of the array (>=10 and <=99). Display details of all the girl students 2. 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 both the matrices in matrix format on the screen  Assign random values to all elements of the array (>=10 and <=99). Stack contains:  Name (string 20 characters)  Theory Marks (floating point type – marks between 0 and 70. find the sum and product elements of every column. Display details of students belonging to PEACE house 4. Write a menu driven program to implement a stack using a dynamic array having at least 10 elements. Display details of students belonging to Class 12 3. display the matrix in matrix format. Class and Area of student either from MANGAF or FAHAHEEL or ABU HALIFA using OR operator 7. Write a menu driven program to:  Assign random values to all elements of the array (>=10 and <=99). Name. Create a square matrix of integers with size MAX (MAX>=5). Name. Display Admission Number. 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. display the matrix in matrix format. Display details of student whose name starts with A 9. display the results on the screen  Exit from the menu and quit the program SQL Questions 1. obtain the sum and product of two diagonal elements separately. Class and Area of student either from MANGAF or FAHAHEEL or ABU HALIFA using IN operator 8. display the matrix in matrix format. Display the details of student sorted on Name Class XII Page 6 / 7 Subject: Computer Science (083) . Display the details of student who joined the school in 2002 using AND operator 5. Display Admission Number. value to be inputted)  Practical Marks (floating point type – marks between 0 and 30. Display the details of student who joined the school in 2002 using BETWEEN operator 6. Display details of student whose name ends with N 10.

Display average of Bus Fees collected from every Class Class XII Page 7 / 7 Subject: Computer Science (083) . Display the names of all the 4 Houses 13. Program for Practical Record File 11. Count and display number of student belonging to each Class then Section wise 18. Count the number student belonging to HARMONY House 14. Display total Bus Fees paid by the student 16. Display average Bus Fees paid by the student 15. Display the details of student sorted on Class and then on Section 12. Display sum of Bus Fees collected from every Class 20. Count and display number of student belonging to each Class wise then House wise 19. Display maximum and minimum Bus Fees paid by the student 17.