Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program to calculate the current semester\'s grade point average and the

ID: 3619967 • Letter: W

Question

Write a program to calculate the current semester's grade point average and the cumulative grade point average of a student. The program should use an input data file to:

read the student's six-digit identification number (id ), his/her old grade point average (ogpa), and the old number of course credits (occ)
read the course credits (c1, c2, c3, c4) and grades (g1, g2, g3, g4) for each of four courses
compute:
old number of honor points = ohp = occ x ogpa
new number of honor points = nhp = c1 x g1 + c2 x g2 + c3 x g3 + c4 x g4
total number of new course credits = ncc = c1 + c2 + c3 + c4
current GPA = cur_gpa = nhp/ncc
cumulative GPA = cum_gpa = ( nhp + ohp ) / ( ncc + occ)
The input data file should be created such that id, ogpa, and occ are placed on the first line, c1, c2, c3, and c4 are listed on the second line, and g1, g2, g3, and g4 are listed on the third line; as an example, the input file could contain the following data:

213141 3.2 24
3 5 4 2
4 4 3 4

All outputs should be written to an output file which has a format exactly like the following.

Student ID number: 213141

Previous semesters' credit: 24

Previous semesters' GPA: 3.2

GPA of current semester: 3.7

Cumulative GPA: 3.4

Total credits completed:

Explanation / Answer

You have to read file using methods from fstream, convert string data to double, calculate , reconvert data to string and write back to file, hers the c++ code : #include #include #include #include using namespace std; int main() { filebuf fb,fb1; fb.open ("test.txt",ios::in); //test.txt is the file containing temperature data fb1.open("op.txt",ios::out); //data is writen to file op.txt ostream os(&fb1); istream is(&fb); char *str; String data=""; is.getline(str,13,' '); string id=""; string ogpa,occ; ogpa=occ=""; for(int i=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote