Question: You are tasked with implementing an enhanced number analysis program. You will be expected to populate a vector with numbers read from the user and

You are tasked with implementing an enhanced number analysis program. You will be expected to populate a vector with numbers read from the user and display various statistics: sum, average, minimum, and maximum.
OUTCOMES
Successfully populate a std::vector from a user (by reading from std::cin)
Correctly pass and return std::vector to other functions
Use C++ Standard Library algorithms to assist with computing statistics
Adhere to strict formatting requirements
FILE STRUCTURE
Downloading the handout file will give you a handout.tar file. You can extract the contents of the tar file by providing the following command:
tar xf handout.tar
tar is the name of the command we are running
the x indicates to eXtract
the f indicates there is a File we wish to operate on
handout.tar is the file we wish to extract
The handout will contain several files:
Statistician.h header file for required methods (do not change)
Statistician.cpp source file for required methods
Driver.cpp source file for driver application
Makefile makefile file to assist with compilation (do not change)
REQUIRED FUNCTIONS
Statistician.cpp
// Finds the largest value in the passed vector
// Assumes nums is not empty
float
maximum (const std::vector& nums);
// Finds the smallest value in the passed vector
// Assumes nums is not empty
float
minimum (const std::vector& nums);
// Finds the sum of values from the passed vector
// Should return zero if the vector is empty
float
sumOfValues (const std::vector& nums);
// Finds the average of all values from the passed vector
// assumes nums is not empty
float
average (const std::vector& nums);
// Creates and returns a new vector. Reads in count number
// of values from the user by prompting for each one
// should return an empty vector if count <=0
std::vector
populate (int count);
Driver.cpp
// Entry point to the program
// The program should perform the following tasks:
//1. Prompt the user to enter the count of numbers
//2. populate and return a vector with values read from the user
//3. Report the sum, average, min, and max
int
main(int argc, char* argv[]);
SAMPLE INPUT/OUTPUT
Enter number of values ==>5
Enter value ==>1.5
Enter value ==>5.5
Enter value ==>2.5
Enter value ==>3.5
Enter value ==>4.5
The statistics of all 5 values are:
Sum: 17.5
Avg: 3.5
Min: 1.5
Max: 5.5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!