Answered step by step
Verified Expert Solution
Question
1 Approved Answer
answers please QUESTION 31 Complete the code to print out -1 -2-3-4-5: int i = 0; ) { System.out.printl +); i } QUESTION 32 Which
answers please
QUESTION 31 Complete the code to print out -1 -2-3-4-5: int i = 0; ) { System.out.printl +""); i } QUESTION 32 Which one complete the code to print out-1-2-3-4-5 int i = 10; while (i OR O i += 10; Oi -= 10; QUESTION 33 Trace the evaluation of the following expressions, and give their resulting values. Make sure to give a value of the appropriate type (such as including a .0 at the end of a double) 2 + 19 % 5 - (11 * (5 / 2)) O a. 18 O b. 17 O c. 32 O d.-16 QUESTION 34 Which of the following are legal int literals? O a. two b.6. O c.-11134 d. "342" O e. 2.45 QUESTION 35 Suppose you have an int variable called number with five digits, for example 12345. What Java expression produces the first digit of the number? a number / 10000 b. number % 10000 c. number / 1000 d. number - 9999 QUESTION 36 0.25 points Save Answer What are the values of a, b, and c after the following code statements? (It may help you to write down their values after each line.) int a = 2; int b = 4; int c = a; a = a + 1; b = b/3; C = C+a; 4 QUES What is the output of the following unknown method? public class Strange { public static final int MAX = 6; public static void unknown() { int number = 0; for (int count = MAX; count >= 1; count--) { number += (count * count); } System.out.println(number); } public static void main(String[] args) { unknown(); } } What are the values of a, b, and c after the following code statements? (It may help you to write down their values after each line.) int a = 1; int b = 9; int c = b; a = a + 1; b = b / a; C=C+b; O a. 1,9,9 QUESTION 39 0 Trace the evaluation of the following expressions, and give their resulting values. Make sure to give a value of the appropriate type (such as including a . at the end of a double). 177 % 100 % 10 / 2 a. 4 6.7 Oc.3 d. 3.5 QUESTION 40 0.25 points Save Answer What are the values of a, b, and c after the following code statements? (It may help you to write down their values after each line.) int a = 1; int b = 10; int c = b/3; a= a % 2; b = b + 1; C = C+aStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started