i need help with the second part question 1 through 8 the one that starts with t
ID: 3601187 • Letter: I
Question
i need help with the second part
question 1 through 8 the one that starts with the vairaible named
Starting Our with Java: From oufalls Control Struchres through Objects. 6 Short question o 2016 Pearson Eaucation 1) Write the commands to print out 2) Write the command to put 20 random test grades in 4) 3) Write a method to find the minimum 5) Write a method to put 20 random whole number betwe random test grades from 0 to 100 an array called grades rite a method using a sequential search to determine n 18 and 37 in to an 4 rows and 5 columns array with 6) Write a method to print out a two dimensional array 7) Write a method to read in the values of a two dimen 8) Write a method to add the columns of a two dimenswith 20 elements. whire 1. The variable names references an integer array prints each element of the array 2. The variables numberArrayl numberArray elements. Write code that copies the values in a. Write a statement that declares a string array rayi and nunberArray2 reference arrays that each have 100 lares a string array initialized with the following strin ? re numberArrayl to numberArray2. 3. gs: "Einstein", "Newton", "Copernicus", a b. Write a loop that contents of and "Kepler" lays the contents of each element in the array that you declared in Question 3(a) c. Write cod e that displays the total length of all the strings in the array that you declared in Question 3(a). In a program you need to store the a. Define two arrays that may be used in parallel to store the names of the countries 4. populations of 12 countries. and their populations. b. Write a loop that uses these arrays to print each country's name and its population. In a program you need to store the identification numbers of ten employees (as int values) and their weekly gross pay (as double values) a. Define two arrays that may be used in parallel to store the 10 employee identifica- S. tion numbers and gross pay amounts. b. Write a loop that uses these arrays to print each of the employees' identification number and weekly gross pay. Declare a two-dimensional int array named grades. It should have 30 rows and 6. 10 columns. Write code that calculates the average of all the elements in the grades array that you declared in Question 6 7. 8. Look at the following array declaration int [JI1 numberArray new int [91111 a. Write a statement that assigns 145 to the first column of the first row of this array. b. Write a statement that assigns 18 to the last column of the last row of this arra The values variable references a two-dimensional double array with 10 rows and 20 olumns. Write code that sums all the elements in the array and stores the sum in the variable total. An application uses a two-dimensional array declared as follows: int[Ili days new int [29115]; a. Write code that sums each row in the array and displays the results. b. Write code that sums each column in the array and displays the results. Write code that creates an ArrayList that can hold string objects. Add the names of three cars to the ArrayList, and then display the contents of the ArrayList. 9. 10. 11.Explanation / Answer
1- for(int i=0;i<20;i++)
{System.out.println(names[i]);}
2- for(int i=0;i<100;i++)
numArray2[i]=numArray1[i];
3-String[] array = {"Einstein", "Newton", "Copernicus","Kepler"};
4-
a-String countryName[]=new String[12];
int population[]=new int[12];
b-for(int i=0;i<12;i++)
{System.out.print("Population of country "+countryName[i]+ " is "+population[i]);
}
5-
a-int ID[]=new int[10];
double grossPay[]=new double[10];
b-for(int i=0;i<10;i++)
{System.out.print("Gross pay of Emplyee ID- "+ID[i]+ " is "+grossPay[i]);
}
6-int grades[][]=new int[30][10];
7-int sum=0;
double avg;
for(int i=0;i<30;i++)
{
for(int j=0;j<10;j++)
{
sum+=grades[i][j];
}}
avg=sum/300;
System.out.print("Average of all the ellements of the array is "+ avg);
8-
a-numberArray[0][0]=145;
b-numberArray[8][10]=18;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.