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
What fraction of the worlds surface is estimated to be arable land?
zzz [600]

I believe the amount of arable land worldwide is 1/3 as a fraction.

6 0
3 years ago
4.68 Steam enters a turbine in a vapor power plant operating at steady state at 560°C, 80 bar, and exits as a saturated vapor at
garik1379 [7]

Answer:

please mark me as a brainleast

Explanation:

hahahahhahaahhahahahahahahahahahahahahahahahaahhhahhhahaahahhaahhhahahaah

3 0
3 years ago
15 POINTS! Help.
IRISSAK [1]

Answer: it would  overload

Explanation:

4 0
3 years ago
Read 2 more answers
Robomind academy code if hour
Anvisha [2.4K]
Erm what? ......;-;
7 0
3 years ago
A well insulated turbine operates at steady state. Steam enters the turbine at 4 MPa with a specific enthalpy of 3015.4 kJ/kg an
Anarel [89]

Answer:

power developed by the turbine = 6927.415 kW

Explanation:

given data

pressure = 4 MPa

specific enthalpy h1 = 3015.4 kJ/kg

velocity v1 = 10 m/s

pressure = 0.07 MPa

specific enthalpy h2 = 2431.7 kJ/kg

velocity v2 = 90 m/s

mass flow rate = 11.95 kg/s

solution

we apply here  thermodynamic equation that

energy equation that is

h1 + \frac{v1}{2}  + q = h2 + \frac{v2}{2}  + w

put here value with

turbine is insulated so q = 0

so here

3015.4 *1000 + \frac{10^2}{2}  =  2431.7 * 1000 + \frac{90^2}{2}  + w

solve we get

w = 579700 J/kg = 579.7 kJ/kg

and

W = mass flow rate × w

W = 11.95 × 579.7

W = 6927.415 kW

power developed by the turbine = 6927.415 kW

7 0
3 years ago
Other questions:
  • Which of the following is not true about Machine Learning?Machine Learning was inspired by the learning process of human beings.
    11·1 answer
  • A common way of measuring the thermal conductivity of a material is to sandwich an electric thermofoil heater between two identi
    9·1 answer
  • Two technicians are discussing solder wire repair. Technician A says that electrical tape can be used to cover the joint. Techni
    10·1 answer
  • A gas contained within a piston-cylinder undergoes the follow change in states: Process 1: Constant volume from p1 = 1 bar V1 =
    9·1 answer
  • Aerospace engineers who work for certain government agencies are often required to have security clearance. Explain two reasons
    9·1 answer
  • It has been estimated that 139.2x10^6 m^2 of rainforest is destroyed each day. assume that the initial area of tropical rainfore
    12·1 answer
  • Cryogenic liquid storage. Liquid oxygen is stored in a thin-walled spherical container, 96 cm in diameter, which is further encl
    10·1 answer
  • A motor vehicle has a mass of 1200kg and the road wheels have a radius of 360mm. The engine rotating parts have a moment of iner
    5·1 answer
  • Technician A states that a scan tool can read
    13·1 answer
  • Subject : SCIENCE
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!