CV
CV
Exit
Add Student Details: Get data from the user and add a student to the list of
students. While adding students, check for the uniqueness of the roll
number.
Find Student by Roll Number: Find the student record for the given roll
number and print the details.
Find Students by First Name: Find all students with the given first name and
print their details.
Update Student Details: Allow the user to update student records. The user
should be able to choose which fields to update.
Delete Student: Delete the student record for the given roll number.
Display Total Number of Students: Print the total number of students in the
system.
#include <iostream>
#include <string>
Struct Student {
Int roll;
String name;
String fatherName;
String address;
};
Student students[MAX_STUDENTS];
Int numStudents = 0;
Void addStudent() {
Getline(cin, students[numStudents].fatherName);
Getline(cin, students[numStudents].address);
numStudents++;
Void findStudentByRoll() {
Int roll;
If (students[i].roll == roll) {
Return;
Cout << “Student with Roll Number “ << roll << “ not found.” << endl;
Int choice;
Do {
Cout << “1. Add Student\n2. Find Student by Roll Number\n3. Exit” <<
endl;
Switch (choice) {
Case 1:
addStudent();
break;
case 2:
findStudentByRoll();
break;
Case 3:
Break;
Default:
Return 0;