Programming Fundamentals Study Guide

Programming Fundamentals Study Guide

9th - 12th Grade

15 Qs

quiz-placeholder

Similar activities

4.6.4 Logic Gates

4.6.4 Logic Gates

10th Grade - Professional Development

15 Qs

Types of Computers

Types of Computers

10th Grade

20 Qs

My Sql

My Sql

12th Grade

10 Qs

UNIT 1.8 ELCE

UNIT 1.8 ELCE

10th Grade

14 Qs

แบบทดสอบบทที่ 1 เรื่อง ข้อมูลมีคุณค่า ม.5

แบบทดสอบบทที่ 1 เรื่อง ข้อมูลมีคุณค่า ม.5

10th Grade

20 Qs

Access - Lesson 14

Access - Lesson 14

9th - 12th Grade

10 Qs

ICT 10 : Introduction to Adobe Illustrator(CS5)

ICT 10 : Introduction to Adobe Illustrator(CS5)

10th Grade

10 Qs

Computer Science - X

Computer Science - X

8th - 10th Grade

20 Qs

Programming Fundamentals Study Guide

Programming Fundamentals Study Guide

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Robert Harris

Used 8+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can we improve the following program?


function start() {

move();

move();

move();

move();

move();

move();

move();

move();

move();

}

Break down this program into more functions

Use a for loop to repeat the move command

Use a while loop to repeat the move command

Fix the indentation of this program

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What makes the following command an invalid Karel command?


turnleft();

It should end in a colon rather than a semicolon

The 'l' should be a capital 'L'

It should start with a capital T

This command is correct

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the following code below from the Cleanup Karel example, what is the purpose of 'If Statement' #2?


// This program has Karel walk down the

// row and clean up all of the tennis balls

// on the way.

function start() {

while (frontIsClear()) {

// If statement #1

if (ballsPresent()) {

takeBall();

}

move();

}

// If statement #2

if (ballsPresent()) {

takeBall();

}

}

To move the last time

To pick up the ball that is in the last spot

To pick up the ball that is in the last spot, if there is one

To take the ball from all of the positions that have a ball on them

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

To do something if a condition is true

To do something while a condition is true

To repeat something a fixed number of times

To make programs run faster

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to define a turnRight function in Karel?

function turnRight() {

turnLeft();

turnLeft();

turnLeft();

}

function turnRight() {

turnRight();

turnRight();

turnRight();

}

function turnRight {

turnLeft();

turnLeft();

turnLeft();

}

turnRight function() {

turnLeft();

turnLeft();

turnLeft();

}

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why do we use functions in Karel programs?

Break down our program into smaller parts

Avoid repeating code

Make our program more readable

All of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What's wrong with this code?


function start() {

move();

go();

go();

}


function go() {

move();

move();

}


function go() {

move();

move();

}

The go function is called twice

The go function has a syntax error

The go function has been defined twice

go is nota command that Karel understands

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?