COMPUTER NETWORKS AND COMMUNICATIONS
NETWORK SECURITY AND CYBERSECURITY
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
1
|
|
5
|
|
6
|
|
There is an error in the code so it will not move at all.
|
Detailed explanation-1: -As it turns out, there is a way for Karel to make right turns. Karel can “turn right” by turning left three times. Three lefts make a right!
Detailed explanation-2: -Calling turnAround() move(); move(); move(); turnAround(); move(); move(); move(); That’s all it takes to use our function.
Detailed explanation-3: -Functions are used to teach Karel a word or command. Using functions allow us to break down our program into smaller pieces and make it easier to understand.
Detailed explanation-4: -move()-move one square forward, turn left()-turn 90 degrees to the left (counterclockwise), turn right()-turn 90 degrees to the right (clockwise), pick ball()-pick up a ball from the square you are located on, drop ball()-drop a ball on the square you are located on.