I have two assigments due in the morning and I left my book in the computer lab and it's locked up. I think I got the first one done, but the second one I don't know.
Here is the problem.
make a program to allow a student to obtain hes GPA. each class may vary on number of credit hours. therefor there will be 2 inputs, grade and credit hours. promp the student to use a numeric value for thye grade 4 for A, 3 for B and so on. A student may take one or several classes. ID must be an input value. No need to echo input except for ID, but should display the credit hours that the student has earned as well as the GPA.
I did this when I had my book, but I think it is way off. this is our second program and we only know very simple steps. Any help would be great.
#include <iostream>
#include <cctype>
using std::cin;
using std::cout;
int main()
{
int id, mark = 0;
char yesno = 'y';
do {
do {
cout<<"Please enter ID:";
cout<<"Please enter grade: ";
cin>>grade;
cout<<"Please enter credit hours: ";
cin>>mark;
} while ( (mark < 0) && (mark > 100) )
if (mark>=4)
cout<<"Student "<<id<<" got a grade A";
else if (mark>=3)
cout<<"Student "<<id<< " got a grade B";
else if (mark>=3)
cout<<"Student "<<id<< " got a grade C";
else if (mark>=2)
cout<<"Student "<<id<< " got a grade D";
//else if (mark<=2) //
else
cout<<"Student "<<id<< " got a grade F";
cout<<"Again?: ";
cin>>yesno;
} while (toupper(yesno)!='N');
cout<<
return 0