wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

RobotC SLT Pretest Quiz

Total questions: 50

Worksheet time: 28mins

Name
Class
Date
1.
1.  What punctuation mark signals the end of a simple statement?    
a)
:
b)
)
c)
!
d)
;
2.

Value of touch sensor when pressed

a)

0

b)

1

c)

63

d)

127

3.
The speed of motor is affected by battery power. 
a)
True
b)
False
4.
How do we make a program loop indefinitely? 
a)
if/else statements
b)
task main ()
c)
while (1==1)
d)
SensorValue ()
5.

What programming language does RobotC use?

a)

CC

b)

C++

c)

C#

d)

C

6.

What is the purpose of the line 'task main() followed by { }'?

a)

It's a comment used to define the main scope

b)

Sets up multitasking

c)

Sets up a program's main task only

d)

Sets up a program's main task and scope

7.

What is the purpose of the 'while(true)' statement?

a)

creates a finite loop to check for changes in your NXT components a number of times

b)

creates an infinite loop to check for mistakes in the program functions

c)

creates a finite loop to check for mistakes in the program functions

d)

creates an infinite loop to continually check for changes in your NXT components

8.
A program is
a)
A logical and step-by-step set of directions for the robot to follow
b)
A logical and step-by-step set of directions for the programmer to follow
c)
A set of directions, written in paragraph form, that even a robot can follow
d)
None of these
9.
The role of the robot is to carry out the plan by following the steps in the program.
a)
True
b)
False
10.
What is a programming language?
a)
Only ROBOTC
b)
A method for the robot to communicate with the programmer
c)
A program that allows the robot to think for itself
d)
A language that lets the programmer communicate a plan to the robot
11.
_______ are a convenient way to talk about what the robot is doing and what it must do to carry out the plan created by the programmer. 
a)
Operations
b)
Actions
c)
Behaviors
d)
Instructions
12.
Simple behaviors are made up of complex behaviors. 
a)
True
b)
False
13.
Which one of these representations of Task Main will work in ROBOTC?
a)
Task main ()
b)
task main ()
c)
Taskmain ()
d)
task main;
14.
What does it mean when a command appears in color when typed in ROBOTC?
a)
The command is typed incorrectly
b)
The command is not allowed in the command
c)
ROBOTC recognizes the command as an important keyword
d)
It is highlighted so the programmer should look at the word or name carefully 
15.
The purpose of 'whitespace' is:
a)
To allow the robot to understand the program better
b)
To make the program more readable to the programmer
c)
To speed the operation of the robot
d)
To slow the operation of the robot
16.
If there are no more statements to run in the program:
a)
The robot will stop
b)
The robot will continue its last statement until it can find another statement
c)
The robot will continue its last statement until it can find the Stop command
d)
The robot will go back to the beginning of the program and start all over
17.
If one of a paired punctuation such as parentheses is missing:
a)
The robot will assume that it is there and continue running
b)
The program will not compile and the programmer will see an error message
c)
The program will bypass that statement
d)
The program will delete the paired punctuation that is not missing
18.
A single line comment begins with:
a)
A single slash (/)
b)
Two slashes (//)
c)
A slash and asterisk (/*)
d)
An asterisk and a slask (*/)
19.

Which one is a correct code of motor?

a)

motor[motorC] = 25;

b)

motor[motorC] = 25

c)

motor[left] = 25;

d)

motor[left] = 25

20.
How do we control the timer in the RobotC ?
a)
sec(2000);
b)
wait1Msec(2000)
c)
wait(2000);
d)
wait1Msec(2000);
21.
How do we declare(present) a variable ?
a)
int  a;
b)
int  a
c)
int ;
d)
a ;
22.

Where do you start writing your code?

a)

1

b)

2

c)

3

d)

4

23.

How will behave the robot within these codes below?

motor[motorC] = 0;

motor[motorB] = 55;

a)

Move Forward

b)

Move Backward

c)

Turn Right

d)

Turn Left

24.

How will behave the robot within these codes below?

motor[motorC] = 100;

motor[motorB] = 0;

a)

Move Forward

b)

Move Backward

c)

Turn Right

d)

