Lab 5: Sum Calculator
Objective
To gain experience with looping.
Task
For this lab, you will write a program to calculate the sum of a set of numbers read in by the user.
Details
- Start by asking the user how many numbers they will be adding.
- Write a loop to loop that many times.
- Each time through, ask the user to enter one integer.
- Add each integer into a variable which keeps track of the total sum.
- At the end, print the sum for the user
Example Run
Below is an example run of how this program should work:
How many numbers to enter? 5 Next number: 7 Next number: 11 Next number: 2 Next number: 19 Next number: 31 Total is 70
Submitting
When you are finished, please submit the .py file for the lab on Canvas. To do so, you'll need to navigate to where you saved the file on your computer.