Question: c++ programming 1. In a file named sentine|_sum.py, write a program that continuously asks the user to enter a positive integer value. If the user
c++ programming

1. In a file named sentine|_sum.py, write a program that continuously asks the user to enter a positive integer value. If the user enters 1, then the program should stop asking the user to enter a number and should instead print the sum of the numbers that the user have already entered. (the 1 should not be included in the sum). Below is a sample run of the program. Enter a positive integer value: 10 Enter a positive integer value: 20 Enter a positive integer value: 30 Enter a positive integer value:: -1 The sum of the numbers you entered is 60. 2. In a file named sentinel_average.py copy and paste the code that you wrote for question #1 above. You should then alter this code so that instead of printing the sum of the postive integers that are entered, you print the average of the numbers entered (except for the -1) Below is a sample run of the program. Enter a positive integer value: 10 Enter a positive integer value: 20 Enter a positive integer value: 30 Enter a positive integer value: -1 The average of the 3 numbers you entered is 20. NOTE: The average could end up being a float HINT: Be sure to use a variable to keep track of how many numbers were entered
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
