Lab Manual 4
Lab Manual 4
Lab Manual 4
Instructor: CLO:
Dr. Samyan Qayyum Wahla • CLO1
Registration Number:
Learning Objectives:
• Building in memory business application with ___________________________________________
the limited number of records Name:
___________________________________________
Guidelines/Instructions:
• Create meaningful variable names. Add comments for readability. Indent each line of your code.
• Plagiarism/Cheating is highly discouraged by assigning 0 to both who tried and one who shared his/her
code.
Project Details:
You are required to develop a University Grading System. The system stores the marks of at most five students.
The system can add, delete or update the student data. Currently only one user can login to the system which is
administrator. Administrator will have unique user name and password.
Task 1:
Write a C++ program that display the following menu. The program should take input repeatedly from the user.
On the input other than 1 to 7 system should display input is invalid, On input 0 system should stop.
Use if-else-if for checking input.
**************************************************************
University Grading System
**************************************************************
Choose the option from the menu:
Enter 1 to add a student
Enter 2 to search a student
Enter 3 to delete a student
Enter 4 to update the data of a student
Enter 5 to display number of students in the system
Enter 6 to display list of all students without grade
Enter 7 to display list of all students with grade
Enter 0 to close program
Enter Input:
Task 2:
1. Update the code written in above program; declare 5 variables, student1, student2, student3, student4 and
student 5 of type string. Assign each value as “NV”.
2. Declare 5 variables of type int marks1, marks2, marks3, marks4 and marks5, each variable for the marks
of corresponding students. Assign each variable value of -1 initially.
Task 3:
1. Change the code in the task 1 to use the switch statement in place of if-else-if.
Task 4: Count of students
1. Implement your logic on press of option 5.
2. Check each variable from student1 to student5, if the value is other than NV then increment the student
counter.
3. Display the number of variable, which have value other than NV.
Programming Fundamentals Fall 2024 Page 1 of 6
Enter Input: 5
Total Number of Students in System :4
Add a Student
Enter Student Name : Ahsan
Enter Student Marks : 78
Enter Input: 2
Search Student
Enter Student Name : Ahsan
Enter Input: 6
Display Student Record without Grades
*********************************************************************
Student Name Marks
*********************************************************************
Muhammad Ali 86
Ayesha 72
Irum 90
Ahsan 82
*********************************************************************