Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a program that reads data from a text file and assigns the vales to a two - dimensional array The text file contains

image text in transcribed

C++ Write a program that reads data from a text file and assigns the vales to a two - dimensional array The text file contains grades of 5 students There are 3 grades for each student (for English, Hitstory Math) The grades shoule be listed in the file sequentially, with the fiest studnts's grades listed first, then the grades of the second student, and so on. 1. Create a text file : grades.txt Enter the grades : A A B-> student #1 CCF-> #2 CDB-> #3 BAC-#4 BAB#5 2. read the file and assign the scores to a 2D array NOTE Include code that will display a message if the file does not open. 3. After read the file, display all grades 4. Calculate and display GPA each student EX : Student #1 has 11 points (4+4+3) GPA # 1 : 3.67 (113) 5.Display average GPA for each of the three subject EX avgGPA for English is 2.80 This is calculated by adding the English column and dividing by 5 (14/5) 6. Note: Use fixed, showpoint, setprecision0 to format all output to 2 places to the right of the decimal point and stw0 to align colums OUTPUT All Grades Student English #1 #2 #3 Histody Math -> #3 display all grades #5 Student GPAs 3.67 1.33 2.00 3.00 3.33 #2 #3 -> #4 display-GPAs #5 Average GPA by subject: English History Math 2.80 3.00 2.20 -> #5 display average GPA each student

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

Step: 3

blur-text-image

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 Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions