Write a program that receives a series of numbers from the user
and allows the user to press the enter key to indicate that he or
she is finished providing inputs.
After the user presses the enter key, the program should print the
sum of the numbers and their average.
>>> totalSum =0
>>> count=0
>>> while True:
number=input("Enter a number or press enter to
quit:")
if number =="":
break
totalSum += float(number)
count+=1
avg=totalSum/count
print ("Sum=",totalSum)
print ("Average =", avg)
Enter a number or press enter to quit:1
Sum= 1.0
Average = 1.0
Enter a number or press enter to quit:2
Sum= 3.0
Average = 1.5
Enter a number or press enter to quit:3
Sum= 6.0
Average = 2.0
Enter a number or press enter to quit:4
Sum= 10.0
Average = 2.5
Enter a number or press enter to quit:5
Sum= 15.0
Average = 3.0
Enter a number or press enter to quit:17
Sum= 32.0
Average = 5.333333333333333
Enter a number or press enter to quit:323
Sum= 355.0
Average = 50.714285714285715
Enter a number or press enter to quit:1000
Sum= 1355.0
Average = 169.375
Enter a number or press enter to quit:2
Sum= 1357.0
Average = 150.77777777777777
Enter a number or press enter to quit:1
Sum= 1358.0
Average = 135.8
Enter a number or press enter to quit:
I have no problem coming up with the python code, But i need help with pseudocode and a flowchart for this program. been having trouble coming up with it. Im good with python just havent really been taught the pseudocode very well. thank you
DECLARE totalSum =0,count=0
LOOP:
OUTPUT: Enter a number or press enter to quit:
INPUT number
IF number =="":
EXIT LOOP
totalSum =totalSum+ float(number)
count++;
END LOOP
avg=totalSum/count
OUTPUT "Sum ",totalSum
OUTPUT "Average ", avg
Flowchart:
Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me
Write a program that receives a series of numbers from the user and allows the user...
Design the logic for a program that allows a user to enter 10 numbers, then displays all of the numbers, the sum and average of the numbers. (Use array and loop.) the pseudocode in python please
Description: Write a program that asks the user to enter a series of numbers, and report the following: • The maximum number in the series • The minimum number in the series • The average of all positive numbers in the series The user will enter a pound key ‘#’ to stop the series. in Python
Please I wish you use Python 3.7 for this problems. Q1. Write a program that receives a series of numbers from the user and allows the user to press the enter key to indicate that he or she is finished providing inputs. After the user presses the enter key, the program should print the sum of the numbers and their average. Q2. The credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest rate of...
a. Design the logic for a program that allows a user to enter 12 numbers, then displays them in the reverse order of entry. b. Modify the reverse-display program so that the user can enter any amount of numbers up to 12 until a sentinel value is entered. ( I really could use more of a pseudocode rather than actual code. also an explanation of each step. The answer I got last time was just c++ code that including a...
Write a PYTHON program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the...
# C++ Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter two values. The program outputs the sum of and the difference between the two values.
Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in the array and then display the following data: The lowest number in the array The highest number in the array The total of the number in the array The average of the numbers in the array PLEASE GIVE THE PSEUDOCODE AND CODE IN C PROGRAMMING
Write a program that allows the user to enter a series of exam scores. The number of scores the user can enter is not fixed; they can enter any number of scores they want. The exam scores can be either integers or floats. Then, once the user has entered all the scores they want, your program will calculate and print the average of those scores. After printing the average, the program should terminate. You need to use a while loop...
Write a program that calculates the average of a stream of non-negative numbers. The user can enter as many non-negative numbers as they want, and they will indicate that they are finished by entering a negative number. For this program, zero counts as a number that goes into the average. Of course, the negative number should not be part of the average (and, for this program, the average of 0 numbers is 0). You must use a method to read...
In Python 3, Write a program that reads a set of floating-point values. Ask the user to enter the values, then print: The number of values entered. The smallest of the values The largest of the values. The average of the values. The range, that is the difference between the smallest and largest values. If no values were entered, the program should display “No values were entered” The program execution should look like (note: the bold values are sample user...