1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Veseljchak [2.6K]
4 years ago
11

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 o

r she is finished providing inputs. After the user presses the enter key, the program should print: The sum of the numbers The average of the numbers
Computers and Technology
1 answer:
Dmitriy789 [7]4 years ago
5 0

Answer:

The solution code is written in Python 3

  1. count = 0
  2. sum = 0
  3. num = input("Enter a number: ")
  4. while(num != ''):
  5.    sum += float(num)
  6.    count += 1
  7.    num = input("Enter a number: ")
  8. print("Sum : " + str(sum))
  9. print("Average: " + str(sum / count))

Explanation:

Firstly, we declare two variables count and sum to hold the number of input number and the total of the input number, respectively (Line 1-2)

Next, we prompt user to input the first number (Line 4). While the num is not ' ' (This means it is not "Enter" key), accumulate the num to sum variable and increment count by one (Line 6-8) and then prompt the user to input the next number (Line 9).

At the end, display the sum and average using print function (Line 11 -12).

You might be interested in
Usually a WAN covers no more than one building.<br> Group of answer choices<br> True<br> False
Stella [2.4K]

Answer:

False

Explanation:

WAN's are a wide area covered in LAN's. LAN's only cover 1 building, while WAN's are a bunch of LAN's in a WIDE area (WAN = wide area network)

i hope this helps you :D

8 0
3 years ago
Read 2 more answers
What is the most used piece of technology in education?
Anna11 [10]
I would say a computer, in this time and age everyone uses laptops, computers, chrome books for education
4 0
3 years ago
Andrina writes letters that are regularly sent to hundreds of her company’s customers. Because of this, she would like for the M
galben [10]

The correct answer is A.

7 0
3 years ago
Cost, time, knowledge are examples of
Katena32 [7]
They are examples of constraints.
8 0
3 years ago
Robot is an example of which generation computer?​
n200080 [17]

Robot is an example of Fifth Generation Computer.

I hope it's help you...

Thanks♥♥

6 0
3 years ago
Other questions:
  • Can someone can help me am dont know how much RAM do i need. I use my pc for work and to watch yt vid. Thanks​
    10·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    15·1 answer
  • Powerpoint increased the weight of a line in ____ increments.
    13·1 answer
  • Write a file path for a document file that is saved on the F drive then a folder called homework, then a folder called math. The
    12·1 answer
  • What is a secondary storage medium that uses magnetic techniques to store and retrieve data on disks or tapes coated with magnet
    6·1 answer
  • Why does a bus topology require a terminator? a) because otherwise it would be a ring network b) because otherwise the packets w
    10·2 answers
  • SmartArt is especially useful for which types of objects? Check all that apply.
    10·2 answers
  • From your analysis, do you think you’ve seen all of the servers and hosts that make up the Amazon e-commerce site? How does Amaz
    12·1 answer
  • ______ is a type of specialized expansion bus used to connect audio and video equipment to the computer.
    10·1 answer
  • Write a program in c# that simulates the roll of two six sided dice.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!