Answer to Question #31148 in C++ for bushra rafique

Question #31148
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.
1
Expert's answer
2013-06-26T09:37:32-0400
#include <iostream>
#include <string>


using namespace std;


int main()
{

string surname,name,grade,GPA;
int course,hours;
cout <<"---_CGPA of student_---
";
cout <<"-Enter student's name-:
";
cin >> name;
cout <<"-Enter student's surname-:
";
cin >> surname;

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 <<"

------Transcript------
";
cout << name << " " << surname <<"
";
cout << "Course " << course <<"
";
cout << "Hours " << hours <<"
";
cout << "Grade " << grade <<"
";
cout << "GPA " << GPA <<"
";


return 0;
}




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS