Search Header Logo

JavaScript Basics & Graphics Test

Authored by Tina Mickens

Computers

9th - 12th Grade

Used 14+ times

JavaScript Basics & Graphics Test
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following commands is a valid Karel command?

  1. move

  1. move;

  1. move();

  1. move()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the horizontal pathways called in a Karel world?

  1. rows

  1. points

  1. columns

  1. Karel’s position

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the vertical pathways called in a Karel world?

rows

columns

points

Karel's position

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If Karel starts facing East in the first row, third column, what row and column will Karel be on after this code runs?

move();

move();

move();

turnLeft();

move();


  1. Row 1 and Column 3

  1. Row 4 and Column 4

  1. Row 2 and Column 6

  1. Row 6 and Column 2

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of using a for loop in code?

  1. To do something if a condition is true

  1. To make programs run faster

  1. To repeat something a fixed number of times

  1. To do something while a condition is true

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the following code, what would be a good Postcondition to write?

/* Precondition: Karel is on a spot with a tennis ball facing East

Postcondition: ... /

function getOnTop() {

turnLeft();

move();

turnRight();

}

  1. Karel is on a spot with a tennis ball facing north

  1. Karel is facing East.

  1. Karel ends one spot above a tennis ball facing East.

  1. Karel is on the same position but on top of a ball.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can we improve the following program?

function main() {

move();

move();

move();

move();

move();

move();

move();

}

main();


  1. Break down this program into more functions

  1. Use a for loop to repeat the move command

  1. Fix the indentation of this program

  1. Use a while loop to repeat the move command

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?