Computers and Technology

Question: 1 The AP Exam does not use for loops and while loops, but rather REPEAT or REPEAT UNTIL commands as shown below.

REPEAT n TIMES
{

}

REPEAT UNTIL(condition)
{

}
The program below uses a robot in a 5x5 grid of squares. The robot is represented as a triangle, which is initially in the bottom-left square of the grid and facing toward the right of the grid.

After running which of the following code segments would the robot end up in the same place facing the same direction as after running the code segment below?

REPEAT 2 TIMES
{
MOVE_FORWARD ()
MOVE_FORWARD ()
ROTATE_LEFT ()
}

REPEAT 4 TIMES
{
MOVE_FORWARD ()
ROTATE_LEFT ()
}

REPEAT 2 TIMES
{
MOVE_FORWARD ()
MOVE_FORWARD ()
}

ROTATE_LEFT ()

REPEAT 2 TIMES
{
MOVE_FORWARD ()
MOVE_FORWARD ()
}

REPEAT 2 TIMES
{
ROTATE_LEFT ()
ROTATE_LEFT ()
}

REPEAT 2 TIMES
{
MOVE_FORWARD ()
}

ROTATE_LEFT ()

REPEAT 2 TIMES
{
MOVE_FORWARD ()
}
ROTATE_LEFT ()

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:30, 21megoplin
In which phase does software coding and testing happen in the spiral model? the spiral model does not have a separate testing phase. both, software coding and testing occurs during the phase.
Answers: 3
image
Computers and Technology, 23.06.2019 07:00, sugaree95
What are three software programs for mobile computing?
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, cdavis379
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a. if the manual switch s is on, then the light l is on. b. besides the manual switch, there is a motion detector, m1, which activatesthis light. c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d. the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, Auttyrain3929
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
Do you know the correct answer?
Question: 1 The AP Exam does not use for loops and while loops, but rather REPEAT or REPEAT UNTIL c...

Questions in other subjects: