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
An author is preparing to send their book to a publisher as an email attachment. The file on their computer is 1000 bytes. When
yulyashka [42]

Answer:

Explanation:

4

8 0
3 years ago
How much cell phone data does the average person use a month
azamat
It all depends on what you're doing online.
7 0
3 years ago
What are the six critical components of an information system? Select three of the six components, and describe a potential vuln
Blizzard [7]
People, procedures and instructions, data, software, information technology infrastructure, internal controls.
7 0
3 years ago
Fill in the blanks:
Temka [501]

Answer:

Explanation:

Since this is a fill in the blanks question, I will rewrite the sentences and make the answers bold and underlined for ease of access. Hope it helps.

1. A worksheet is made up of <u>cells</u> organized in a grid of rows and columns.

2. A <u>Cell Address</u> describes the location of a cell based on its column and row location.

3. A(n) <u>Absolute reference</u> refers to a fixed cell location that never changes.

4. Rows are typically represented by <u>Numbers</u> and contain data for individual records.

5. The <u>Format</u> of a worksheet defines its appearance.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

7 0
3 years ago
Plz help me! No guessing plz!
Tomtit [17]
C- World Wide Web - It has all web pages and files delivered by web servers 
4 0
4 years ago
Other questions:
  • hardtack was a. a new cone-shaped bullet. c. a type of biscuit. b. a sharp turn made on command. d. a type of body armor.
    6·1 answer
  • Fundamental types of data, such as strings, integers, and real numbers, are known as
    5·1 answer
  • Write a program that reads in two integers typed on the keyboard and outputs their sum, difference, and product.
    12·1 answer
  • I’m which scenario would someone most likely be using presentation software ?
    6·2 answers
  • Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
    6·1 answer
  • Problem 4 (3 pts): Let n be a positive integer. Show that among any group of n 1 (not necessarily consecutive) positive integers
    15·1 answer
  • Dave has to create animations for a game. Which tool can Dave use?
    6·1 answer
  • You are part of an Information Systems project team. Your job is to ensure that the technology and vendor suggested for use in t
    12·1 answer
  • Differences between formula and function as used in spreadsheet​
    13·1 answer
  • Match each type of video camera to its features:
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!