adbdragonmaster
Enthusiast
FOR C/C++
I am having trouble doing this program.
Write a small program that fills an array of doubles with user input, prints the doubles on the screen in a column, and adds up all the doubles in the array and prints the sum onto the screen. You must use at least 3 functions
- Declare an array of doubles of size 20.
- Ask the user how many doubles to enter <= 20.
- Use a loop to read the doubles into the array from the user.
- Use a loop to print the array onto the screen in a column.
- Use a loop to add up all the items in the array and store the sum
- print the sum onto the screen
My specific questions:
How do you make a loop that changes the array to the next one so that the user can keep entering?
What functions do you suggest?
Really all I need is the first question, and I should be able to do the rest. Thank you.
I am having trouble doing this program.
Write a small program that fills an array of doubles with user input, prints the doubles on the screen in a column, and adds up all the doubles in the array and prints the sum onto the screen. You must use at least 3 functions
- Declare an array of doubles of size 20.
- Ask the user how many doubles to enter <= 20.
- Use a loop to read the doubles into the array from the user.
- Use a loop to print the array onto the screen in a column.
- Use a loop to add up all the items in the array and store the sum
- print the sum onto the screen
My specific questions:
How do you make a loop that changes the array to the next one so that the user can keep entering?
What functions do you suggest?
Really all I need is the first question, and I should be able to do the rest. Thank you.