THIS IS ALSO INCORRECT; YOU STARTED OFF REALLY GOOD BUT THINGS ARE MISSING: PLEA
ID: 668901 • Letter: T
Question
THIS IS ALSO INCORRECT; YOU STARTED OFF REALLY GOOD BUT THINGS ARE MISSING: PLEASE COMPILE IT IN VISUAL STDUDIO FIRST AND MAKE SURE IT RUNS. I NEED SOMETHING JUST LIKR THIS OUTPUT- http://www.chegg.com/homework-help/questions-and-answers/program-calculate-grade-point-average-student-student-provide-letter-grades-10-courses-pro-q8134109.
------- BUT IN C++ --------
The program will calculate the grade point average for a student. The student will provide the letter grades for 10 courses. The program will read the 10 grades and convert the letter grade to a numeric value according to the table given below:
Then, the program will calculate the GPA taking into account the following number of credits for each course
The program will ask the student to enter the grades as follows:
Grade for MATH101:
Grade for ENG100:
Grade for BIO250:
Grade for ITM100:
Grade for CIS250:
Grade for HIST101:
Grade for CALC100:
Grade for SCI201:
Grade for SOC110:
Grade for PHY100:
The program will use two arrays: one to store the 10 numeric grades and another one to store the number of credits for each course as given on the table above. Make sure to maintain the same order.
The program will calculate the weighted average or GPA by multiplying each grade by its respective number of credits, adding all the products and dividing the total by the number of credits.
The program output will be:
You GPA is: X.XX
The program must be fully documented with comments including a description, the date and your name at the beginning of the code.
Letter Value A 4 B 3.5 C 3 D 2.5 F 0Explanation / Answer
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int credit[10]={5,3,4,3,3,3,4,3,3,4};
char grade[10];
double GPA=0.00,sum=0;
cout<<"Enter the grades for the courses"<<endl;
cout<<"Grade MUST BE ENTERED as A or B or C or D or F "<<endl;
cout << "Enter grade for MATH101 :" ;
cin>>grade[0];
cout << "Enter grade for ENG100: " ;
cin>>grade[1];
cout << "Enter grade for BIO250: " ;
cin>>grade[2];
cout << "Enter grade for ITM100: " ;
cin>>grade[3];
cout << "Enter grade for CIS250: " ;
cin>>grade[4];
cout << "Enter grade for HIST101: " ;
cin>>grade[5];
cout << "Enter grade for CALC100: ";
cin>>grade[6];
cout << "Enter grade for SCI201: ";
cin>>grade[7];
cout << "Enter grade for SOC110: ";
cin>>grade[8];
cout << "Enter grade for PHY100: ";
cin>>grade[9];
int i;
for(i=0;i<10;i++){
if(grade[i]=='A'){
GPA=GPA+credit[i]*4;
}else if(grade[i]=='B'){
GPA=GPA+credit[i]*3.5;
}else if(grade[i]=='C'){
GPA=GPA+credit[i]*3;
}else if(grade[i]=='D'){
GPA=GPA+credit[i]*2.5;
}else if(grade[i]=='F'){
GPA=GPA+credit[i]*0;
}
sum=sum+credit[i];
}
GPA=GPA/sum;
cout<<"Your GPA :"<<std::setprecision (2)<<GPA<<endl;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.