Project 1 - Statistics Program
0. Getting Started
1. Optional Introduction to C++ and Programming Concepts
2. So… How Do I Use and Code in C++
3. Inputs, Outputs and Comments
4. Initialization of Variables
5. Other Data Types
6. Number Operators
7. Control Flow
8. Vectors
9. Functions
Project 1 - Statistics Program
Project 2 - Rocket Simulation
Project 3 - Airline Management
Now that you have a bit of knowledge of C++, we’re going to do a fairly simple activity to get you started using a bit of statistics. In any field of engineering, the collection of data is very important in testing and improving designs and experiments. In Aerospace Engineering, data is collected all the time when testing new designs of anything from a drone propellor to a rocket engine. Analyzation of this data helps in discovering issues with the design, and may indicate how to improve it. If you would like to know more about statistics in aerospace engineering, the following link leads you to an article from NASA that discusses this in detail.
We have given you two test vectors of numbers. They are shown here:
Your job in this activity is to find the mean, maximum, minimum, and range of each of these vectors. You will write a function to find each of these values, some of which may utilize the other functions you write. You will also write a function that checks to see if the vectors are in ascending order.
To review, the mean is the total of all the numbers in a group divided by how many numbers are in that group. The maximum is the largest number in the group. The minimum is the smallest number in the group. The range is the difference between the smallest and largest values (this function will use other functions!). Your final function will check if the numbers are in order by ensuring that the number previous to each number is less than itself. This function will output a boolean value and the other 4 functions should output integers. Some starter code is provided for you here to get you started: https://onlinegdb.com/HyQtXH9cL
(To work from the starter code provided, go to the link and click on “Fork this” above the code. You should now be able to edit the starter code and save it as your own project.)
Summary of what your program should include:
The two vectors that are given to you should be declared and initialized
A function that calculates the maximum value of a vector and returns this as an int
A function that calculates the minimum value of a vector and returns this as an int
A function that calculates the range of a vector and returns this value as an int
A function that calculates the mean of a vector and returns this value as an int
A function that checks if a vector is in ascending order and returns this value as a bool
Use these functions to calculate each of these values for both vectors
Displays all of these values on the console when executed
If you wish, you may create your own vectors of integers to test your functions. Keep in mind that we are using integer precision for the mean here, so if you calculate this value by hand you may obtain a slightly different value. You may also write more functions to compute statistically important information, such as the median, mode, or standard deviation. When you write these functions, however, you may want to consider putting the numbers in your vectors in ascending order (or even creating a function to do so). Good luck!