C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
Question
Book Icon
Chapter 8.5, Problem 4E

(a)

Program Plan Intro

Program Plan:

  • Include library files for various operations.
  • Declare object of ofstream.
  • Create a file named “grades.dat” to write contents.
  • Use if statement with fail() method to check that the entered file name is available or not.
  • Read data from the program and write data to the file.
  • int main() function is used to perform all the task.
  • Display the calculated results to the user.

Program Description: The main purpose of this program is to create the “grades.dat” file and to store the given data in the file.

(b)

Program Plan Intro

Program Plan:

  • Include library files for various operations.
  • Declare an object ofifstream.
  • Create a statement to open the given file “polar.dat”.
  • Use if statement with fail() method to check that the entered file name is available or not.
  • Use arrays, for retrieving the data per row from the file to generate the student record.
  • Convert the string values from the arrays to the integer values for manipulations.
  • Calculate the total credits and GPA obtained by each student.
  • int main() function is used to perform all the task.
  • Display the calculated results to the user.

Program Description: The main purpose of this program is to modify the program code given in part (a), so that the program can accept data from the given file “grades.dat” and display the grade report with the student name, ID, number, list of courses and the credits and grade for each course on the console.

Blurred answer
Students have asked these similar questions
Start with the initial angles within the integration and just integrate them without mapping them to specific quadrants. Use python and radians
How does encryption prevent a hacker from getting your data
what is one way to secure a phone
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning