Oop Assignment 1
Oop Assignment 1
Output Format:
S.No St.ID Name S1 S2 S3 S4 S5 Mks_OBT %age Grade
1 1234 Ali Khan 92 92 92 92 92 460 92.0 A
2 4321 Azhar K. 80 80 80 80 80 400 80.0 B
Program:
#include <iostream>
#include <string>
using namespace std;
struct DOB
{
int day;
int month;
int year;
};
struct AdmissionDate
{
int day;
int month;
int year;
};
struct Student
{
int student_id;
string name;
int subject_marks[5];
DOB dateofbirth;
AdmissionDate admissiondate;
};
int main()
{
Student stud[MAX_STUDENTS];
int count = 0;
// Menu options
int choice;
do {
cout << "\nMenu:\n";
cout << "1. Append new Record\n";
cout << "2. Search a Record\n";
cout << "3. Delete a Record\n";
cout << "4. Update a Record\n";
cout << "5. Generate Result Card\n";
cout << "6. Display Data\n";
cout << "7. Exit\n";
cout << "Enter your choice: ";
cin >> choice;
switch (choice)
{
case 1:
AppendRecord(stud, count);
break;
case 2:
SearchRecord(stud, count);
break;
case 3:
DeleteRecord(stud, count);
break;
case 4:
UpdateRecord(stud, count);
break;
case 5:
GenerateResultCard(stud, count);
break;
case 6:
DisplayData(stud, count);
break;
case 7:
cout << "Exiting program...\n";
break;
default:
cout << "Invalid choice, please try again.\n";
}
} while (choice != 7);
return 0;
}
cout << totalMarks << "\t" << percentage << "\t" << grade << endl;
}
}
cout << totalMarks << "\t" << percentage << "\t" << grade << endl;
}
}
Output: