subject

IN JAVAWrite 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 790Note: These activities may test code with different test values. This activity will perform two tests, the first with a 5-element array (int runTimes[5]), the second with a 4-element array (int runTimes[4]). See How to Use zyBooks. Also note: If the submitted code tries to access an invalid array element, such as runTime[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. import java. util. Scanner;public class PrintRunTimes { public static void main (String [] args) { int[] runTimes = new int[5]; // Populate array runTimes[0] = 800; runTimes[1] = 775; runTimes[2] = 790; runTimes[3] = 805; runTimes[4] = 808; /* Your solution goes here */ return; }}2. Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10}, print:7 9 11 10 10 11 9 7 Hint: Use two for loops. Second loop starts with i = NUM_VALS - 1.Note: These activities may test code with different test values. This activity will perform two tests, the first with a 4-element array (int courseGrades[4]), the second with a 2-element array (int courseGrades[2]). See How to Use zyBooks. Also note: If the submitted code tries to access an invalid array element, such as courseGrades[9] for a 4-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. import java. util. Scanner;public class CourseGradePrinter { public static void main (String [] args) { final int NUM_VALS = 4; int[] courseGrades = new int[NUM_VALS]; int i = 0; courseGrades[0] = 7; courseGrades[1] = 9; courseGrades[2] = 11; courseGrades[3] = 10; /* Your solution goes here */ return; }}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:10
3. (5 points) describe what would be printed by the code below or what error would occur. const char* cstr = "0123456"; const char* ptr = & cstr[4]; cout < < ptr[-1] < < ptr < < endl; 1 4. (5 points) theseus has been trapped in a maze with a minotaur, which is trying to capture him. each round, theseus and the minotaur move through the maze; theseus towards the exit, and the minotaur towards theseus. theseus can move in any of the four cardinal directions, or he can wait for a round to see how the minotaur moves. write code that creates a data type to represent the possible moves that theseus could make.
Answers: 3
question
Computers and Technology, 22.06.2019 07:30
Events and conditions that happen within an organization that are somewhat easier to deal with when responding to change are called
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Which of the following physical laws can make the flow of water seem more realistic? a. motion b. gravity c. fluid dynamics d. thermodynamics
Answers: 2
question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
You know the right answer?
IN JAVAWrite three statements to print the first three elements of array runTimes. Follow each state...
Questions
question
Mathematics, 05.12.2021 22:00
question
Computers and Technology, 05.12.2021 22:00
question
Mathematics, 05.12.2021 22:00
question
Social Studies, 05.12.2021 22:00
question
World Languages, 05.12.2021 22:00
question
Computers and Technology, 05.12.2021 22:00
question
Mathematics, 05.12.2021 22:00
question
Computers and Technology, 05.12.2021 22:00
question
Mathematics, 05.12.2021 22:00
question
Mathematics, 05.12.2021 22:00
question
English, 05.12.2021 22:00
Questions on the website: 13722367