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
Chris wants to view a travel blog her friend just created. Which tool will she use?
wolverine [178]

Answer:

Web browser

Explanation:

7 0
3 years ago
The piece of hardware that contains the circuitry that processes the information coming into the computer and tells the other ha
Aleksandr-060686 [28]
The central processing unit
6 0
3 years ago
Which of these is a negative effect of computer technology's role in creating
attashe74 [19]

Answer: the line between fake and real is blurred just took the test

3 0
3 years ago
1. Used ____________ must be hot drained for 12 hours or crushed before disposal.
Pani-rosa [81]

Answer:

D). Oil Filter

A). Reduce, reuse, recycle.

A). True

Explanation:

1). 'Oil filters' must be crushed or hot drained for a minimum of 12 hours before disposal or recycling because the used motor oil proves to be a very hazardous waste and it can badly affect the environment if disposed of improperly. Thus, the government has made strict rules for its disposal properly.

2). 'Reduce, reuse, recycle' which is also known as three R's is effective in the management of waste in a shop. It helps in reducing the amount of waste and harm to the environment by reusing things and recycling them again will help in preventing exploitation of the resources and promote sustainable development.

3). The hazardous waste is disposed of in secure landfills or incinerators with the proper focus to ensure that the bedrock and groundwater table is not affected by it. It helps in preventing the environment from the potential harm that can be caused by such hazardous waste.

3 0
3 years ago
What is a possible weakness of an expert-novice pair?
evablogger [386]

Answer:

The novice will be overwhelmed by the expert and not offer suggestions.

The novice will be overwhelmed by the expert and not offer suggestions.

Explanation:

Got it right on edge 2022

5 0
3 years ago
Other questions:
  • What type of operating system runs a dedicated electronic device such as a smart thermostat?
    5·1 answer
  • A ____ is text and graphics that print at the bottom of every page.
    12·1 answer
  • In a weighted scoring model, the sum of the weights of all the criteria must total _____ percent.
    15·1 answer
  • In a digital computer system, the data is transferred between the CPU and the other components
    11·1 answer
  • A virtual meeting is the same thing as a/an A. online meeting. B. VoIP. C. seminar. D. convention.
    12·1 answer
  • Mrs. Sims polled her students about which social media app they use most. Which type of chart would best display this data?
    9·1 answer
  • In this problem, you will fill in the code for a function count_digits(val) that takes a positive integer, val, and returns a li
    12·1 answer
  • Which of the following is NOT true about digitizing physical media?
    10·1 answer
  • Which of the following best describes the purpose of an Egyptian pyramid?
    14·2 answers
  • 5. What skill is unique to reading online?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!