Warm Up FRF

Warm Up FRF

12th Grade

5 Qs

quiz-placeholder

Similar activities

APCSU1D5 Compound Assignments

APCSU1D5 Compound Assignments

12th Grade

10 Qs

G12_Week7

G12_Week7

12th Grade - University

10 Qs

Java Classes

Java Classes

11th - 12th Grade

2 Qs

Quiz 3 Review

Quiz 3 Review

KG - University

9 Qs

APCS Printing and objects

APCS Printing and objects

9th Grade - University

10 Qs

AP Warm UP 1

AP Warm UP 1

12th Grade

6 Qs

MK Java for-Loop Quiz 2

MK Java for-Loop Quiz 2

8th - 12th Grade

10 Qs

Sains Komputer (Java) 1: Sintaks Asas & Pembolehubah

Sains Komputer (Java) 1: Sintaks Asas & Pembolehubah

10th Grade - University

10 Qs

Warm Up FRF

Warm Up FRF

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Margaret DeRidder

Used 10+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Consider the following code segment.

System.out.println("W");

System.out.println("X");

System.out.print("Y");

System.out.print("Z");

What is printed as a result of executing the code segment?

WXYZ

W

XYZ

WX

YZ

W

X

YZ

W

X

Y

Z

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Consider the following code segment.

System.out.print("cat ");

System.out.println("dog ");

System.out.println("horse ");

System.out.print("cow ");

What is printed as a result of executing the code segment?

cat dog horse cow

cat dog

horse

cow

cat dog

horse cow

cat

dog

horse cow

cat

dog

horse

cow

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Consider the following code segment.

System.out.print("Hello!");

System.out.println("How ");

System.out.print("are ");

System.out.print("you?");

What is printed as a result of executing the code segment?

Hello!Howareyou?

Hello!How are you?

Hello!

How are you?

Hello!How

are you?

Hello!

How

are

you?

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Consider the following code segment.

System.out.println(hello); // Line 1

System.out.print(world); // Line 2

The code segment is intended to produce the following output but does not work as intended.

hello

world

Which of the following changes can be made so that the code segment produces the intended output?

Inserting System.out.print(); between lines 1 and 2

Inserting System.out.println(); between lines 1 and 2

Changing println in line 1 to print

Changing print in line 2 to println

Enclosing hello in line 1 and world in line 2 in quotation marks

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Consider the following code segment.

System.out.print("Ready"); // Line 1

System.out.print("Set"); // Line 2

System.out.print("Go!"); // Line 3

The code segment is intended to produce the following output but may not work as intended.

Ready

Set

Go!

Which change, if any, can be made so that the code segment produces the intended output?

Changing print to println in lines 1 and 2

Changing print to println in line 3

Interchanging lines 1 and 3

Replacing all three lines with the single statement System.out.println("Ready Set Go!");

No change is needed; the code segment works correctly as is.