COMPUTER NETWORKS AND COMMUNICATIONS
NETWORK SECURITY AND CYBERSECURITY
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
What makes the following command an invalid Karel command?turnleft();
|
It should end in a colon rather than a semicolon
|
|
The l should be a capital L
|
|
It should start with a capital T
|
|
This command is correct
|
Explanation:
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: -Karel Commands. Basic Karel J Robot Commands. move(); // moves 1 unit forward. turnLeft(); // turns to the left 90 degrees. pickBeeper(); // picks up 1 beeper and puts in bag.
Detailed explanation-3: -The Anatomy of a Right Turn Karel can “turn right” by turning left three times. Three lefts make a right!
Detailed explanation-4: -A command is an instruction for an action that Karel can do. Karel only knows four commands: move(); putBall(); takeBall(); turnLeft(); These are the only four words that Karel understands.
There is 1 question to complete.