hi! this is a school project and i need help on making the GPA 2.333333.
i think the problem lies within the process data segment where it says GPA = ..... but i dont know what to do or how to fix it. can someone please help me??
int CrHrs1,CrHrs2,CrHrs3,CrHrs4; // number of credit hours for 4 courses
int ValPt1,ValPt2,ValPt3,ValPt4; // number of value points earned
int TotalValue; // total value points for 4 courses
int TotalHours; // total credit hours for 4 courses
double GPA; // grade point average for 4 courses
/*********** ENTER DATA SEGMENT **********/
cout << "This program will compute your GPA for the current semester" << endl;
cout << "For each of your four courses enter CREDIT HOURS followed" << endl;
cout << "by grade point VALUE. Use A=4, B=3, C=2, D=1, F=0\n";
cout << "Press <SPACE> between each data entry\n" << endl;
cout << endl;
cout << "Enter Course 1 data ===>> ";
cin >> CrHrs1 >> ValPt1;
cout << "Enter Course 2 data ===>> ";
cin >> CrHrs2 >> ValPt2;
cout << "Enter Course 3 data ===>> ";
cin >> CrHrs3 >> ValPt3;
cout << "Enter Course 4 data ===>> ";
cin >> CrHrs4 >> ValPt4;
okay so under the variable declaration segment i kept the first two as int and changed the last three to double. it seems like that works. also how do i calculate the GPA to where it can give me 2.333333?