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.