use the file below 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 averag

Get perfect grades by consistently using www.assignmentgeeks.org. Place your order and get a quality paper today. Take advantage of our current 20% discount by using the coupon code GET20


Order a Similar Paper Order a Different Paper

Use the file below:

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.

Sample Output:

Read 4 numbers:
The numbers are: 12
14
99
83
The average = 52

Read 5 numbers:
The numbers are: 2
9
56
4
3
The average = 14.8

Read 2 numbers:
The numbers are: 13
15
The average = 14

Read 1 numbers:
The numbers are: 6
The average = 6

Read 8 numbers:
The numbers are: 32
12
3
4
5
12
34
45
The average = 18.375

———————————————————————————–

  • Point Distribution:
  • -50 Does not compile
  • -5 Warnings
  • -5 No description multiple line comments (name, date, etc)
  • -5 No single line comments (logic, input, output, etc)
  • -10 Incorrect file names.
  • -20 Incorrect values in the output file.

"Is this question part of your assignment? We can help"

ORDER NOW
Writerbay.net

Need help with an assignment? We work for the best interests of our clients. We maintain professionalism and offer brilliant writing services in most of the fields ranging from nursing, philosophy, psychology, biology, finance, accounting, criminal justice, mathematics, computer science, among others. We offer CONFIDENTIAL, ORIGINAL (Turnitin & SafeAssign checks), and PRIVATE services using the latest (within 5 years) peer-reviewed articles. Kindly click on ORDER NOW to receive an A++ paper from our masters- and doctorate-prepared writers. Thank you in advance!

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper