Activity 4.7. Adding User Input.
Please write a program that adds integers, entered by the user.
First, ask the user to enter the number of integers they wish to add. Next, use a
for
-loop that runs the desired number of times, and in which you continually ask the user to enter another number that then gets added to the sum.When the loop terminates, print the result to the screen.
Here is a sample session, with simulated user input in bold:
How many numbers do you wish to add? 5 Please enter number 1: 7 Please enter number 2: 13 Please enter number 3: 4 Please enter number 4: -3 Please enter number 5: 9
When you are done, please copy the code you added into the box below: