1.) for i in range (x) :
for j in range (y) :
t.forward (z)
t.right (360 / y)
t.right (360 / x)
wn.listen ()
wn.mainloop ()
Which of the following is an example of sequential-driven code?(1 point)
Responses:
1.) for i in range (x) :
for j in range (y) :
t.forward (z)
t.right (360 / y)
t.right (360 / x)
wn.listen ()
wn.mainloop ()
2.) Wn.onkey (picture, "p")
wn.listen ()
wn.mainloop ()
3.) def h1 () :
t.forward (30)
def h2 () :
t.left (45)
def h3 () :
t.right (45)
wn.onkey (h1, "Up")
wn.onkey (h2, "Left")
wn.onkey (h3, "(Right")
4.) wn.onclick (f)
wn.listen ()
wn.mainloop ()
9 answers
Event & Sequential-Driven Programming Quick Check 2 of 52 of 5 Items Question Which of the following is an example of event-driven code?(1 point)
Responses:
1.) for i in range(x): for j in range(y): t.forward(z) t.right(360 / y) t.right(360 / x)
2.) def h1(): t.forward(30) wn.onkey(h1, "Up" )
3.) t = turtle.Turtle() wn = turtle.Screen() wn.setColor("red" ) t.pd() t.speed(0)
4.) import turtle t = turtle.Turtle() wn = turtle.Screen() import turtle t = turtle.Turtle() wn = turtle.Screen()
Responses:
1.) for i in range(x): for j in range(y): t.forward(z) t.right(360 / y) t.right(360 / x)
2.) def h1(): t.forward(30) wn.onkey(h1, "Up" )
3.) t = turtle.Turtle() wn = turtle.Screen() wn.setColor("red" ) t.pd() t.speed(0)
4.) import turtle t = turtle.Turtle() wn = turtle.Screen() import turtle t = turtle.Turtle() wn = turtle.Screen()
2.) def h1(): t.forward(30) wn.onkey(h1, "Up" )
A group of students is writing a program that will convert their letter grades into a 4.0 scale. For their program, they want a letter grade to be entered to be converted into the program. Which programming construct should be used to accomplish the selection and conversion?(1 point)
Responses:
1.) condition
2.) if-then-else
3.) for loop
4.) while loop
Responses:
1.) condition
2.) if-then-else
3.) for loop
4.) while loop
2.) if-then-else
Students are developing a program to find the roots of a quadratic equation given the coefficients of the variables. What would be the first step in ideation?(1 point)
Responses:
1.) Test the program.
2.) Code the program.
3.) Determine the programming constructs needed.
4.) List the steps of an algorithm.
Responses:
1.) Test the program.
2.) Code the program.
3.) Determine the programming constructs needed.
4.) List the steps of an algorithm.
4.) List the steps of an algorithm.
A group of students wants to develop a calculator to reduce a fraction. The steps to do so are laid out in their math book as follows:
Express both the numerator (top number) and denominator (bottom number)
as a product of their prime factors.
Strike out any common factors.
Multiply the remaining numbers to obtain the reduced numerator and denominator. Which of the following elements would be appropriate to use in the algorithm?
Responses:
1.) two queues to pop out the prime factors for comparison
2.) a queue and a stack to pop out the prime factors for comparison
3.) two lists to hold the prime factors for comparison
4.) two stacks to pop out the prime factors for comparison
Express both the numerator (top number) and denominator (bottom number)
as a product of their prime factors.
Strike out any common factors.
Multiply the remaining numbers to obtain the reduced numerator and denominator. Which of the following elements would be appropriate to use in the algorithm?
Responses:
1.) two queues to pop out the prime factors for comparison
2.) a queue and a stack to pop out the prime factors for comparison
3.) two lists to hold the prime factors for comparison
4.) two stacks to pop out the prime factors for comparison
3.) two lists to hold the prime factors for comparison