Turn Left

25.

How will behave the robot within these codes below?

motor[motorC] = 100;

motor[motorB] =100;

a)

Move Forward

b)

Move Backward

c)

Turn Right

d)

Turn Left

26.

A simple statement is:

a)

A statement that never uses words with more than two syllables

b)

A line of code, irrespective of spelling

c)

A line of code irrespective of punctuation

d)

A line of code including all the appropriate words, numbers, and punctuation.

27.

What does == mean?

a)

Is equal to

b)

is not equal to

c)

greater than

d)

less than

28.

What does != mean

a)

is equal to

b)

is not equal to

c)

greater than

d)

less than

29.

What does < mean

a)

is equal to

b)

is not equal to

c)

greater than

d)

less than

30.

What does <= mean

a)

Is equal to

b)

is not equal to

c)

is less than or equal to

d)

is greater than or equal to

31.

What does > mean?

a)

is equal to

b)

is not equal to

c)

is less than

d)

is greater than

32.

What does >= mean?

a)

Is equal to

b)

is not equal to

c)

is greater than or equal to

d)

is less than or equal to

33.

What does && mean?

a)

Is equal to

b)

Next

c)

OR

d)

And

34.

What does || mean?

a)

A Wall

b)

A Path

c)

And

d)

Or

35.

What does the following line of code do?


int speed;

a)

Nothing

b)

Sets the speed

c)

Assign the variable speed as an integer

d)

not allowed in Robotc

36.

Of the options available, to get the robot to move in a circle, you would:

a)

Use the MotorCirlce command

b)

Turn on only one motor

c)

Assure that the Wait1Msec command was at least 3000

d)

Make sure that the motor is connected to Port 1

37.

If you wanted your robot to move for 5 seconds you would use the _____ command

a)

wait1sec (5000);

b)

wait1sec (5);

c)

wait1msec (5);

d)

wait1msec (5000);

38.

When a piece of code runs unintentionally forever it is know as

a)

An infinite loop

b)

A long loop

c)

A broken loop

d)

A for loop

39.
What color are the comments in RobotC? 
a)
Red 
b)
White 
c)
Black 
d)
Green
40.

Assuming the Motors and Sensors Setup has been properly configured, which robot behaviors will this piece of code cause the robot to perform?

a)

Pivot Turn Left / Pivot Turn Right

b)

Forward / Reverse

c)

Swing Turn Left / Swing Turn Right

41.
How does a while() loop work? 
a)
A while loop runs the commands in between the parenthesis while simultaneously checking the condition to know when to stop. 
b)
A while loop checks the "condition" in the parenthesis. If the condition is true, the robot runs the commands in between the curly braces, then loops back to check the condition again. If the condition is false, the robot moves on in the program. 
c)
A while loop keeps the program running forever.
42.
The following program will loop forever. 
a)
True 
b)
False 
c)
Sometimes 
d)
Depending
43.

Value of touch sensor when not pressed

a)

0

b)

1

c)

63

d)

127

44.

Assuming the Motors and Sensors Setup has been properly configured, which robot behaviors will this piece of code cause the robot to perform?

a)

Pivot Turn Left / Pivot Turn Right

b)

Forward / Reverse

c)

Swing Turn Left / Swing Turn Right

45.

Assuming the Motors and Sensors Setup has been properly configured, which robot behaviors will this piece of code cause the robot to perform?

a)

Pivot Turn Left / Pivot Turn Right

b)

Forward until 2107 degrees on rotation sensor

c)

Swing Turn Left / Swing Turn Right

46.

True or False: If I change this program's power, I must also change its wait time?

a)

True

b)

False

47.

True or False: This program does not require a wait1Msec() command.

a)

True

b)

False

48.

Using a standard tire, how many degrees should be programmed for the robot to travel 100 cm?

a)

1300

b)

360

c)

2107

d)

2046

49.

Using a standard tire, how many degrees should be programmed for the robot to travel 18 cm?

a)

400

b)

368

c)

217

d)

246

50.

Using a standard tire, how many degrees should be programmed for the robot to travel 75 cm?

a)

1400

b)

3268

c)

1534

d)

2496