Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Download the following file from the Gaddis textbook Chapter 5 source code folde

ID: 3652004 • Letter: D

Question

Download the following file from the Gaddis textbook Chapter 5 source code folder => https://docs.google.com/0B92eNowy6l4gZU9wejNXM0tBT28?authkey=CMqynesE

This file contains a long list of random numbers. Using your IDE-compiler create a new project and add this file to your project. Next write a program that opens the file, reads all the numbers from the file, and calculates the following:

A) The number of numbers in the file

B) The sum of all the numbers in the file (a running total)

C) The mean (average) of all the numbers in the file

Your program should ask the user for the name of the file to process (see the Chapter #13 section 13.1 in the Gaddis text titled "Using Variable File Names" on page 831) and should display the number of numbers found in the file, the sum of the numbers, and the mean (average) of the numbers.

File and Data validation: Appropriate validation methods should be used to ensure that the file stream is not in fail state. In other words you will need to include validation routines to check the following (1) whether the data file opened successfully and (2) the data read from the file matches the variable (datatype) into which the value will be stored. Failure to do so will mean that your program may run but will not produce correct output. Here are some source code hints that you may find helpful in implementing the validation routines.

Turn in your source code followed by your program test output, using the sample data file given above.

Explanation / Answer

#include #include void main(); { clrscr(); int File name,n(n).S(n); (n)= number of numbers _ - - - - - - - - - } getch(); S(n)= sum of numbers
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote