Write a program using structure to calculate CGPA of student.assume there are 20 courses each having either 3 or 4 credit hours.take the name of students,name of course,credit hours,grade,GPA from user and print a transcript containing student name ,course name,grade,credit hours and gpa.
cout <<"-Enter the name of course-: "; cin >> course; while ( course >0 && course >21 ) { cout <<"-Enter the name of course(1 to 20)-: "; cin>> course; }
cout <<"-Enter the credit hours-: "; cin >> hours; while ( hours!=3 && hours!=4 ) { cout <<"-Enter the credit hours (3 or 4)-: "; cin >> hours; } cout <<"-Enter the grade-: "; cin>> grade; cout <<"-Enter the GPA-: "; cin>> GPA; cout <<"
Comments
Leave a comment