Q1-) Suppose that a Java program contains the following declarations and stateme
ID: 3911154 • Letter: Q
Question
Q1-) Suppose that a Java program contains the following declarations and statements int j- 7, k -4, n 13; double q - 2.5,r 0.5 boolean b: int [1 arr- new int[7); b (k>j) arrlk] n; Give the value of each of the following expressions: 1) k/3 Answer: . 3) (double) n) /j Answer 5) j*r 7) j*((int) r) 9) Q2-) Choose one answer for each question. 2)arr[4] % j 4) (double)n /)) 6) (int)G r) 8) b 10)-j *k Answer: . Answer: Answer: Answer Answer: . A Answer:. Answer... Answer. ar.length ==j 1. The name of a class: (a) should be all upper-case (b) should start with an upper-case letter, but not be all upper-case 2. The name of a method: (a) should be all upper-case (b) should start with an upper-case letter, but not be all upper-case (c) should start with a lov (d) none of the above (c) should start with a lo (d) none of the above 3. The name of a variable: (c) should start with a l (a) should be all upper-case (b) should start with an upper-case letter, but not be all upper-case (d) none of the above 4. The name of a constant: (a) should be all upper-case (b) should start with an upper-case letter, but not be all upper-case (d) none of the above 5. The following is a valid comment:/* beginning of the method*(a) true 6. What should a complete Java program contain, for you to be able to run it: (c) should start with aExplanation / Answer
Q1:
Q2: choose correct answer:
Answer: option B
Should start with an upper case letter , but not be all upper case
Answer option C
Should start with a lower case but each word must begin with uppercase
Example: getInputValuesPositives()
Option D: none of the above
Option A: should be all upper case
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.