WorksheetsProgramming in ROBOTC ROBOTC Rules: Fundamentals
Total questions: 10
Worksheet time: 5mins
Which statement best describes ROBOTC as used in VEX robots?
A hardware wiring configuration tool
A spreadsheet-like macro recorder
A visual drag-and-drop editor only
A text-based language compiled for robots
In ROBOTC, what is the effect of capitalizing a keyword incorrectly, such as writing "Task" instead of "task"?
The text turns red and auto-corrects
The program still runs but slows down
The robot ignores whitespace only
The command is not recognized by the compiler
Given the code:
motor[port3] = 127;
wait1Msec(3000);
what happens when it runs?
Program waits first, then runs the motor
Motor toggles power every 3 seconds
Motor on port 3 stops, then waits 3 s
Motor on port 3 runs full power, then waits 3 s
Why do programmers usually place each ROBOTC statement on its own line, even though whitespace is ignored by the machine?
To improve human readability of code
To reduce compile time significantly
To change how the robot interprets commands
To ensure semicolons are optional
Which symbol marks the end of a ROBOTC statement and lets the compiler separate commands?
A comma between parameters
A colon before the next statement
A period after closing brace
A semicolon at the end of the statement
Which paired punctuation surrounds parameters for commands like wait1Msec in ROBOTC?
Angle brackets < >
Curly braces { }
Parentheses ( )
Square brackets [ ]
In ROBOTC, what is the primary role of task main?
Store sensor values
Repeat statements automatically
Direct the program to the main code
Define new variables globally
A while loop in ROBOTC repeats code between its curly braces under what condition?
After task main finishes
Until a timer expires
As long as its condition remains true
Only once per program run
Which statement about comments in ROBOTC is accurate?
Robots execute single-line comments
Comments are ignored by the compiler
Multi-line comments use // on every line
Comments must be placed at the end
Given
motor[port3] = 127;
wait1Msec(3000);
inside task main, which modification best improves human readability without changing behavior?
Move code outside task main entirely
Remove all whitespace between tokens
Add a descriptive comment above
Replace parentheses with brackets
