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
I need answer poooo<br>​
Fiesta28 [93]

Answer:

what is this?Are yhere any options for this question ❓

7 0
3 years ago
What is the worst case time complexity of insertion sort where position of the data to be inserted is calculated using binary se
laiz [17]

Answer:

O(n²)

Explanation:

The worse case time complexity of insertion sort using binary search for positioning of data would be O(n²).

This is due to the fact that there are quite a number of series of swapping operations that are needed to handle each insertion.

4 0
3 years ago
The class ________ is the portion of a class that is visible to the application's programmer.
Lady_Fox [76]

The correct option to this question is class interface.

The class interface is the portion of a class that is visible to the application’s programmer. Class interfaces mean implementation of public methods of the class. These class interfaces of the class are easily visible to the application’s program either the one who is developing the application program or the one who is reading the application’s code.

Class interface can be seen by the other classes as its public face. Class interfaces separate the class’s implementation and its interaction with other classes. That way the implementation of the class can be modified easily without being known by other classes. Basically, the programmer who is developing the program, all the portions of the programm is visible to that programmer.

For example, the class is written below:

class class-name

{

private members;

public method()

{

//method defination

}

}

when the class object is created, the code of the object to the programmer is visible.

<u>While the other options are incorrect:</u>

  • Form: the form is used to collect information from the user. It can be build using front-end development tools
  • Design: Design is a term used in computer or software engineering to make something from scratch or beginning. It can be  methodologies, standards, or techniques etc.
  • Control: Control is the mechanism or a term used in software development to control the program or execution of the program.

You can learn more about class interface at

brainly.com/question/13089781

#SPJ4

The complete question is found while searching over internet:

"

<em>The class ________ is the portion of a class that is visible to the application's programmer.</em>

  • <em>Interface</em>
  • <em>Form</em>
  • <em>Design</em>
  • <em>Control </em>

"

7 0
1 year ago
Write a program that gets five integer test scores from the user, calculates their average, and prints it on the screen. Test yo
Alex

Answer:

total = 0

for i in range(5):

   score = int(input("Enter a score: "))

   total += score

average = total / 5

print("The average is " + str(average))

Explanation:

*The code is in Python.

Initialize the total as 0

Create a for loop that iterates five times. Inside the loop, ask the user to enter a score. Add the score to the total (cumulative sum)

After the loop, calculate the average, divide the total by 5

Print the average

5 0
3 years ago
?trophic levelNYIGVU.;/IO9YK7,'0;
grin007 [14]

please add more information, about your answer {history restored}

go to brainly.com for [HELP]

7 0
3 years ago
Other questions:
  • Some smartphones use ______ text, where you press one key on the keyboard or keypad for each letter in a word, and software on t
    13·1 answer
  • Select the correct answer.
    7·2 answers
  • 50 Points! 25 Points Each! Please help ASAP! Will mark brainliest! See attached image.
    10·2 answers
  • A system is composed of four parts, J, K, L, and M. All four must function for the system to function. The four component reliab
    6·1 answer
  • Tornado Alley is located in the middle of the United States, extending from Texas up through the Dakotas. The above statement is
    6·1 answer
  • What is output if month = 11 and day = 14?
    13·2 answers
  • You are an IT network administrator at XYZ Limited. Your company has critical applications running of its Ubuntu Linux server. C
    6·1 answer
  • ¿En qué países se ha implementado un sistema de vigilancia a través de drones?, ¿qué aspectos positivos y negativos ha generado?
    13·1 answer
  • A(n) ________ will clear all user data and setting changes, returning the device's software to the state it was in when it left
    6·1 answer
  • What will help the programmer understand what’s going on in the program?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!