Question: QUESTION 2 Indicate the data type and value of the expression. If the value is a floating point, make sure you include the fractional part,

QUESTION 2 Indicate the data type and value of the expression. If the value is a floating point, make sure you include the fractional part, even if it is 0. For example, if the value is 2 and the expression is of a floating point type, write 2.0 as the value. 3.0 + 3L/2 Type: ; Value 10 points QUESTION 3 Indicate the data type and value of the expression. If the value is a floating point, make sure you include the fractional part, even if it is 0. For example, if the value is 2 and the expression is of a floating point type, write 2.0 as the value. 3 + 3/2.0 Type: ; Value: 10 points QUESTION 4 What is the output when the following code executes? int x = (int)4.90; System.out.printf("%d ", x); 10 points QUESTION 5 Study the following code: double x=3.88; int y = (int)x; After the code executes, the type of x is , the value of x is , the type of y is , the value of y is . 20 points QUESTION 6 What is the output when the following code executes? System.out.println( (double)7/4); 10 points QUESTION 7 What is the output when the following code executes? System.out.println( (double)(7/4) ); 10 points QUESTION 8 After the following code finishes executing, the value x = , the value of y = . int x=1, y=10; x=y; 10 points QUESTION 9 int a = 10; a /= 2; // The value of a after this line executes is ___. 10 points QUESTION 10 Let a=1, b=2, and c=3. Indicate true or false of each of the following expressions. Note, use true or false, not True or False (case sensitive). a>=b Answer: !(a>b) Answer: (a>b) || (a < c) Answer: (b>a) && (b<=c) Answer: 20 points QUESTION 11 When it executes, the following code will output ___ (answer is case sensitive) System.out.println( 3>5 ? "red" : "blue"); 10 points QUESTION 12 When it executes, the following code will output ___. (Answer is case sensitive). int x=10, y=5; System.out.println( x == 2*y ? "red" : "blue"); 10 points Click Save and Submit to save and submit. Click Save All Answers to save all answers.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!