answer.
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]
2 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]2 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
Which of these is an advantage of using the Clipboard task pane? A. You are able to apply OLE easily. B. There are more paste op
NemiM [27]
Hi!

The Clipboard in Microsoft Word is great for having more than just one paste option via the paste command. 

Using the Clipboard, you can hold up to 24 items that are copied. This makes it efficient if you have a lot of data you would like to paste.

Hopefully, this helps! =)
4 0
2 years ago
Read 2 more answers
Object-oriented development could potentially reduce the time and cost of writing software because: Group of answer choices a) i
spayn [35]

Answer:

b) objects are resuable

Explanation:

In OOP there's code reuse where a method or any other body of code is defined once and called or reused severally.

3 0
2 years ago
What are the possible consequences if you fail to identify system requirements correctly and completely?
AlladinOne [14]
There are a few consequences for failing to identify system requirements. 

1. Strain on time and effort which can cost money for either a company or yourself (depending if you are an employer, employee, etc).

2. Additional costs for hardware. If you decide to upgrade your hardware on a later time. It will cost additional money for repairs and replacements to adjust.

3. It can cause dissatisfaction to a user if you are working as a technician (for example) which can leave a negative mark on your reputation/resume) 
4 0
2 years ago
A company has deployed four 48-port access layer switches to a switch block. For redundancy each access layer switch will connec
NISA [10]

Answer:

The answer is "176".

Explanation:

In the given question there is a total of 192 switch ports, which are available for the 48-port switches. And for four access points, 8 trunk links that are 2 per access layer switch will be required. In every connexion of the trunk include two significantly modified-ports on the circuits throughout the access layer. With trunk connexions to both the communication network controller switches, a total of 17 switcher ports is required, allowing 176 access points for end system connectors.

3 0
2 years ago
The basic components of cartridges and shotshells are similar. Shot pellets and a bullet are examples of which basic component?
Liono4ka [1.6K]
The answer is projectile. Handguns and rifles use a cartridge having a single projectile or bullet. Shotguns use a shot shell comprising either a single bullet or a big number of small projectiles (shot or pellets). Though, the basic components of cartridges and shot shells are alike.
5 0
2 years ago
Other questions:
  • Graphical elements that precede each item in a list are known as​ __________.
    8·1 answer
  • One reason for using social media is to develop social and professional contacts. True or false?
    9·2 answers
  • Suppose a digital camera has a storage capacity of 256mb. how many photographs could be stored in the camera if each consisted o
    8·1 answer
  • Mark’s friends told him about an automated program that sends unsolicited messages to multiple users. Which type of program were
    11·2 answers
  • Which of the following is technically not a programming language?
    12·2 answers
  • Assume that a kernel is launched with 1000 thread blocks each of which has 512 threads. If a variable is declared as a shared me
    6·1 answer
  • Describe the Say It, Cover It, Resay It method.
    14·2 answers
  • Define a method named roleOf that takes the name of an actor as an argument and returns that actor's role. If the actor is not i
    8·1 answer
  • In this problem, we want to compare the computational performance of symmetric and asymmetric algorithms. Assume a fast public-k
    11·1 answer
  • Why are passive readers most likely to have difficulty focusing on a text?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!