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]
3 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]3 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
Using these Web sites for guidance, write a definition in your own words for five of the terms listed below.
Feliz [49]

Answer:

Gigabyte: Unit of measurement, is 10^9 bytes.

Intranet: Network that is used for sharing info, and other services.

Pixel: Creates a image, it is the smallest element on a display on a device.

Modem: Converts signals produced by a computer or another type of device.

Digital: Problem solving by any capable class device.

Explanation:

Short and simple.

7 0
3 years ago
In excel, a number can contain the characters__
KATRIN_1 [288]
Comma and period? You can have numbers like 123,456.78
7 0
3 years ago
Instructions:Select the correct answer from each drop-down menu.
mario62 [17]

when using a dark background for presentations you should use bright colors to contrast with it


this makes the informations much easier to see and read for example white text on black background

6 0
2 years ago
For your biology class, you have taken a number of measurements for A plant growth experiment. you wish to create a chart that s
Natasha2012 [34]
The answer is B, calc or excel
4 0
3 years ago
If you want a language that is relatively easy to write and which can be tested easily as it's being developed, you would choose
Oksi-84 [34.3K]

Answer:

true

Explanation:

because it needs a interpreter so that it could be more developed

3 0
3 years ago
Other questions:
  • Consider a multiprocessor CPU scheduling policy. There are 2 options: 1) a singlecommon ready queue of jobs; when a CPU becomes
    8·1 answer
  • Do Violent Video Games Make People More violent in Real Life ?
    14·1 answer
  • Optimally, the __________ guides investment decisions and decisions on how ISs will be developed, acquired, and/or implemented.
    6·1 answer
  • What is the energy conversion of solar water heaters?
    12·1 answer
  • Which of these are examples of a Single Sign-On (SSO) service?
    5·1 answer
  • Which output will be displayed by the following program?
    5·2 answers
  • Match each type of software license with the appropriate definition.
    11·1 answer
  • Please select the word from the list that best fits the definition
    13·2 answers
  • Why are default parameters useful? *This is JavaScript*
    7·1 answer
  • write an algorithm to settle the following question: a bank account starts out with $10,000. interest is compounded monthly at 6
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!