1) How many times will Karel move in this program? a) 4 b) 5 c) 3 d) 6 2) What is the proper way to create a single line comment in Karel? a) # This is a comment b) // This is a comment c) """ This is a comment d) /* This is a comment 3) What is wrong with this for loop? a) A b) B c) A and B d) The loop is correcly written 4) What does the un_decorate function do? a) Karel moves until it is on a ball, and picks it up. b) Karel moves once if there is no ball present. c) Karel moves until it takes a ball. d) Karel checks if there is no ball on the current spot and then moves once. 5) Which is not a valid condition to go in an if statement for Karel? a) balls_present( ) b) front_is_clear( ) c) left_is_blocked( ) d) turn_right( ) 6) Why does a programmer indent their code? a) Helps to show the structure of the code. b) Makes it easier for other people to understand. c) In Python, it is used to help determine what parts of code are included in a code block, such as an if statement or for loop. d) All of the above. 7) Say you want to write a program to thave Karel put down 250 tennis balls. Which control structure would you use? a) if statement b) while loop c) for loop d) nested while loop 8) What condition should be used in this while loop to get Karel to pick up all the tennis balls on the current location? a) no_balls_present( ) b) balls_present( ) c) front_is_clear( ) d) take_ball( ) 9) How can we teach Karel new commands? a) Define a function b) Call a function c) Create a function d) List a function 10) What is top down design? a) Top down design is a way of designing your program by starting with the biggest problem and breaking it down into smaller and smaller pieces that are easier to solve. b) Top down design is a way that you can create designs on a computer to put on a website. c) Top down design is a way of designing your programs starting with the individual commands first. d) Top down design is a way to use loops and if statemens to decompose a problem. 11) How can this program be improved? a) Use a while loop to repeat the move command. b) Use a for loop to repeat the move command. c) The program cannot be improved. d) Define a new function to make Karel move. 12) What is the purpose of using a for loop? a) To do something if a condition is true b) To do something while a condition is true c) To repeat something a set number of times d) To make programs run faster. 13) Which of the following commands is a valid Karel command? a) move b) move; c) move( ) d) move( ); 14) What makes this Karel command invalid? a) It should end in a semicolon b) The L should be lowercase c) It should start with a capital T d) There is nothing wrong with the command 15) Why do we use functions in Karel progams? a) To avoid repeating code. b) To make our programs more readable. c) To Break down our program into smaller parts. d) All of the above. 16) Which is the correct way to define a turn_right function in Karel? a) b) c) d) 17) What is a street in the Karel world? a) A row b) A column c) A single point d) Karel's position 18) What is an avenue in a Karel world? a) A row b) A column c) A single point d) Karel's position 19) Which function will teach Karel how to spin in a circle one time? a) b) c) d) 20) What is the best way for Karel to move five times?  a) b) c) d)

Leaderboard

Visual style

Options

Switch template

Continue editing: ?