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
3. Cellular phone technology works on a system of geographically separated zones
Nataly [62]

Answer:

Cellular phone technology works on a system of geographically separated zones

called

B. Cells

8 0
2 years ago
Select the steps for adding artwork into a placeholder on a presentation slide
Sloan [31]

Answer:

   Open the presentation that you want to add a slide to.

   In the pane that contains the Outline and Slides tabs, click Slides, and then click where you want to add a slide.

Explanation:

6 0
3 years ago
What is the difference between second generation and third generation of computer​
Alexeev081 [22]

Answer:

The main difference between second generation (2G) and third generation (3G) technology is data. 2G services were developed with mostly voice services in mind, but are capable of providing relatively slow (14.4kbps) speed data services.

8 0
2 years ago
What type of stud is placed below a windowsill to support its weight
Vesnalui [34]
A <span>cripple stud is what is use for windows and doors 

</span>
6 0
2 years ago
List and briefly describe passive and active security attacks.
Rama09 [41]

Answer:

Passive security attack are the unauthorized disclosure in the network attack. In this type of security attack a system are use for monitoring and sometimes scanning the open port. It basically include the monitoring the unprotected data and traffic analysis.

On the other hand, active security system modify the transmitted data and gain the unauthorized access from the computer system.

This type of security attack basically monitor the file transfer and electronic mail from the attacks which can be pass in the form of viruses in the computer system.

4 0
2 years ago
Other questions:
  • True or false? It is just too challenging to have different password for every
    12·1 answer
  • The ____ operation is used to add an element onto the stack.
    15·1 answer
  • which student organization helps students with career development by having them become interms to sponsor conferences?
    9·1 answer
  • What connector has 4 pins, is used for older IDE drives and some SATA drives, and can provide +5 V and +12 V power outputs?
    11·1 answer
  • Explain what a hypervisor application is and what it is used for. Pick a hypervisor application and list its requirements
    8·1 answer
  • Lab 6B: printing a binary number
    13·1 answer
  • 31. Explain what the program does. Write out the output 20 PRINT "Hellooo00000000000, world!" 30 PRINT "I'm learning about comma
    7·1 answer
  • Logan has developed an excellent presentation with interesting content. He received great feedback on the evaluation
    10·1 answer
  • What's the answer plssss​
    10·1 answer
  • Collaboration, listening, and negotiating are considered __________ skills.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!