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
In this technique, each attribute is associated with a specific feature of a face, and the attribute value is used to determinet
s344n2d4d5 [400]

Answer:

Chernoff faces.

Explanation:

Chernoff faces is a data visualization technique that was developed by a statistician named Herman Chernoff. He introduced this data visualization technique to the world in 1973 to represent multivariate or multidimensional data containing at least eighteen (18) variables.

In Chernoff faces, each attribute is associated with a specific feature of a face (nose, eyes, ears, hair, mouth, and eyebrows), and the attribute value with respect to size, shape, orientation, colour and placement is used to determine the way a facial feature is expressed.

The Chernoff face is a technique designed and developed to help detect similarities between different items and discern subtle changes in facial expressions from the perspective of an observer.

6 0
3 years ago
Is a three-prong grounding plug with the third pong broken-off safe to use.
ad-work [718]
What is the answer choices dude
8 0
3 years ago
Assume that an array of integers named a that contains exactly five elements has been declared and initialized. Write a single s
Alik [6]

array[0] = 2 * array[4];

5 0
3 years ago
Routing between autonomous systems is referred to as ______ .
Gennadij [26K]

Answer:

The correct answer for the given question is an option(b) i.e "interdomain routing".

Explanation:

The Interdomain Routing algorithm protocol works between the domains. The protocol which is used in the interdomain routing is called as exterior gateway protocol. In the interdomain routing protocols works between the autonomous systems, it means they are taking place in the autonomous networks.

  • Intradomain routing works within the domain. They are not works between the autonomous systems so the option(a) is incorrect.
  • Out-of-domain are neither work in within or between the system so option(d) is incorrect.
6 0
3 years ago
You are responsible for performing all routine maintenance on your company's laser printers. Which of the following maintenance
Luden [163]

Answer:

B. installing the maintenance kit

Explanation:

page count keeps track of how many number of pages that have been printed since the installation of the last maintenance kit. When a new maintenance kit is installed on most Laser printers, the page count is reset because it does not automatically clears most times, hence, there's the need to clear the count manually.

4 0
4 years ago
Other questions:
  • Which of the following is not a standard method called as partof the JSP life cycle?
    5·1 answer
  • Write a class named Car that has the following data attributes: • _ _year_model (for the car’s year model) • _ _make (for the ma
    15·1 answer
  • What is the point of completing a value assessment while searching for a career
    11·1 answer
  • My computer keeps freezing when trying to start up a new computer (got a new motherboard, CPU, GPU, case, and psu)(had to get a
    8·1 answer
  • Which of the following best describes a hacktivist? Select one: a. An individual who attempts to destroy the infrastructure comp
    6·1 answer
  • Good ways to increase sales on phone accesories?
    10·2 answers
  • Filmmakers must often establish information quickly in a film in order to give the audience context for the plot. In this film,
    5·1 answer
  • Text me on instagram forever.brazy so we can watch a movie​
    15·1 answer
  • Which of the following is the best description of an ip address?
    8·1 answer
  • How ict tools changed the way we live explain it​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!