Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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