Question: Question 11 If an integer value is too big for the int data type, you should store it in the ____________ data type. 2 points

Question 11 If an integer value is too big for the int data type, you should store it in the ____________ data type. 2 points Question 12 Which of the following statements calculates the change in sales between two double variables named this YTDSales and lastYTDSales, rounds the result to an integer, and stores it in an integer in an int variable named salesChange? a. int salesChange = (int) thisYTDSales - (int) lastYTDSales; b. int salesChange = Math.round(thisYTDSales - lastYTDSales, 0); c. int salesChange = (int)(thisYTDSales - lastYTDSales); d. int salesChange = Math.round(thisYTDSales - lastYTDSales); 2 points Question 13 If the int variables a = 5, b = 2, and c = 10, what is the value of c after the following statement is executed? c = c + a * b 5; a. -45 b. 15 c. 25 d. None of the above 2 points Question 14 If the variable named input is 755, what is the value of r after these statements are executed? NumberFormat n = NumberFormat.getNumberInstance(); n.setMinimumFractionDigits(3); String r = n.format(input); a. 755 b. 755.000 c. 760.000 d. .755 2 points Question 15 What is the value of maxNumber after the code that follows is executed? int number = 0; int maxNumber = 0; for (int i = 0; i <= 10; i++) { number = (int)(Math.random() * 100); if (number >= maxNumber) { maxNumber = number; } } a. the largest of ten random numbers from 100 to 1000 b. the largest of ten random numbers from 0 to 99 c. the largest of eleven random numbers from 100 to 1000 d. the largest of eleven random numbers from 0 to 99 2 points Question 16 How many lines are printed on the console when the following for loop is executed? for (int i = 2; i < 10; i++) { System.out.println(i); } a. 7 b. 9 c. 8 d. 10 2 points Question 17 Code example 4-1 int limit = 0; for (int i = 10; i >= limit; i -= 2) { for (int j = i; j <= 1; j++) { System.out.println("In inner for loop"); } System.out.println("In outer for loop"); } (Refer to code example 4-1.) How many times does In outer for loop print to the console? a. 11 b. 8 c. 10 d. 6 2 points Question 18 What is the value of x after the following statements are executed? int x = 5; switch(x) { case 5: x += 2; case 6: x++; break; default: x *= 2; break; } a. 7 b. 10 c. 8 d. 6 e. 16 2 points Question 19 The practice of coding a statement within another statement is called ____________. 2 points Question 20 Output example 5-1 Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:818) at java.util.Scanner.next(Scanner.java:1420) at java.util.Scanner.nextDouble(Scanner.java:2324) at FutureValueApp.main(FutureValueApp.java:17) (Refer to output example 5-1.) What is this output called? a. a method log b. an exception handler c. an exception hierarchy d. a stack trace

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!