(SOLVED)Question Answered step-by-step Question 1(Multiple Choice Worth 2 points) What is the result of 67...
Question Answered step-by-step Question 1(Multiple Choice Worth 2 points) What is the result of 67... Question 1(Multiple Choice Worth 2 points) What is the result of 67 % 10? 0.7 6 6.0 7 10 Question 2(Multiple Choice Worth 2 points) What is the value of num when the code below executes? String msg = "Java a great part of my day!"; int num = Of("Great"); −1 0 5 6 7 Question 3(Multiple Choice Worth 2 points) Consider the code block below. What is the value of amount when this method is called twice, the first time using cookieJar(7) and then using cookieJar(22)? public static int cookieJar(int addCookies) { int amount = 0; amount += addCookies; return amount; } 7 15 22 29 An error occurs Question 4(Multiple Choice Worth 2 points) Consider the block of code below. String greet1 = "Good Morning!"; String greet2 = "Good Afternoon!"; int result; if (reTo(greet2) 0) result = 1; else if (reTo(greet2) 0) result = −1; else result = 0; What is the value of result after it runs? −1 0 1 2 An error occurs Question 5(Multiple Choice Worth 2 points) Consider the code below. Which of the lines of code can replace the code block to result in 16 being printed for count? int count = 1; ** code block ** { count *= 2; } Sln(count); while (count == 8) while (count 8) while (count 8) while (count = 8) while (count =8) Question 6(Multiple Choice Worth 2 points) Consider the code block below. How many times is "Hello World" printed? for (int in = 4; in = 5; in++) { for (int out = 1; out = 4; out++) { Sln("Hello World"); } } 4 6 8 10 12 Question 7(Multiple Choice Worth 2 points) What is printed when the code below executes? String msg = "Today is a great day for programming!"; String newMsg = ring(Of('g')); Sln(newMsg); Today is a great day for programming! Today is a great great day for programming! great great day Question 8(Multiple Choice Worth 2 points) What is the result of double num = 10/4? 2 2.0 2.5 3 3.5 Question 9(Multiple Choice Worth 2 points) Given the code below. String line = "Programming is my favorite!"; What is the value of h()? 26 27 28 29 30 Question 10(Multiple Choice Worth 2 points) Consider the code block below. for (int x = 1; x 50; x++) { if (x % 4 == 0) Sln(x); } Which of the code blocks below will produce the same output? int x = 2; while (x 49) { if (x % 4 == 0) Sln(x); x++; } for (int x = 0; x 50; x++) { if (x % 4 == 0) Sln(x); } int x = 0; while (x 49) { if (x % 4 == 0) Sln(x); x++; } for (int x = 0; x = 50; x++) { if (x % 4 == 0) Sln(x);
Written for
- Institution
- Saint Leo University
- Course
- COM 209
Document information
- Uploaded on
- October 30, 2022
- Number of pages
- 10
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
consider the
-
question answered step by step question 1multiple choice worth 2 points what is the result of 67
-
what is the result of 67 10
-
what is the value of num when the code below executes