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
myrzilka [38]
3 years ago
11

Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's

numbers on one line, each number followed by one space. (2 pts) (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)
Engineering
2 answers:
pochemuha3 years ago
8 0

Answer:

import java.util.Scanner;

  public class PeopleWeights {

    public static void main(String[] args) {

    Scanner reader = new Scanner(System.in);  

    double weightOne = reader.nextDouble();

    System.out.println("Enter 1st weight:");

    double weightTwo = reader.nextDouble();

    System.out.println("Enter 2nd weight :");

    double weightThree = reader.nextDouble();

    System.out.println("Enter 3rd weight :");

    double weightFour = reader.nextDouble();

    System.out.println("Enter 4th weight :");

    double weightFive = reader.nextDouble();

    System.out.println("Enter 5th weight :");

     double sum = weightOne + weightTwo + weightThree + weightFour + weightFive;

     double[] MyArr = new double[5];

     MyArr[0] = weightOne;

     MyArr[1] = weightTwo;

     MyArr[2] = weightThree;

     MyArr[3] = weightFour;

     MyArr[4] = weightFive;

     System.out.printf("You entered: " + "%.1f %.1f %.1f %.1f %.1f ", weightOne, weightTwo, weightThree, weightFour, weightFive);

     double average = sum / 5;

     System.out.println();

     System.out.println();

     System.out.println("Total weight: " + sum);

     System.out.println("Average weight: " + average);

     double max = MyArr[0];

     for (int counter = 1; counter < MyArr.length; counter++){

        if (MyArr[counter] > max){

           max = MyArr[counter];

        }

     }

     System.out.println("Max weight: " + max);

  }

import java.util.Scanner;

  public class PeopleWeights {

    public static void main(String[] args) {

    Scanner reader = new Scanner(System.in);  

    double weightOne = reader.nextDouble();

    System.out.println("Enter 1st weight:");

    double weightTwo = reader.nextDouble();

    System.out.println("Enter 2nd weight :");

    double weightThree = reader.nextDouble();

    System.out.println("Enter 3rd weight :");

    double weightFour = reader.nextDouble();

    System.out.println("Enter 4th weight :");

    double weightFive = reader.nextDouble();

    System.out.println("Enter 5th weight :");

     double sum = weightOne + weightTwo + weightThree + weightFour + weightFive;

     double[] MyArr = new double[5];

     MyArr[0] = weightOne;

     MyArr[1] = weightTwo;

     MyArr[2] = weightThree;

     MyArr[3] = weightFour;

     MyArr[4] = weightFive;

     System.out.printf("You entered: " + "%.1f %.1f %.1f %.1f %.1f ", weightOne, weightTwo, weightThree, weightFour, weightFive);

     double average = sum / 5;

     System.out.println();

     System.out.println();

     System.out.println("Total weight: " + sum);

     System.out.println("Average weight: " + average);

     double max = MyArr[0];

     for (int counter = 1; counter < MyArr.length; counter++){

        if (MyArr[counter] > max){

           max = MyArr[counter];

        }

     }

     System.out.println("Max weight: " + max);

  }

Morgarella [4.7K]3 years ago
5 0

Answer:

The source code file to this question has been attached to this response. Please download it and go through it. The file contains comments explaining significant sections of the code. Please go through the comments in the code.

Download java
You might be interested in
A gas tank is known to have a thickness of 0.5 inches and an internal pressure of 2.2 ksi. Assuming that the maximum allowable s
sergiy2304 [10]

Answer:

D_o=11.9inch

Explanation:

From the question we are told that:

Thickness T=0.5

Internal PressureP=2.2Ksi

Shear stress \sigma=12ksi

Elastic modulus \gamma= 35000

Generally the equation for shear stress is mathematically given by

 \sigma=\frac{P*r_1}{2*t}

Where

r_i=internal Radius

Therefore

 12=\frac{2.2*r_1}{2*0.5}

 r_i=5.45

Generally

 r_o=r_1+t

 r_o=5.45+0.5

 r_o=5.95

Generally the equation for outer diameter is mathematically given by

 D_o=2r_o

 D_o=11.9inch

Therefore

Assuming that the thin cylinder is subjected to integral Pressure

Outer Diameter is

 D_o=11.9inch

7 0
3 years ago
Calculate the areas under the stress-strain curve (toughness) for the materials shown in Fig. below, (a) plot them as a
defon

Answer:

Explanation:

Wow

5 0
3 years ago
A design team is working on creating a new locker organizer. They have
astraxan [27]
A. Present a Solution
8 0
3 years ago
g Two Standard 1/2" B18.8.2 dowel pins are to be installed in part B with an LN1 fit. The thickness of plate A is .750 +/- .005"
allochka39001 [22]

Answer:

nmuda mudaf A certain vehicle loses 3.5% of its value each year. If the vehicle has an initial value of $11,168, construct a model that represents the value of the vehicle after a certain number of years. Use your model to compute the value of the vehicle at the end of 6 years.

Explanation:

5 0
3 years ago
what is the transfer function of the loaded filter? express your answer in terms of the variables r , l , rl , and s .
NISA [10]

Loaded, H_{Loaded}(s) = \frac{RR_{L} }{R+R_{L} } /(\frac{RR_{L} }{R+R_{L} }+SL) = \frac{RR_{L}/L }{R+R_{L} } /(\frac{RR_{L} /L}{R+R_{L} }+S) is the loaded filter's transfer function.

A graded filter that, by virtue of its weight and permeability, stabilises the foot of an earth dam or other construction when it is installed at the base of that structure.

Air filters with depth loaded are made to achieve precisely that. They add particles gradually to create air passageways, reducing constriction. You may save time and money by using filters that last longer thanks to them. The bigger particles are caught at the filter's beginning, while the smaller particles are caught as it gets closer. This is intended to avoid rapid surface loading, hence facilitating more airflow. This enables longer-lasting filtration as well.

On the other hand, surface loading filters catch every particle that is on its surface. No matter how big or little the particles are, it doesn't care.

Learn more about Loaded here:

brainly.com/question/20039214

#SPJ4

3 0
1 year ago
Other questions:
  • (a) Determine the dose (in mg/kg-day) for a bioaccumulative chemical with BCF = 103 that is found in water at a concentration of
    11·1 answer
  • given the classes above, what output is produced by the following code? meg[] elements ={new Lois(), new Stewie(), new Meg(), ne
    15·1 answer
  • Water, in a 150 in^3 rigid tank, initially has a temperature of 70°F and an enthalpy of 723.5 Btu/lbm. Heat is added until the w
    13·1 answer
  • For the pipe-fl ow-reducing section of Fig. P3.54, D 1 5 8 cm, D 2 5 5 cm, and p 2 5 1 atm. All fl uids are at 20 8 C. If V 1 5
    10·1 answer
  • Global Courier Services will ship your package based on how much it weighs and how far you are sending the package. Packages abo
    14·1 answer
  • A parallel plate capacitor has a separation of 2x10 m and free space between the plates. A 10 V battery is connected across the
    9·1 answer
  • An eddy current separator is to separate aluminum product from an input streamshredded MSW. The feed rate to the separator is 2,
    7·1 answer
  • Describe what viscoelastic behavior means
    7·1 answer
  • Tech A says that LED brake lights illuminate faster than incandescent bulbs. Tech B says that LED brake lights have
    13·1 answer
  • A heating torch is usually referred to as what?<br><br> Stick<br> Flower<br> Rose-bud<br> Lighter
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!