function start() { turnLeft(); move4(); turnRight(); move2(); takeBall(); move(); turnRight(); move4(); turnLeft(); move3(); gP(); move3(); move3(); gP(); putBall(); } //allow move karel 4 times function move4(){ move(); move(); move(); move(); } function move2(){ move(); move(); } function gP(){ turnLeft(); turnLeft(); } function move3(){
Quizzma Latest Questions
turnLeft(); makeSide(); function turnRight(){ turnLeft(); turnLeft(); turnLeft(); } turnRight(); makeSide(); function makeSide(){ move(); putBall(); move(); putBall(); move(); putBall(); } goHome(); function goHome(){ turnRight(); move(); putBall(); move(); putBall(); move(); putBall(); turnLeft(); turnLeft(); turnLeft(); move(); move(); move(); turnLeft(); turnLeft(); }
How many times should the start function be defined in a program?
Which function will teach Karel how to spin in a circle one time? function spin() { turnRight(); } function spin() { turnLeft(); turnLeft(); turnLeft(); turnLeft(); } function spin() { turnLeft(); turnLeft(); } function spin() { move(); move(); move(); move(); }
What can be used to teach Karel to turn right?
How many times should Karel turn left in order to turn right? 3
If Karel is facing North and the code turnLeft(); turnLeft(); runs; which direction is Karel facing now?
If Karel starts at Street 1 and Avenue 3 facing East, what street (row) and avenue (column) will Karel be on after this code runs? move(); move(); move(); turnLeft(); move();
What is an avenue in a Karel world?
Which is a valid Karel command? move; MOVE move(); move()
On operation that is OKAY and not reckless is Operating A PWC In The Rain
Apply Math Models You walk along the outside of a park starting at point P to point Q. Then you take a shortcut back to point P, represented by PQ on the graph. a. What is the length of the ...
According to a survey by the park ranger, there is a 75% chance that hikers will see a deer on a park trail. Which simulation could you use to answer questions about whether a hiker will see a deer? Flipping
Analysts determined that a baseball team had a 25% chance of winning its next game. Which simulation could you use to answer questions about winning the game? Flipping Heads Spinning Lands on 1 or 2 Rolling 2 ...
What is displayed as a result of executing the code segment? A 10 20 30 40 B 21 30 40 50 C 21 40 30 40 D 21 40 30 50
What is displayed as a result of executing the code segment? A 10 20 30 40 B 21 30 40 50 C 21 40 30 40 D 21 40 30 50
Which of the following initial values of the variable y would result in the variable z being set to 2 after the code segment is executed? A 1 B 2 C 3 D 4
Which of the following code segments can be used to update the values of the variables as shown in the table? A temp ← word1 word3 ← word1 word1 ← temp B temp ← word1 word1 ← word3 word3 ← ...
Which of the following code segments can be used to update the values of the variables as shown in the table? A temp ← word1 word3 ← word1 word1 ← temp B temp ← word1 word1 ← word3 word3 ...
Which of the following code segments can be used to interchange the values of the variables num1 and num2? A num1 ↔ num2 num2 ↔ num1 B temp ↔ num1 num1 ↔ temp num2 ↔ num1 C temp ...
Which of the following code segments can be used to interchange the values of the variables num1 and num2? A num1 ⇔ num2 num2 ⇔ num1 B temp ⇔ num1 num1 ⇔ temp num2 ⇔ num1 C temp ...
Step 5: Generate a new random integer from 1 to 29. Step 6: Select the student who is currently assigned integer n and display the student’s name. A) Step 1 B) Step 3 C) Step 4 D) Step 6
A teacher has a goal of displaying the names of 2 students selected at random from a group of 30 students in a classroom. Any possible pair of students should be equally likely to be selected. Which of the following ...
4.2.4 Dartboard A variable to control the radius of each circle and a mathematical expression to increase the radius on each iteration. a) Complete the `for` loop to draw the circles. b) Only draw circles with a radius greater than 50. c) Modify the ...
Help your friend write their bibliography! Write the function called citation that takes a tuple like this as input: (“Martin”, “Luther”, “King, Jr.”) and returns a name with the format: Last, First Middle. In this example, the output should be: ...
What is printed by the following program? def product(x, y): return x * y def difference(x, y): return x – y x = 2 y = 5 value1 = product(x, y) value2 = difference(y, x) result ...
“It’s a bird! It’s a plane! No, it’s Superman!” We want to write a function is_superman that takes in two parameters is_bird and is_plane and returns True if it is in fact Superman, and False otherwise. If it’s not a ...
How many parameters go into the function sum, and how many return values come out of the function sum? 3 parameters go in, 1 return value comes out 3 parameters go in, 3 return values come out 1 parameter goes ...
What is printed by the following program? def print_numbers(two, one, zero): print(two) print(one) print(zero) zero = 0 one = 1 two = 2 print_numbers(zero, one, two) 0 1 2 0 1 2 zero one two two one zero
What is the output of the following program? def sum_to(num): sum = 0 for i in range(num+1): sum += i print(sum) x = 5 sum_to(x) print(x) 5 15 15 5 5 15
What is the parameter of the function? print_three_times def print word
Why do we write functions? I. Make our code easier to understand by giving a readable name to a group of instructions II. Avoid writing repeated code III. Make our code reusable II and III I only I and ...
The box plots shown represent two data sets. Use the box plots to compare the data sets. Drag each value to show if it is the same for both data sets, different for each data set, or if there is not ...
Write a program that prints out the numbers in the Fibonacci sequence up until the max number. You can figure out the next number in the Fibonacci sequence by adding the two previous numbers. The first number is 1 and the ...
A student is creating a Web site that is intended to display information about a city based on a city name that a user enters in a text field. Which of the following are likely to be challenges associated with ...
Upon compiling the data, the researcher identifies a problem due to the fact that neither data source uses a unique ID number for each student. Which of the following best describes the problem caused by the lack of unique ID ...
A team of researchers wants to create a program to analyze the amount of pollution reported in roughly 3,000 counties across the United States. The program is intended to combine county data sets and then process the data. Which of ...
Which of the following explains how the two databases can be used to develop the interactive exhibit? A. Only the first database is needed. It can be searched by animal name to find all the information to be displayed. B. ...
A student wants to count the number of shows that meet both of the following criteria. Is a talk show Is on Saturday or Sunday For a given row in the spreadsheet, suppose genre contains the genre as a string ...
If added to the program below, which of the following additional functions would not cause an error? def subtract_nums(): z = x – y print z def subtract_nums(): z = z – x print z def subtract_nums(): y ...
x = 10 def add_nums(): y = 2 z = x + y print z Function namespace Global namespace Object namespace Class namespace