COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
All programs must end with a ‘Stop’ command.
A
TRUE
B
FALSE
C
Either A or B
D
None of the above
Explanation: 

Detailed explanation-1: -All programs must end with a ‘Stop’ command.

Detailed explanation-2: -The Wait-command can make the robot program wait for a given time, before proceeding. It can also be used to wait for a an input to have a defined state, before moving on. Go to the “Program"-tab (1) in the Program Robot section.

Detailed explanation-3: -The most basic kind of statement in ROBOTC simply gives a command to the robot. 3. The motor[port3] = 127; statement in the sample program you downloaded is a simple statement that gives a command. 4. It instructs the motor plugged into Motor Port 3 to turn on at full power.

Detailed explanation-4: -ROBOTC (conditions) are always Boolean statements. They are always either true or false at any given moment. Try asking yourself the same question the robot does – for example, whether the value of the Ultrasonic Sensor is greater than 45 or not. Pick any number you want for the Ultrasonic Sensor value.

There is 1 question to complete.