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
Mars2501 [29]
3 years ago
7

(1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the arr

ay's numbers on one line, each number followed by one space. (2 pts) Ex: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 142.0 Enter weight 4: 166.3 Enter weight 5: 93.0 You entered: 236.0 89.5 142.0 166.3 93.0 (2) Also output the total weight, by summing the array's elements. (1 pt) (3) Also output the average of the array's elements. (1 pt) (4) Also output the max array element. (2 pts) Ex: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 142.0 Enter weight 4: 166.3 Enter weight 5: 93.0 You entered: 236.0 89.5 142.0 166.3 93.0 Total weight: 726.8 Average weight: 145.35999999999999 Max weight: 236.0
Computers and Technology
1 answer:
Mashutka [201]3 years ago
6 0

Answer:

weights = []

total = 0

max = 0

for i in range(5):

   weight = float(input("Enter weight " + str(i+1) + ": "))

   weights.append(weight)

   total += weights[i]

   if weights[i] > max:

       max = weights[i]

average = total / 5

print("Your entered: " + str(weights))

print("Total weight: " + str(total))

print("Average weight: " + str(average))

print("Max weight: " + str(max))

Explanation:

Initialize the variables

Create a for loop that iterates 5 times

Get the values from the user

Put them inside the array

Calculate the total by adding each value to the total

Calculate the max value by comparing each value

When the loop is done, find the average - divide the total by 5

Print the results

You might be interested in
Write a program to add two number marie simulator.
Gnoma [55]
Int a, b;
cout<<"write to numbers";
cin>>a>>b;
cout<
8 0
3 years ago
How can i promote netiquette??​
Kay [80]

Answer: Neh - tuh - ket

Explanation:

The above answer is the phonetical pronunciation of the word Netiquette which is an amalgamation of the words, Net and Etiquette and as the term implies, refers to the behavior on the internet that is socially acceptable and good so that other people are not made to feel uncomfortable.

3 0
2 years ago
GIVING BRAINLIEST What does output allow a computer to do? Display information Receive information Do complex math problems Do m
kumpel [21]
The answer is display information
4 0
3 years ago
Read 2 more answers
The purpose of the 3030 gas dehydration unit
kozerog [31]

Answer:

Explanation:

Glycol dehydration is a liquid desiccant system for the removal of water from natural gas and natural gas liquids (NGL). It is the most common and economical means of water removal from these streams.[1] Glycols typically seen in industry include triethylene glycol (TEG), diethylene glycol (DEG), ethylene glycol (MEG), and tetraethylene glycol (TREG). TEG is the most commonly used glycol in industry.[1]

8 0
2 years ago
Select the best answer from the drop-down menu.
maw [93]

Answer:

1) performance assessments

2) measurable goals

3)can't be measured quantitatively

4) milestones

Explanation:

Methods of evaluating the performance and productivity of an individual or group in relation to predetermined criteria and measurable goals are <u>performance assessments.</u>

<u>measurable goals</u> are goals that have concrete criteria for measuring progress toward their attainment.

Why are statements like “great customer experience” or “more sales” not good assessment criteria? <u>can't be measured quantitatively</u>

Personal goal setting helps lagging performance by setting <u>milestones</u>

which are short-term achievable tasks.

<u>OAmalOHopeO</u>

8 0
2 years ago
Read 2 more answers
Other questions:
  • Ron is creating building blocks in Word. How can he make the building blocks that he created available?
    11·2 answers
  • Ascending and descending are examples of
    5·2 answers
  • Your boss asks you to work through the weekend to install new software on the applications server that serves up applications to
    15·2 answers
  • James, a technician, needs to format a new drive on a workstation. He will need to configure read attributes to specific local f
    5·1 answer
  • Was the type writer the first part of the keyboard? ​
    8·1 answer
  • Wide area network (WAN) connects multiple networks that are in the same geographical locations.
    6·1 answer
  • Which computer component are you most like? Explain why.
    10·1 answer
  • He flow of electric charges through a material describes an electric _______.
    10·1 answer
  • Cómo fue posible que los alemanes exterminando seres humanos​
    11·1 answer
  • What is a word processing program? Give examples of word processing programs.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!