Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Name: as Java minutes questions 3 pts. each) Programming Language time limits ca

ID: 3830433 • Letter: N

Question

Name: as Java minutes questions 3 pts. each) Programming Language time limits can hold multiple values under one name; array 9 statement for an an can used to hold the Write the holds the following therefore, be the field values named hours that a database record all values: 11, 22, 33, and 44. are of the same data type. Evaluate the following program segment, what will Write a statement for printing the second element value of the above declared amay be printed? 3, 2, 1, 0); int x 15, 4, i, xt01 0: i x length; itt) Write the declaration statement for a two dimensional array named sheet that a represents table with 20 nows and 10columns, knowing that aw klij: 1 System.out.println (j) the elements are Evaluate the following program segment, what will How many elements are there in the above be printed? declared array? 2, 1, 0); int x for x length; itt) Write an assignment statement to assign the value 99.99 to the last element of the above declared xtil: system out -printin Evaluate the following program segment, what will be printed? Suppose we have an array as declared below, write the necessary code (eg, afor-loop) to assign the int x 10, 1, 2, 3, 4, integer values from 1 to 100 to the array elements. 5ha int a new int [100]i for (i length/2 System out.print (xlini Consider the array above, write the necessary code 13 leg, for- loop to print all the array element Evaluate the program segment, what will following values backward (ie from the last array element value backward to the first.) int 0 x 15 01 int i, j for (i 0: i x-length-1: it 21 Consider the following program segment: int x new int [101 [5]; system out.print (xlil) int i, ja for (i 0; i 10: it 14. Suppose we have a character array What will it 1) 10 j+1) be the value of element xi11[1]? char carray 'c', 'o', 'B', 'A' What will be the result of the statement bel ow? (carray)

Explanation / Answer

1)

int hours[]={11,22,33,44};//declaration, instantiation and initialization fo an array that contains 4 elements indexing 0 to 3.

2)

System.out.println(hours[1]); // it will print 2nd element value as the first element is at 0th index and second element is at 1st index.

3)

float[][] sheet=new int[20][10];//20 row and 10 column of s 2 diamensional array. and float keyword defines array is of float data-type.

4)

Total elements presents are 20*10 elements ie,200 elements are present in the above declared array.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote