Problem 1: Write a program that accepts details of students (only roll no (int) and CGPA(float)) in form of structure da
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Problem 1: Write a program that accepts details of students (only roll no (int) and CGPA(float)) in form of structure da
Sample input/output
Enter the details of the student: 1 9.5 //note here 1 denotes the roll no. and 9.5 denotes the CGPA Want to enter the details of more students ? Enter Yes to Continue, otherwise enter No: Yes Enter the details of the student: 2 9.5
Want to enter the details of more students ? Enter Yes to Continue, otherwise enter No: Yes Enter the details of the student: 3 9.0
Want to enter the details of more students ? Enter Yes to Continue, otherwise enter No: Yes Enter the details of the student: 4 8.0
Want to enter the details of more students ? Enter Yes to Continue, otherwise enter No: No
Please choose the operation you want to perform:
1. Press H for highest CGPA
2. Press L for lowest CGPA
3. Press P to find students with a particular CGPA
4. Type Exit to stop
H
Highest CGPA is 9.5
Want to continue ? Enter Yes to Continue, otherwise enter No: Yes
Please choose the operation you want to perform:
1. Press H for highest CGPA
2. Press L for lowest CGPA
3. Press P to find students with a particular CGPA
4. Type Exit to stop
P
Enter the CGPA: 9.5
Roll no.s of students having 9.5 CGPA: 1, 2
Want to continue ? Enter Yes to Continue, otherwise enter No: Yes
Please choose the operation you want to perform:
5. Press H for highest CGPA
6. Press L for lowest CGPA
7. Press P to find students with a particular CGPA
8. Type Exit to stop
P
Enter the CGPA: 9.8
No student has 9.8 CGPA
Want to continue ? Enter Yes to Continue, otherwise enter No: No
“You choose to exit”.
Problem 1: Write a program that accepts details of students (only roll no (int) and CGPA(float)) in form of structure data type and displays a list of options - the menu - from which the user indicates his/her choice of operation that user wants to perform on the input: 1. Find highest CGPA 2. Find Lowest CGPA 3. Find Students with a particular CGPA 4. Exit After the user enters the choice of operation, the program returns the result of the operation as output and also prints "Wants to continue ? Enter Yes to Continue, otherwise enter No". I 1. If the user enters YES/yes: The user is again prompted to enter his choice of operation 2. If the user enters No/no: Program terminates with the message "You choose to exit" 3. Otherwise, the program prints "Not a valid input enter yes or no" The details of the student MUST be stored in a dynamically allocated array of structures. The size of the array must not be asked from the user and the program must terminate ONLY IF the user enters EXIT from the operation menu Sample input/output Enter the details of the student: 19.5 //note here I denotes the roll no and 9.5 denotes the CGPA Want to enter the details of more students ? Enter Yes to Continue, otherwise enter No: Yes Enter the details of the student: 29.5 Want to enter the details of more students ? Enter Yes to Continue, otherwise enter No: Yes