wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ROBOT C PART2

Total questions: 13

Worksheet time: 14mins

Name
Class
Date
1.

You can tell by the color of text in ROBOTC what the text does. Comments in ROBOTC are what color of text?

a)

green

b)

blue

c)

red

d)

black

2.

What does a "Pragma" statement do?

a)

Describes in words what the program should do

b)

Assign sensor and motor ports

c)

Starts multiple-line comments

d)

They don't do anything

3.

What is a function used for in ROBOTC?

a)

used to declare variables

b)

used to group several lines of code together

c)

used to turn a motor on or off

d)

used to group conditions together

4.

Based on the variable provided below, what does the "int" represent or stand for?

int speed;

speed = 0;

a)

the name of the variable

b)

internalize

c)

the type of data

d)

sets the speed to Fast

5.

The ROBOTC symbol  "&&"  means?

a)

and

b)

or

c)

either or

d)

also

6.

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); }

}

a)

The motor runs for 5 seconds and stops

b)

The motor doesn't run

c)

The motor will keep running until I do something to stop it or the battery runs out

d)

The motor will run for 5 milliseconds

7.

This control structure allows for a section of code to be continuously repeated.

a)

If

b)

While

c)

Else

d)

Do

8.

Based on the code given below, approximately how fast will the motor run?

untilBump(bumpSwitch);

startMotor(rightMotor, 67);

wait(5);

stopMotor(rightMotor);

a)

full speed

b)

three quarters speed

c)

half speed

d)

one quarter speed

9.

Which of these notations is correct for the command to turn the motor on?

a)

StartMotor

b)

startmotor

c)

Startmotor

d)

startMotor

10.

The first step in creating a variable is to?

a)

declare it

b)

initialize it

c)

reference it

d)

assign a value to it

11.

In ROBOTC the following lines of code will tell the robot to perform what behavior

 

startMotor (rightMotor , -63);

wait (5.0);

stopMotor  ( rightMotor );

a)

start the right motor and run it for 5 milliseconds

b)

start the right motor and run it full speed for 5.0 seconds

c)

start the right motor and run it for 63 seconds, wait for 5.0 seconds

d)

start the right motor and run it in reverse for 5 seconds

12.

A flowchart is a schematic representation of an algorithm or a process.

a)

True

b)

False

13.

All flowcharts have an "END."

a)

True

b)

False