creating-a-program-in-C-plus-plus-visual-studios
Using Arrays
Create a program that:
- Prompts the user to input values for an array of five integers
- Displays a menu, where the user may choose
- Sum – Calculates and displays the sum of numbers in the array
- Mean – Calculates and displays the average of numbers in the array
- Display – Displays the current values held in the array
- Sequencing – Displays the difference between each adjacent set of values
- Ie if we had 3 5 2 9 0, we would get the output
- 2 -3 7 -9
- This just needs to be printed, not saved
- Ie if we had 3 5 2 9 0, we would get the output
- Search – Indicate whether the user’s chosen value is contained in the array, or not (boolean result should be returned, ie function).
- Edit – The user is re-prompted for input into the array (all elements)
- Exit – terminate the program
- Loop back to step 2
- There should be at least 4 functions used in this program
You should probably use a global const int for array size. Do not use global variables unless they’re constants!
Extra Credit: Include an option to sort the array. Sorting must be implemented yourself with comparisons and assignment operators.
Points:
1 – Documentation, readability, format
2 – Proper use of functions
3 – Proper program flow (conditionals, loops, etc)
2 – Filename and Header
2 – Output testing
Header
//Author: Eric May (your name)
//CPSC 121 Lab 5
//<MM/DD/YY> (Current Date)
Filename
<Last Name><First Initial>lab5.cpp
For example, my assignment would be named MayElab5.cpp