Assignment Description Write a C program for keeping a cours
Assignment Description:
Write a C++ program for keeping a course list for each student in a college. Information about each student should be kept in an object that contains the student id (four digit integer), name (string), and a list of courses completed by the student.
The course taken by a student are stored as a linked list in which each node contain course name (string such as CS41, MATH10), course unit (1 to 4) and the course grade (A,B,C,D,F).
The program provides a menu with choices that include adding a student record, deleting a student record, adding a single course record to a student’s record, deleting a single course record from a student’s record, and print a student’s record to a screen.
A student record should include a GPA (Grade Point Average) when display on the screen. The GPA is calculated by following formula:
When the user is through with the program, the program should store the records in a file. The next time the program is run, the records should be read back out of the file and the list should be reconstructed
You will need to implement a List container to hold a list of student records, each of which has a List container as its member. Note that no duplicate items should be permitted in either (student and course) List container.
Develop a test driver program that allow options to add, remove, and display student records and the course list of each student.
Use the class template technique (in C++) to implement a List ADT that could be used for both student list and the course list..
To calculate G.P.A. for one term:
Multiply the point value of the letter grade (A=4, B=3, C=2, D=1, F=0) by the number of credit hours. The result is the grade points (quality points) earned.
Total the credit hours for the student; total the quality points for the student.
Divide the total quality points by the total credit hours.
Solution
#include<stdio.h>
#include<conio.h>
void main()
{
struct student
{
int rollno;
char name[20];
int m1,m2,m3;
float percent;
};
struct student s[20],t;
int i,j,n;
clrscr();
printf(\"\ enter the limit\");
scanf(\"%d\",&n);
for(i=0;i<n;i++)
{
printf(\"\ enter the roll no\ \");
scanf(\"%d\",&s[i].rollno);
printf(\"\ enter the name \ \");
scanf(\"%s\",s[i].name);
printf(\"\ enter the mark=\");
scanf(\"%d\",&s[i].m1);
printf(\"\ enter the mark=\");
scanf(\"%d\",&s[i].m2);
printf(\"\ enter the mark=\");
scanf(\"%d\",&s[i].m3);
s[i].percent=(s[i].m1+s[i].m2+s[i].m3)/3;
}
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(s[i].percent<s[j].percent)
{
t=s[i];
s[i]=s[j];
s[j]=t;
}
}
}
printf(\"\ display in desending order\ \");
for(i=0;i<n;i++)
{
printf(\"\ rollno=%d\",s[i].rollno);
printf(\"\ name=%s\",s[i].name);
printf(\"\ mark1=%d\",s[i].m1);
printf(\"\ mark2=%d\",s[i].m2);
printf(\"\ mark3=%d\",s[i].m3);
printf(\"\ percent=%f\",s[i].percent);
}
getch();
}


