NEW
Font size
WorksheetsROBOT C PART2
Total questions: 13
Worksheet time: 14mins
You can tell by the color of text in ROBOTC what the text does. Comments in ROBOTC are what color of text?
green
blue
red
black
What does a "Pragma" statement do?
Describes in words what the program should do
Assign sensor and motor ports
Starts multiple-line comments
They don't do anything
What is a function used for in ROBOTC?
used to declare variables
used to group several lines of code together
used to turn a motor on or off
used to group conditions together
Based on the variable provided below, what does the "int" represent or stand for?
int speed;
speed = 0;
the name of the variable
internalize
the type of data
sets the speed to Fast
The ROBOTC symbol "&&" means?
and
or
either or
also
Based on the code given below, what will you observe when the code runs?
task main()
{ While (1==1)
{ startMotor(leftMotor,127);
wait(5);
stopMotor(leftMotor); }
}
The motor runs for 5 seconds and stops
The motor doesn't run
The motor will keep running until I do something to stop it or the battery runs out
The motor will run for 5 milliseconds
This control structure allows for a section of code to be continuously repeated.
If
While
Else
Do
Based on the code given below, approximately how fast will the motor run?
untilBump(bumpSwitch);
startMotor(rightMotor, 67);
wait(5);
stopMotor(rightMotor);
full speed
three quarters speed
half speed
one quarter speed
Which of these notations is correct for the command to turn the motor on?
StartMotor
startmotor
Startmotor
startMotor
The first step in creating a variable is to?
declare it
initialize it
reference it
assign a value to it
In ROBOTC the following lines of code will tell the robot to perform what behavior
startMotor (rightMotor , -63);
wait (5.0);
stopMotor ( rightMotor );
start the right motor and run it for 5 milliseconds
start the right motor and run it full speed for 5.0 seconds
start the right motor and run it for 63 seconds, wait for 5.0 seconds
start the right motor and run it in reverse for 5 seconds
A flowchart is a schematic representation of an algorithm or a process.
True
False
All flowcharts have an "END."
True
False
