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
storchak [24]
3 years ago
15

Statistics are often calculated with varying amounts of input data. Write a program that takes any number of integers as input,

and outputs the average and max. Ex: If the input is: 15 20 0 5 the output is: 10 20 Note: For output, round the average to the nearest integer.
Computers and Technology
1 answer:
katen-ka-za [31]3 years ago
4 0

Answer:

txt = input("Enter numbers: ")

numbers = txt.split(" ")

total = 0

max = 0

for i in numbers:

     total = total + int(i)

     if(int(i)>max):

           max = int(i)

print(round(total/len(numbers)))

print(max)

Explanation:

This solution is implemented using Python programming language

This prompts user for input

txt = input("Enter numbers: ")

This splits user input into list

numbers = txt.split(" ")

The next two line initialize total and max to 0, respectively

total = 0

max = 0

This iterates through the list

for i in numbers:

This sum up the items in the list (i.e. user inputs)

     total = total + int(i)

This checks for the maximum

     if(int(i)>max):

           max = int(i)

This calculates and prints the average

print(round(total/len(numbers)))

This prints the max

print(max)

You might be interested in
Create flowchart using Flowgorithm to represent the logic where the user inputs a number between 1 and 3 and displays the number
lisabon 2012 [21]
Don’t we all hate school or just me?
7 0
3 years ago
This isn't academic, but what do I do if HI-REZ won't let me sign into an existing account. “Something went wrong” keeps popping
NNADVOKAT [17]

Answer:

contact their support

Explanation:

6 0
3 years ago
True or False
OverLord2011 [107]

Answer:False

Explanation:

7 0
3 years ago
What are the five resources paid for by local taxes
Mrac [35]

Answer & Explanation:

A local tax is usually collected in the form of property taxes and is used to fund a wide range of civic services from garbage collection to sewer maintenance. The amount of local taxes may vary widely from one jurisdiction to the next. Local tax is also referred to as a municipal tax.

6 0
4 years ago
What are programs that are installed without the user knowing
Goshia [24]
Hacks , aim bot wanna play fort nite some time I’m really good at it lol
6 0
3 years ago
Other questions:
  • Michelle is a salesperson who is paid on commission. She just sold a customer a very reasonably priced tablet, but only after th
    14·1 answer
  • Consider a system running 10 I/O-bound processes and 2 CPU-bound process. Assume that the I/O-bound processes issue an I/O opera
    9·1 answer
  • Individuals who require better speed and performance for graphics-intensive applications (e.g., video editing, gaming, etc.) pre
    8·1 answer
  • If you are working with a team of students on a class project and your team chooses to share content by uploading Word and Excel
    13·1 answer
  • What command would Emile use in his word processing software to insert a bar chart that will automatically adjust to changes mad
    6·2 answers
  • WILL GIVE BRAINLIEST
    15·1 answer
  • a) In an office, it is required to take hundreds of copies of the same type written document. Which traditional method of docume
    11·1 answer
  • Moving images of real event​
    12·2 answers
  • Which type of malware prevents you from accessing files stored on your computer?
    10·2 answers
  • The int function can convert floating-point values to integers, and it performs rounding up/down as needed.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!