haileesavannah3915 haileesavannah3915
  • 06-04-2021
  • Computers and Technology
contestada

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

Respuesta :

Jamesanny20
Jamesanny20 Jamesanny20
  • 08-04-2021

Answer:

Answered below

Explanation:

//Program is written in Java.

public void first three elements(int[] nums){

int I;

//Check if array has up to three elements

if(nums.length > 3){

for(I = 0; I < nums.length; I++){

while (I < 3){

System.out.println(nums [I]);

}

}

else{

System.out.print("Array does not contain up to three elements");

}

}

}

Answer Link

Otras preguntas

The price of a computer component is decreasing at a rate of 13​% per year. State whether this decrease is linear or exponential. If the component costs ​$60 ​t
Find the area of the triangle with ∠A = 86, b = 4 ft, and c = 3 ft. Round your answer to two decimal places.
The ____________________ include liverworts hornworts and mosses. Select one: a. seed plants b. algae c. bryophytes d. tracheophytes
A sample of copper wire with a mass of 1.659 g is heated with excess powdered sulfur until
Explain how the Congress of Vienna achieved and maintained a balance of power.
How can a nation benefit from effectively exporting its goods??
Does anybody have any tips on how to remember what the story was about in the books u read for english? Thnx.
A ship is 1.4° off course. If the ship is traveling at 14.0 miles per hour, how far off course will it be after 2 hours?
There can be more than 1 answer
What was the general relationship between auto production and military aircraft production in the war years?