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
3. What type of error is in the following sentence? "George W. Bush is the President of the United States of
lana66690 [7]

<u>Answer:</u>

<em>Punctuation</em>

<u>Explanation:</u>

The sentence started with <em>the double quotes and it should be closed appropriately.</em> All the single quotes and double quotes are paired punctuation and mostly they do not come alone.

Note that there is a <em>difference between a single quote and apostrophe</em> though same key is used from the keyboard for both. <em>The correct answer is  Punctuation.</em>

George W. Bush is the President of the United States of America”. There is one another error in the statement. At present Bush is not the President so the sentence can be <em>George W. Bush was the President of the United States of America.</em>

8 0
3 years ago
10.Find the first ICMP Echo Request message that was sent by your computer after you changed the Packet Size in pingplotter to b
Shalnov [3]

Answer:

The message was fragmented across more than one IP datagram

Explanation:

ICMP Echo Request query message is a request sent by a user to a destination system, which then sends an ICMP Echo Reply query message`as a reply.

After I changed the Packet Size in pingplotter to be 2000, the first ICMP Echo Request message that was sent by the computer was:

Flags: 0×01 more fragments.

The message was fragmented across more than one IP datagram

6 0
3 years ago
What are the different types of application architecture
ivann1987 [24]

Answer: There are many different types of application architectures, but the most prominent today, based on the relationships between the services are: monoliths and N-tier architecture, microservices, and event-driven architecture and service-oriented architecture.

Explanation: A layered or N-tier architecture is a traditional architecture often used to build on-premise and enterprise apps, and is frequently associated with legacy apps.

A monolith, another architecture type associated with legacy systems, is a single application stack that contains all functionality within that 1 application. This is tightly coupled, both in the interaction between the services and how they are developed and delivered.

Microservices are both an architecture and an approach to writing software. With microservices, apps are broken down into their smallest components, independent from each other. Each of these components, or processes, is a microservice.

With an event-driven system, the capture, communication, processing, and persistence of events are the core structure of the solution. This differs from a traditional request-driven model.

The service-oriented architecture (SOA) is a well-established style of software design, that is similar to the microservices architecture style.

3 0
3 years ago
Given two objects represented by the tuples (22, 1, 42, 10) and (20, 0, 36, 8):
Rudik [331]

Answer:

Given,

P = (22, 1, 42, 10)

Q = (20, 0, 36, 8)

a. Formula for Euclidean Distance :

distance = ((p1-q1)^2 + (p2-q2)^2 + ... + (pn-qn)^2)^(1/2)

Now,

distance = ( (22-20)^2 + (1-0)^2 + (42 - 36)^2 + (10-8)^2) ) ^(1/2)

=( (2)^2 + (1)^2 + (6)^2 + (2)^2 ) ) ^(1/2)

=(4+1+36+4)^(1/2)

=45^(1/2)

Distance = 6.7082

b.Manhattan distance :

d = |x1 - x2| + |y1 - y2|

d = |22- 20| + |1 - 0|

d = |2| + |1|

Explanation:

4 0
2 years ago
Which is the correct expansion of the term Internet? 
kirill115 [55]

Answer:

international network

Explanation:

8 0
4 years ago
Read 2 more answers
Other questions:
  • Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
    14·1 answer
  • Each of the walls of a room with square dimensions has been built with two pieces of sheetrock, a smaller one and a larger one.
    11·1 answer
  • When Web users enter the URL www.CIWcertified.com in their browser address bar, they can access the official CIW Web site at the
    6·2 answers
  • How to create a distribution list in outlook?
    7·1 answer
  • Microsoft windows malicious software removal tool fake or real
    8·1 answer
  • Refer to the exhibit. The PC is connected to the console port of the switch. All the other connections are made through FastEthe
    6·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • b. Write a complete program for the following situation related to setting the speed of a car to preset values before starting a
    5·1 answer
  • Fifteen years ago, everyone didn't have a cell phone. Anyone developing an app would not have found many users. Today, the exist
    12·1 answer
  • Which of the following protocols is used by an email client to retrieve messages from an email server, giving users the option t
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!