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
qaws [65]
3 years ago
12

Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime

= {800, 775, 790, 805, 808}, print: 800 775 790 Note: These activities will test the code with different test values. This activity will perform two tests, both with a 5-element array. See "How to Use zyBooks". Also note: If the submitted code tries to access an invalid array element, such as runTimes[9] for a 5-element array, the test may generate strange results. Or the test may crash and report "Program end never reached", in which case the system doesn't print the test case that caused the reported message.
Engineering
1 answer:
Assoli18 [71]3 years ago
6 0

Answer:

public class PrintRunTimes {

public static void main (String [] args) {

int[] runTimes = new int[5];

runTimes[0] = 800;

runTimes[1] = 775;

runTimes[2] = 790;

runTimes[3] = 805;

runTimes[4] = 808;

  for(int i=0;i<3;i++)

  {

  System.out.println(runTimes[i]);

  }  

}

}

You might be interested in
What form of joining uses heat to create coalescence of the materials?
Allushta [10]
The answer is Soldering
3 0
3 years ago
Choose the best data type for each of the following so that any reasonable value is accommodated but no memory storage is wasted
stiks02 [169]

Answer:

Explanation:

Part (a):

Statement : The number of siblings you have

Suitable Data type : Byte

Typical Value : From -128 and up to 127

Explanation: Byte data type is the most suitable since it can covers minimum and maximum number of siblings one can have.

Part (b):

Statement : Your final grade in this class

Suitable Data type : Char

Typical Value : 1 byte

Explanation: Grades is in the form of alphabetical letter which is either A, B, C, D, F or E which can be stored in character data type.

Part (c):

Statement : Population of Earth

Suitable Data type : Long

Maximum Value : 9223372036854775807

Explanation: Long Data takes up to 8 bytes and can store up to 9223372036854775807 which can cater for more than 36 billion. The population of earth is only around 7 billion currently making Long data type the most suitable data type to store earth population.

Part (d):

Statement : Population of US Country

Suitable Data type : Integer

Typical Value :2147483647

Explanation: Integer data type takes up to 4 bytes and can store up to  2147483647 making it suitable to store U.S population.

Part (e):

Statement : The number of passengers on bus

Suitable Data type : Byte

Typical Value :From -128 up to 127

Explanation: The typical maximum number of passengers of a bus are only around 72. Byte data type is the most suitable since it can cater the number up to 127.

Part (f):

Statement : Player's score in a Scrabble game

Suitable Data type : Short

Typical Value : 32767

Explanation: The maximum point can be scored in the Scrabble game is only 830 therefore the most suitable data type for this case is the short data type.

Part (g):

Statement : One team's score in a Major League Baseball game

Suitable Data type : Byte

Typical Value : From -128 up to 127

Explanation: The maximum point can be scored in the Base ball game is only 49 therefore the most suitable data type for this case is the Byte data type since it can cater up to 127.

Part (h):

Statement : The year an historical event occurred

Suitable Data type : Short

Maximum Value: 32767

Explanation: The historic event year can be any number from 1 to 2020 therefore the most suitable data type is the short data type.

Part (i):

Statement : The number of legs on an animal

Suitable Data type : Short

Maximum Value: 32767

Explanation: The most number of legs found are 750 legs therefore the most suitable data type is the short data type which can cater up to 32767.

Part (j):

Statement : The Price of an automobile

Suitable Data type : Float

Maximum Value: 340282350

Explanation: The most expensive car is around 15 million therefore the most suitable data type is the float data type which can cater up to 340 million.  

3 0
3 years ago
The efficiency of a steam power plant can beincreased by bleeding off some of the steam thatwould normally enter the turbine and
3241004551 [841]

Answer:

Explanation:

This is Answer....

5 0
2 years ago
What does polarity give you information about?
Brrunno [24]

Well, I do know that polarity affects the voltage.

6 0
3 years ago
Motor oil is responsible for
Lelechka [254]

Answer:

lubricating all moving parts in the engine

Explanation:

like the pistons, pushrods, and the crank

5 0
3 years ago
Other questions:
  • 3/194 The assembly of two 5‐kg spheres is rotating freely about the vertical axis at 40 rev/min with θ = 90°. If the force F whi
    9·1 answer
  • Why do we write proton ions first before electron ions? <br>​
    10·1 answer
  • (35 points) This is a legit question that I have for a device FOR my homework.
    12·1 answer
  • Can you carry 1 m3 of liquid water? Why or why not? (provide the weight to support your answer)
    7·1 answer
  • This just a question that I keep forgetting, are lightskin people black.??
    6·2 answers
  • Does an electronic clock use electrical energy?​
    10·2 answers
  • A jointed arm robot can rotate on the following 6 axes?
    8·1 answer
  • True or false for the 4 questions?
    8·1 answer
  • Airbags may deploy in the<br> of the passenger or<br> driver, or from the<br> of the vehicle.
    6·1 answer
  • How many and what type of<br> receptacles are connected to<br> this circuit?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!