Question: C++ Your grades for the four courses that you took last semester are stored in a text file named MyGrades.txt (attached). Read the file and

C++

Your grades for the four courses that you took last semester are stored in a text file named MyGrades.txt (attached). Read the file and display its contents using I/O manipulators to format your output. Be sure to display the average of your grades accurate to one decimal place.

Example:

My Grades Calculus 80 Physics 72 C++ 100 English 94 Average = 86.5

Pseudocode:

Open the file (MyGrades.txt) Repeat 4 times: 
  • Read course name and grade and print them formatted as follows:
    • Course description: left justified and 15 characters wide
    • Grade: right justified and 6 characters wide
  • Add course grade to total

Print average of grades where average = total / 4.0 Close the file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!