Search Header Logo

Java Semester Test

Authored by Douglas Ray

Computers

11th Grade

Used 3+ times

Java Semester Test
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

35 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid condition to go in an if statement for Karel?

ballsPresent()

frontIsClear()

leftIsBlocked()

turnLeft()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Say Karel is on a location with one tennis ball. After the following code runs, how many tennis balls will there be at that location?

0

1

2

6

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What condition should be used in this while loop to get Karel to pick up all the tennis balls on the current location?

noBallsPresent()

ballsPresent()

frontIsClear()

takeBall()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why does a programmer indent their code?

Helps show the structure of the code.

Easier for other people to understand.

A key part of good programming style!

All of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Say you want to write a program to have Karel put down 300 tennis balls. Which control structure would you use?

If Statement

While Loop

For Loop

Nested While Loop

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following program: (Assume the user enters ‘Florence’ then ‘Fernandez’.)

Fernandez Florence

Fernandez

Florence

FlorenceFernandez

Florence Fernandez

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following choices is a properly formed JavaScript variable name, meaning it is both legal in the JavaScript language and considered good style?

user_age

UserAge

userAge

User age

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?