Question: using C++ Learning objective: practice more on using IO Streams, arrays, and learn to implement algorithms. Program objective: Write a program that allows the user
using C++
Learning objective: practice more on using IO Streams, arrays, and learn to implement algorithms.
Program objective: Write a program that allows the user to calculate statistics in a given input file.
Example usage:stats.exe 1 c:\\temp\\sample1.csv c:\\temp\\sample1_stats.csv
2, 2, 2, 2
4, 4, 0, 4
2, 3, 3, 3 Row, Sum, Mean, STD, Median, Mode, Min, Max
1, 8, 2, 0, 2, 2, 2, 2
2, 12, 3, 2, 4, 4, 0, 4
3, 11, 2.75, 0.50, 3, 3, 2, 3
Requirements: The user can provide the path to any .csv file he/she inputs to the program The user can write the output .csv file to any location; your program should handling inaccessible paths gracefully. Use floating point with 2 significant digits. You must use loop(s) to calculate the statistics. You must not use any built-in functions to calculate any of these statistics. The argument 1 determines the statistics to write to file:
1: all statistics (as shown in example above)
2: calculate and print the mean and STD only
[New] To get users input of filenames, you may use one of the following two approaches:
1. Specify as command line argument
2. Query user via std::cin 2, 2, 2, 2
4, 4, 0, 4
2, 3, 3, 3 Row, Sum, Mean, STD, Median, Mode, Min, Max
1, 8, 2, 0, 2, 2, 2,
2 2, 12, 3, 2, 4, 4, 0, 4
3, 11, 2.75, 0.50, 3, 3, 2, 3 sample1.csv sample1_stats.csv stats.exe 1 c:\\temp\\sample1.csv c:\\temp\\sample1_stats.csv
Also Allow your program to take 2 or more input .csv files, merge the data points of each row, and then calculate the statistics of the merged data Assumptions: 2 data files have same number of rows (what if they dont? how may you address these problem cases? Hint: use try-catch) Example usage:
sample1.csv
2, 2, 2, 2
4, 4, 0, 4
2, 3, 3, 3
sample2.csv
2, 2
4, 4
0, 0
integraged_stats.csv Row, Mean, STD
1, 2, 2,
2, 3.30, 1.63
3, 11, 1.47
Step by Step Solution
There are 3 Steps involved in it
To create a C program that calculates statistics from an input file and writes the results to an output file based on the users specifications you need to follow these steps Below is a general guide o... View full answer
Get step-by-step solutions from verified subject matter experts
