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]
2 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:
pochemuha2 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]2 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
At what stage of development is an engineering team the most productive?
Alexxx [7]

Answer:

A

Explanation:

A because you are continuing to keep moving and thinking.

3 0
2 years ago
Read 2 more answers
Water flows through a pipe at an average temperature of T[infinity] = 70°C. The inner and outer radii of the pipe are r1 = 6 cm
Paul [167]

Answer:

The differential equation and the boundary conditions are;

A) -kdT(r1)/dr = h[T∞ - T(r1)]

B) -kdT(r2)/dr = q'_s = 734.56 W/m²

Explanation:

We are given;

T∞ = 70°C.

Inner radii pipe; r1 = 6cm = 0.06 m

Outer radii of pipe;r2 = 6.5cm=0.065 m

Electrical heat power; Q'_s = 300 W

Since power is 300 W per metre length, then; L = 1 m

Now, to the heat flux at the surface of the wire is given by the formula;

q'_s = Q'_s/A

Where A is area = 2πrL

We'll use r2 = 0.065 m

A = 2π(0.065) × 1 = 0.13π

Thus;

q'_s = 300/0.13π

q'_s = 734.56 W/m²

The differential equation and the boundary conditions are;

A) -kdT(r1)/dr = h[T∞ - T(r1)]

B) -kdT(r2)/dr = q'_s = 734.56 W/m²

6 0
2 years ago
Which is the better measure of computer system performance—a benchmark, such as SPECINT; or a processor speed measure, such as G
Vesna [10]

Answer:

A benchmark

Explanation:

Most times a benchmark serves as the better measure when assessing a computer's performance, this is because CPU speeds can only evaluate an aspect of a computer's performance whereas a benchmark offers the advantage of measuring all the aspects of a computer's performance for a specific type of computing problem.

5 0
3 years ago
The process _______ boosted the production of fertilizers and strengthened the agriculture industry.
ANTONII [103]

Answer:

Process of Green Revolution

Explanation:

Green Revolution is a process which started its initiatives between the 1950s and 1960s, a technological research process, that increase agricultural productions through various systematic approach, which are different from the traditional methods. These technological approach includes:

1.  Utilization of new varieties with a high yield potential, in addition with adequate water  supply, pesticides and fertilizers.

2.  New methods of cultivation and mechanization

Hence, the process of Green Revolution boosted production of fertilizers and strengthen the agriculture industry as a whole.

6 0
3 years ago
What is one thing a person should do to stay safe when exercising
elixir [45]
Staying hydrated at all times
7 0
3 years ago
Read 2 more answers
Other questions:
  • The assembly consists of two red brass C83400 copper alloy rods AB and CD of diameter 30 mm, a stainless 304 steel alloy rod EF
    11·1 answer
  • Does a thicker core make an electromagnet stronger?
    13·1 answer
  • Psychologist who uses behavioral approach to therapy would probably try which of the following
    13·2 answers
  • A seawall with an opening is used to dampen the tidal influence in a coastal area (and limit erosion). The seawall is 2.5 m long
    11·1 answer
  • A Coca Cola can with diameter 62 mm and wall thickness 300 um has an internal pressure of 100 kPa. Calculate the principal stres
    9·1 answer
  • Amplifiers are extensively used in the baseband portion of a radio receiver system to condition the baseband signal to produce a
    5·1 answer
  • A steam power plant operating on a simple ideal Rankine cycle maintains the boiler at 6000 kPa, the turbine inlet at 600 °C, and
    11·1 answer
  • The rainfall rate in a certain city is 20 inches per year over an infiltration area that covers 33000 acres. Twenty percent of t
    6·1 answer
  • An ideal reheat Rankine cycle with water as the working fluid operates the boiler at 15,000 kPa, the reheater at 2000 kPa, and t
    13·1 answer
  • Hello it's my new id<br>I am numu ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!