Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Which of the following statements about the 'block' statement are true. Select one: a. it groups a sequence of statements into a single statement b.

Which of the following statements about the 'block' statement are true. Select one: a. it groups a sequence of statements into a single statement b. it conditionally executes a sequence of statements c. it is used to prevent a sequence of statements from being executed d. it is used to contain a main statement Question 2 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text What output will the following code produce: int number; number = 1; while ( number < 6) { System.out.print(number); number += 1; } Select one: a. 12345 b. 01234 c. 123456 d. 13579 Question 3 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text What is the following java code structure known as: for (i=0; i<10; i++) { for (j=0; j<10; j++) { // do something } } Select one: a. Nested loop b. Double loop c. Exponential loop d. None of the above Question 4 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text Which statement is most valid regarding the following java code: while ( true ) { System.out.print("loop again"); } Select one: a. it is a infinite loop that will continue to loop forever (until the program is terminated) b. it is an iterative loop that ends when the conditional expression is false c. it is not valid java code d. none of the above Question 5 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text What will the following java code produce as output? int number; number = 1; while ( number < 6 ) { System.out.print(number); number = number + 1; } System.out.print("Done!"); Select one: a. 1 2 3 4 5 Done! b. 12345Done! c. 12345 d. 12345 Done! Question 6 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text What will be the value of "x" if stringFunction is called as follows: String x = stringFunction("mississippi"); static String stringFunction(String str) { String test; int i; test = ""; for (i = str.length() - 1; i >= 0; i--) { test = test + str.charAt(i); } return (test); } Select one: a. mississippi b. m i s s i s s i p p i c. ippississim d. null string Question 7 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text An "animation" consists of a sequence of images shown rapidly one after the other on the computer screen. Each image in the animation is called a "frame." Suppose that you have a subroutine static void showFrame(int frameNum) that displays one frame in an animation. That is, showFrame(1) displays the first frame, showFrame(2) displays the second frame, and so on. Suppose that there are a total of thirty different frames. How many frames will the following code display?: for (int play = 0; play < 10; play++) { for (int i = 1; i < =30; i++) showFrame(i); } Select one: a. 30 frames repeated 10 times b. 310 frames c. 10 frames d. 30 frames Question 8 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: A for loop can use a list structure such as an enum to iterate the for loop? Select one: True False Question 9 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: The break loop when encountered will cause processing to skip to the beginning of the loop? Select one: True False Question 10 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: The continue statement when used in a loop will cause the flow of process to skip to the end of the loop and begin another iteration of processing? Select one: True False Question 11 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: A for loop is used when the number of iterations through the loop in known in advance? Select one: True False Question 12 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: The while loop is used when a known, finite number of loop iterations is required. Select one: True False Question 13 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: The conditional expression in a while loop can be any expression that evaluates to a logical True or False? Select one: True False Question 14 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: The while loop repeats a set of code while the condition is false. Select one: True False Question 15 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: The do-while loop repeats a set of code at least once before the condition is tested. Select one: True False Question 16 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: The for loop continues while a condition is true, and ends when that condition becomes false. Select one: True False Question 17 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text True or False: Can a for statement loop indefinitely? Select one: True False

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions

Question

Discuss the states of accounting

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago