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.2, Problem 1E

a.

Program Plan Intro

Program Plan:

  1. Include library files for various operations.
  2. Declare object of ifstream.
  3. Create a statement to open the given file “prices.dat”.
  4. Use if statement with fail() method to check that the entered file name is available or not.
  5. Use while loop to read the file.
  6. int main() function is used to perform all the task.
  7. Display the calculated results to the user.

Program Description: The main purpose of the program is to read data from thegiven file “prices.dat”, and to display the file data to the user.

b.

Program Plan Intro

Program Plan:

  • Include library files for various operations.
  • Declare object of ifstream.
  • Create a statement to open the given file “prices.dat”.
  • Use if statement with fail() method to check that the entered file name is available or not.
  • Use while loop to read 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 the program is to modify the program code given in part (a) so that the program use !inFile.eof() instead of the expression inFile.good().

Blurred answer
Students have asked these similar questions
What should the next three steps be in my machine based home security system after deployment and after the following current steps: Enhancing Security & Privacy Measures User Interface (UI) and Experience (UX) Improvement  Machine Learning Model Refinement & Continuous Improvement
I am creating a machine learning home based security system, have completed initial deployment and in the following phases of the project: Expanding device compatibility and integration, preparing for cloud integration, and implementing system reduncancy and disaster recovery. What should the next three phases be?
Hands-On Assignments Part II Assignment 1-5: Querying the DoGood Donor Database Review the DoGood Donor data by writing and running SQL statements to perform the following tasks: 1. List each donor who has made a pledge and indicated a single lump sum payment. Include first name, last name, pledge date, and pledge amount. 2. List each donor who has made a pledge and indicated monthly payments over one year. Include first name, last name, pledge date, and pledge amount. Also, display the monthly payment amount. (Equal monthly payments are made for all pledges paid in monthly payments.) 3. Display an unduplicated list of projects (ID and name) that have pledges committed. Don't display all projects defined; list only those that have pledges assigned. 4. Display the number of pledges made by each donor. Include the donor ID, first name, last name, and number of pledges. 5. Display all pledges made before March 8, 2012. Include all column data from the DD PLEDGE table.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr