Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that will: Ask the user for the name of a data file. open the data file if the file fails to

Write a C++ program that will:

  1. Ask the user for the name of a data file.
  2. open the data file
    1. if the file fails to open print an error message and return to step 1
  3. read an unknown number of integers from the file
    1. stop reading when you have reached the end of the file
  4. report the Min, Max, Sum, Count, and Average of the data (round output to 2 decimal places)

Sample Run

Enter Data File Name: prog7a.txt Min = 10 Max = 92 Sum = 1284 Count = 21 Average = 61.14

Sample Input Data File

25 75 84 92 88 59 88 52 79 48 11 83 12 92 77 92 80 52 10 53 32

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

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions

Question

Brief the importance of span of control and its concepts.

Answered: 1 week ago

Question

What is meant by decentralisation?

Answered: 1 week ago