I dont know what to put next. The question is in the context

Create a program that would compute for the grade equivalent of two students who just took an exam in Math, Science and English. Your program should consist of two structures: first, struct Subjects that has as its members Math, Science and English in which the grade equivalent of the two students is stored; second, struct Student with members Name, Course, and StudentSub whose type is Subjects.
#include <iostream>
#include <string>
using namespace std;


struct Subjects
{
int math;
int science;
int english;

};
struct Student
{
string name;
string course;
string StudentSub;
};

int percent(int a, int b)

{
int r;
r=(a/b)*100;
return r;
}

void main()
{
int c;
int score,total;
char choice;
Student astud;
Student *pstud;

pstud = &astud;

cout<<"Name :";
getline(cin,pstud->name);
cout<<"Course :";
getline(cin,pstud->course);


cout<<"Choose a subject:"<<endl;
cout<<"1.Math"<<endl;
cout<<"2.Science"<<endl;
cout<<"3.English"<<endl;
cin>>choice;

switch(choice)
{

case '1' :

cout<<"Math"<<endl;
cout<<"Score: ";
cin>>score;
cout<<"Total Score: ";
cin>>total;
c = percent(score,total);
cout<<"Grade: "<<c<<endl;
break;

case '2':

cout<<"Science:"<<endl;
cout<<"Score: ";
cin>>score;
cout<<"Total Score: ";
cin>>total;
break;

case '3':

cout<<"English:"<<endl;
cout<<"Score: ";
cin>>score;
cout<<"Total Score: ";
cin>>total;
break;
default:
cout<<"Try again"<<endl;
}
}
Topic archived. No new replies allowed.