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
Rom4ik [11]
3 years ago
10

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

An example of the program input and output is shown below:

Enter a number or press Enter to quit: 1
Enter a number or press Enter to quit: 2
Enter a number or press Enter to quit: 3
Enter a number or press Enter to quit:

The sum is 6.0
The average is 2.0
BASE CODE

theSum = 0.0
data = input("Enter a number: ")
while data != "":
number = float(data)
theSum += number
data = input("Enter the next number: ")
print("The sum is", theSum)
Computers and Technology
1 answer:
kogti [31]3 years ago
5 0

Answer:

theSum = 0.0#defined in the question.

count=0 #modified code and it is used to intialize the value to count.

data = input("Enter a number: ") #defined in the question.

while data != "": #defined in the question.

   number = float(data) #defined in the question.

   theSum += number #defined in the question.

   data = input("Enter the next number or press enter to quit ") #defined in the question "only some part is modified"

   count=count+1#modified code and it is used to count the input to print the average.

print("The sum is", theSum)#defined in the question.

print("The average is", theSum/count) #modified code and it is used to print the average value.

output:

  • If the user inputs as 1,4 then the sum is 5 and the average is 2.5.

Explanation:

  • The above code is written in the python language, in which some part of the code is taken from the question and some are added.
  • The question has a code that tells the sum, but that code is not print the average value of the user input value.
  • To find the average, some codes are added, in which one count variable which is initialized at the starting of the program and gets increased by 1, when the user gives the value.
  • Then that count divides the sum to print the average.
You might be interested in
Stuart wants to delete some text from a slide. What should Stuart do?
WITCHER [35]
Go to the slide and use backspace to delete the text. He answer is A.
3 0
4 years ago
Explain the importance of calculating a robot’s ability to extend its arm
MArishka [77]

Answer:

robot's importance

Explanation:

An industrial robot is equipped with many metrological or measurable properties that directly influence the efficiency of the robot during its performance. Repetitiveness and accuracy are the main measurable features. In general, a robot's repetitiveness might be defined as its ability to perform the same task repeatedly. On the other hand, precision is the difference (i.e. the mistake) between the requested task and the achieved task. Its concepts are often confused in robotics when it comes to repeatability and accuracy.Therefore, repeatability is always doing the same thing, while accuracy always reaches your target.

7 0
3 years ago
Sammy created a new logo for his client enlarged to use on a billboard ad. Now Sammy needs to redo the logo. What should he do t
bazaltina [42]

Answer:

The answer is D. In order to make an advertisement, the photo or photos have to be clear and easy to see. They also have to stay clear when they are enlarged

Explanation:

4 0
3 years ago
What is ?
FinnZ [79.3K]

<u>Answer:</u>

A. The opening tag for an HTML document

<u>Explanation:</u>

The question was supposed to be What is < html >?

This tag is used as an opening tag for documents that use HTML.

7 0
3 years ago
Read 2 more answers
The structure of a language has five different components: __________ refers to the smallest unit of meaning in a language, wher
Mnenie [13.5K]

Answer:

  • Phoneme  
  •  Morpheme

Explanation:

The structure of a language has five different components.

Phonemes, morphemes, lexemes, syntax, and context.

Phoneme :

A phonemes is the smallest unit of meaning in language.

For example 'bake' or "brake' but a change in meaning has been trigger.The word 'r' has no meaning on its own.

Morpheme :

Morpheme is a series of phonemes.Morpheme is the smallest unit of sound in the language.

5 0
4 years ago
Other questions:
  • Prompt the user for an automobile service. Each service type is composed of two strings. Output the user's input. (1 pt) Ex: Ent
    9·1 answer
  • How do you use a iPad when it has a password ?
    9·2 answers
  • Why transport layer is usingconnectionless services if network layer is providing connection oriented services?
    10·1 answer
  • Write a C program to input basic salary of an employee and calculate gross salary according to given conditions.
    11·1 answer
  • Briefly describe the fundamental differences between project-based and product-based Software Engineering.
    10·1 answer
  • What game is the best for racing and modifying cars
    10·1 answer
  • Read the Python program below: num1 = int(input()) num2 = 10 + num1 * 2 print(num2) num1 = 20 print(num1) Question 1 When this p
    6·1 answer
  • Write an essay about yourself based on the dimensions of ones personality​
    9·1 answer
  • Cidr simplifies how routers and other network devices need to think about the parts of an ip address, but it also allows for mor
    13·1 answer
  • You have an application running on multiple ec2 instances, however every time an instance fails, your users complain that they l
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!