|
|
|
|
0 3 6 9 12 15 18 21 24 27 0 + 0 = 0 0 + 1 = 1 1 + 3 = 4 4 + 2 = 6 6 + 4 = 10 10 + 5 = 15 Process finished with exit code 0 |
Okay this is my final assignment for my coding class, i know how to do mostly everything but the functions i hate so much, and everything i know needs to be collab with the functions, please help. Instructions: 1. 2 function prototypes, one that counts in multiples (must be a void or contain cout statements, accepts 2 parameters, and uses a for loop to display the multiples of the numbers input) and another that calculates the average of grades entered (must return the value, must have 2 parameters) == this is really whats killing me 2. Must have a sentinel controlled while loop to quit, (Never taught us this, apparently we were suppose to "Go along with it" 3. Switch statement for the choice, a for average, q is quit, and m is multiples, (i got this) 4. Array that includes a for loop to input grades, it is in the switch statement, he said you can hard code the size of array and then calculate the sum in the loop, and must pass the sum and number of grades to the average function "you can hard code number of grades parameter, but use a variable for sum parameter" 5. Store the return value from the average function inside the switch case and display the average in the switch case. 6. Have an in and else statement anywhere in the program - I know its a crap ton but I'm really lost with mixing arrays and functions, i will very much appreicate tips and help with that
|