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
Overview
ludmilkaskok [199]

Answer:

the answer is in the image below:

Explanation:

5 0
3 years ago
Which is a benefit of traditional SLR cameras over digital cameras? A. They produce negatives to serve as backups. B. They make
VLD [36.1K]

B. They make it easy to take panoramic photographs of the crime scene.

Explanation:

  • SLR is the single-lens reflex analog camera with dated looks. Traditional SLR has more manual controls and no monitor on the rear.  
  • A DSLR or Digital Single Lens Reflex camera is a facelift of the traditional SLRs. They are pricey but have the power of capturing minutest details.  
  • SLRs give more opportunity for creativity. They give an important competition to digital cameras in pixel output too.  
  • However, if the quality is paramount invest in a good SLR.

6 0
3 years ago
Can a computer evaluate an expression to something between true and false? Can you write an expression to deal with a "maybe" an
Maurinko [17]

Answer:

yes a computer can evaluate expressions depends on the computer for the maybe expression

Explanation:

4 0
3 years ago
Read 2 more answers
What is data protection
Fiesta28 [93]
Legal safeguards to prevent misuse of information stored on computers, particularly information about individual people.             In other terms it is security for personal information.
3 0
3 years ago
is the practice of using the internet to provide healthcare without going to a doctor’s office or hospital.
devlian [24]

Answer:

Telemedicine refers to the practice of caring for patients remotely when the provider and patient are not physically present with each other. Modern technology has enabled doctors to consult patients by using HIPAA compliant video-conferencing tools.

Explanation:

6 0
3 years ago
Other questions:
  • From the video "Your Password Sucks", using computer power to guess your password by trying multiple variations one after the ot
    15·2 answers
  • True or false: a cover letter accompanies a resume to showcase a job-seeker’s personal life
    6·2 answers
  • What natural boundary separated british territory from louisiana?
    7·1 answer
  • You want to enable nap so that all portal computers using wireless connections have an active firewall. which type of enforcemen
    11·1 answer
  • HELPPPP!!
    8·2 answers
  • Which of the following lists contains the five essential elements of a computer? Group of answer choices: 1. inputs, returns, pr
    11·1 answer
  • What is it called when two different files generate the same hashing result?
    15·1 answer
  • Examine the following declarations and definitions for the array-based implementations for the Stack and Queue ADTs. Assume that
    14·1 answer
  • These 2 questions PLEASEEE (:
    14·1 answer
  • A server is handling thousands of simultaneous connections, and proxying requests to another service. Which concurrency model is
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!