Control Structures
Debugging
Karel
Top Down Design
Coding Structure
100

What is the difference between a for loop and a while loop

A for loop repeats a fixed number of times

A while loop repeats as long as a condition is true

100

What is it called when you make a mistake in your program?

A bug

100

What are the four basic commands Karel knows?

move()

turn_left()

put_ball()

take_ball()

100

 Which statement best describes top-down design in programming?

A) Starting with small details and building up to the main problem

B) Starting with the main problem and breaking it down into smaller components

C) Writing code without any planning

D)Only focusing on the user interface

 

B) Starting with the main problem and breaking it down into smaller components

100

What can be used to help make your code more understandable to outside programmers

Comments


200

What control structures require conditions before Karel can do anything?

While loops and if statements

200

What error appears if Karel code starts to run before stopping suddenly?

Runtime Error

200

What is the difference between streets and avenues in Karel?

Streets ||

Avenue =

200

What is the programming principle that breaks down complex problems into smaller, manageable parts

Decomposition

200

When using top-down design, what should you do first? 

A) function myFunction():

B)def calculate_sum():

C) function calculate_sum():

D) def calculateSum():

B) def calculate_sum():

300

What control structure do you use if Karel needs to decide between two possible actions

If/Else statement

300

Instead of jumping a hurdle, Karel moves up the grid and crashes into a wall. What type of error is this and what is the first thing I check for small errors?

Logic error. 

Jump_hurdle function

300

What is the difference between SuperKarel and UltraKarel

Super Karel can turn_right or turn_around

UltraKarel can paint

300

When using top-down design, what should you do first?

Define the main problem

300

What type of code helps code reusability

Functions

400

What is the most important variable in a for loop?

"i" for iteration

400

What problem occurs when a loop ends but needs to repeat one more time to successfully complete the program?

Fencepost problem

400

What part of Code HS provides instructions on how to use its API?

DOCS tab

400

 In function decomposition, what is a sequence of programming instructions that perform a specific task

A procedure

400

In Python, what is the proper way to write a single-line comment?

#This is a comment 

OR

"

this is a comment

"

500

What 3 building blocks make up an algorithim?

Sequencing, Iteration and Selection

500

In a world of eight streets and avenues, Karel is in street 1, avenue 2 and is given the following code:

while front_is_clear():

//put_ball()

Where will Karel end up?

Creates an infinite loop so Karel crashes

500

What simplifies complex programming tasks by providing sets of clearly defined methods of communication among various computing components?

API (Application Programming Interface)

500

A team is designing a school scheduling system. They divide the project into the following parts:

  • Student Information
  • Course Management
  • Teacher Assignments
  • Schedule Generation

Which computational thinking practice is primarily being used?

Decomposition

500

What programming principle hides unnecessary details while showing important information?

Abstraction