C++ Write a program to read data from an input file. The first value read is the number of numbers to be read next. Calculate the average of those numbers and display on screen and write to an output file the numbers read and the average of each group of numbers. input file: 4 12 14 99 83 5 2 9 56 4 3 2 13 15 1 6 8 32 12 3 4 5 12 34 45 0 Implementation: Use "input.dat" for input file name and "output.dat" for output file name.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 5PP: (Data processing) Write a C++ program that reads the file created in Exercise 4, permits the user to...
icon
Related questions
Question

C++

Write a program to read data from an input file. The first value read is the number of numbers to be read next. Calculate the average of those numbers and display on screen and write to an output file the numbers read and the average of each group of numbers.

input file: 4 12 14 99 83 5 2 9 56 4 3 2 13 15 1 6 8 32 12 3 4 5 12 34 45 0

Implementation: Use "input.dat" for input file name and "output.dat" for output file name.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr