Answered step by step
Verified Expert Solution
Question
1 Approved Answer
An immaculate table or diagram is required. Provide an ideal solution immediately. Strict warning: AI is strictly banned. BR 2 0 / * Name:
An immaculate table or diagram is required. Provide an ideal solution immediately. Strict warning: AI is strictly banned.
BR
Name:
Class:
Date:
Discription:
include
include
using namespace std;
void inputstring& name, int& id int& numCourses;
void inputCoursestring& courseNumber, int& credits, char& grade;
double calculateGPAint totalPoints, int totalCredits;
char gradeToPointschar grade;
void outputstring name, int id int totalCredits, double gpa;
const int MAXCOURSES ;
const char GRADESABCDF;
const double POINTS;
int main
ofstream outFile;
outFile.openGPAReport.txt;
Print header
outFile &~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~
tCommunity College
tCIS Students GPA report
tSpring Semester
&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~&~
;
char repeat;
do
string name;
int id numCourses, totalCredits totalPoints ;
inputname id numCourses;
outFile Name: name tID #: id endl;
for int i ; i numCourses; i
string courseNumber;
int credits;
char grade;
inputCoursecourseNumber credits, grade;
totalCredits credits;
totalPoints gradeToPointsgrade credits;
double gpa calculateGPAtotalPoints totalCredits;
outputname id totalCredits, gpa;
cout Do you want to process another student? YN: ;
cin repeat;
while toupperrepeatY;
outFile.close;
cout Output written to GPAReport.txt
;
return ;
void inputstring& name, int& id int& numCourses
cout Enter student name: ;
getlinecin name;
bool validID false;
while validID
cout Enter student ID : ;
cin id;
validID id && id ;
if validID
cout Invalid ID number. ;
bool validNumCourses false;
while validNumCourses
cout Enter number of courses : ;
cin numCourses;
validNumCourses numCourses && numCourses MAXCOURSES;
if validNumCourses
cout Invalid number of courses. ;
cin.ignore;
void inputCoursestring& courseNumber, int& credits, char& grade
not sure what's wrong with the code or how to even fix it but these are its requirements:
Write a C program to calculate a students GPA for the semester. The program should accept a students name, the ID number and the number of courses heshe is taking. For each course the following data is needed
the course number a string eg CIS
the course credits an integer eg
the final grade received for the course a character eg A
E tatau i le polokalame ona tusi i se faila le igoa o le tamaititi aoga, numera ID le aofai o maka o loo ave e le tamaititi aoga, ma tamaiti aoga Grade Point Average GPA mo le semesa. E tatau ona aofia ai se fe'au lapata'i i le galuega faatino pe afai o le GPA e itiiti ifo i le ma se fe'au fa'amalo pe afai o le GPA e pe sili atu. O le lipoti o le a lolomi se laina se tasi mo tamaiti aoga taitasi. Siaki i lalo le auala e sue ai le gpa mo se tamaititi aoga
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started