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
can I do all my work in a notebook with Penn foster or do I have to type all of the answers in that little box?
dusya [7]
Um whichever is better for you! ummm whats the point of this question?
5 0
3 years ago
Read 2 more answers
Which line of code will use the overloaded multiplication operation?
maks197457 [2]

Answer:

def __mul__(self, b):

Explanation:

correct edge 2021

4 0
2 years ago
A network technician is planning to update the firmware on a router on the network. The technician has downloaded the file from
zhenek [66]

Answer: B. Perform a hash on the file for comparison with the vendor’s hash.

Explanation:

Before installing the firmware update, the step that the technician should perform to ensure file integrity is to perform a hash on the file for comparison with the vendor’s hash.

Hashing refers to the algorithm that is used for the calculation of a string value from a file. Hashes are helpful in the identification of a threat on a machine and when a user wants to query the network for the existence of a certain file.

5 0
3 years ago
A predictive data analyst___.
fgiga [73]

Answer:

C. analyzes data and trends and predicts future data and trends.

Explanation:

Predictive analytics can be defined as a statistical approach which typically involves the use of past and present data ( factual informations) in order to determine unknown events or future performances of a business firm or organization. It is focused on determining what is likely to happen in the future.

For example, a data analyst trying to determine how to effectively stock his company's warehouses incase of an anticipated pandemic and he's using current sales data to project the demands.

Hence, a predictive data analyst is an individual who analyzes data and trends and predicts future data and trends.

3 0
3 years ago
Create a simple program of your own using a Loop that counts and displays numbers 1-10.
avanturin [10]

Answer:

I think

Explanation:

you....

8 0
3 years ago
Other questions:
  • Which is a possible benefit of having a good credit history?
    13·2 answers
  • Match the design feature or area of expertise with the benefit or increase in usability it offers. 1. standardized placement of
    5·1 answer
  • Write the document type declaration markup statement for an HTML5 file. Be sure to include the appropriate opening and closing b
    12·1 answer
  • The overall visual look of a chart in terms of its graphic effects, colors, and backgrounds is the:
    5·1 answer
  • (Help please I don't know what to choose because it's both text and email but I can only pick one. HELP!!!!!!!!!!)
    6·2 answers
  • Design (draw a datapath) for a block that will help your processor decide whether to take a branch for different conditions. As
    8·1 answer
  • Heres the last questions
    5·1 answer
  • You have just purchased a motherboard that has an LGA 1156 socket for an Intel Pentium processor. What type of memory modules wi
    14·1 answer
  • Ayuda no encuentro la información de estas tres preguntas:
    10·1 answer
  • Kim agrees. You get the equipment from the truck and begin working. Kim approaches you as you are installing the modem and is a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!