Question
C++ input text file sorting project PROJECT SUMMARY The program shall read an input file consisting of whole numbers into an array, compute statistical values
C++ input text file sorting project
PROJECT SUMMARY
The program shall read an input file consisting of whole numbers into an array, compute statistical values based on those numbers, and write the results to the screen and to an output file.
PROJECT INSTRUCTIONS
Write a program to: (1) read a set of whole numbers into an array (2) compute the minimum value (3) compute the maximum value (4) compute the average (5) compute the standard deviation (6) compute the median (7) compute the mode (8) write the results to the terminal screen and to an output file (9) draw a histogram for the set of numbers
DATA TYPES
The program shall use these data types.
---- ---- DATA TYPE ---- ----
Raw data array of integer type
Minimum integer type
Maximum integer type
Average floating point type
Standard deviation floating point type
Median floating point type
Mode integer type
OUTPUT FILE
Your program shall produce a formatted output file with this information: (1) Numbers of data points (2) Minimum (3) Maximum (4) Average (5) Standard deviation (6) Median (7) Mode(s)
MENUS AND PROMPTS
The programmer is responsible for designing and implementing a user interface. You may use menus and prompts. The user must be able to specify the name of the input file and the output file.
PROGRAM REQUIREMENTS
A "hidden" requirement of the program is: to compute the median and mode, the data must be sorted. "Sorted" means the values must be arranged in order, from smallest to largest. Sorting algorithms are discussed in the textbook. The program shall include a separate function to find the minimum value before the data is sorted. The program shall include a separate function to find the maximum value before the data is sorted. If an error occurs as the program runs, alert the user of the problem before the program terminates. If you are statistics geek, and have to ask, assume that the data set is population data, and not sample data
PROGRAM DESIGN
For this program, assume no more than 1000 numbers will be in any input file. Here is a rough program design, which you will need to flesh out.
STEP 1. Get name of input file from user. STEP 2. Open input file. STEP 3. Read input file into an array (the arrays size must be at least 1000). STEP 4. Close input file. STEP 5. Compute the values: ---- Minimum ---- Maximum ---- Average ---- Standard deviation STEP 6. Sort the array (smallest-to-largest) and find: ---- Median ---- Mode(s) STEP 7. Write results to screen STEP 8. Get name of output file from user. STEP 9. Open output file. STEP 10. Write results to output file. STEP 11. Close output file. STEP 12. Terminate program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started