Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions

Question

Evaluate the following integrals. 5/2 dx V25 x2 X'

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago