wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PLTW CIM-Lesson 1.2/Control Systems(Part 2: RobotC)

Total questions: 71

Worksheet time: 49mins

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

When is the while loop TRUE in the code shown?

a)

Never

b)

Always

c)

When hit bumpSwitch

d)

When hit limitSwitch

3.
What category in Natural Language would you find the commands for the LEDs and Flashlight?
a)
Movement
b)
Behaviors
c)
Special 
d)
Control Structures
4.
How many analog ports?
a)
6
b)
8
c)
10
d)
12
5.
How many digital ports?
a)
6
b)
8
c)
10
d)
12
6.

The Ultrasonic Range Finder (sonar) can measure in

a)

mm

b)

cm

c)

in

d)

all of these

7.
Value of bump switch when pressed
a)
0
b)
1
c)
63
d)
127
8.
The speed of motor is affected by battery power. 
a)
True
b)
False
9.
How do we make a program loop indefinitely? 
a)
if/else statements
b)
task main ()
c)
while (1==1)
d)
SensorValue ()
10.
What is half speed value when we start a motor?
a)
63
b)
127
c)
100
d)
50
11.

All of these are digital sensors except?

a)

bumpswitch

b)

light sensor

c)

shaft encoder

d)

ultrasonic range finder

12.

The value range associated with the limit switch is?

a)

-127 to 127

b)

0 to 127

c)

-1 to 1

d)

0 or 1

13.

An axle in your optical shaft encoder rotated exactly 1 revolution. How can you know this by looking at sensor data?

a)

it changed from 0 to 1

b)

it increased by 3.14 times

c)

it shows a change of 360

d)

it can't be known by looking at the data

14.

One of the first things you should do every day after opening the ROBOTC software is:

a)

check your Instagram

b)

snap your finger

c)

give a high five to your classmate

d)

update the firmware

15.

Comments in RobotC are what color text?

a)

Blue

b)

Green

c)

Orange

d)

Red

16.

This shape represents what in a flowchart?

a)

Decision

b)

Process

c)

Input/Output

d)

Start or Stop

17.

A motor can be reversed by_____________.

a)

Standing on my head and looking at the motor upside down

b)

changing the sign (+/-) of the speed in the program

c)

Check "Reverse" in Motors & Setup

d)

turn the motor with my LEFT hand instead of my right hand

18.

Which battery condition allows the fastest motor rotation?

a)

50% charged

b)

75% charged

c)

100% charged

d)

charged to my credit card

19.

Find the error in this RobotC code.


turnLEDOff(red);

turnLEDOff(yellow)

turnLEDOff(green);


turnLEDOn(red);

untilTouch(touchSensor);

turnLEDOff(red);

a)

Missing a parameter

b)

Missing a semicolon

c)

Reversed parameters

d)

Wrong notation for name of sensor/command

20.

What programming language does RobotC use?

a)

CC

b)

C++

c)

C#

d)

C

21.

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

22.

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

a)

creates a finite loop to check for changes in your VEX 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 VEX components

23.

Which is NOT an acceptable example of an infinite loop?

a)

while(true)

b)

while(1==1)

c)

while(not false)

d)

while(55==55)

24.

What do '#Pragma config()' statements do?

a)

Update the VEX Cortex firmware

b)

Downloads the code to your robot

c)

They configure settings which live in their own section of flash memory that is outside of your program code. They are available as soon as the microcontroller gets power, regardless where they are written in your code. This is important because sometimes they are needed before your program is executed.

d)

not sure

25.

A pragma config command for VEX robot motors contain either 5 or 6 arguments. Which is NOT a one of these arguments?

a)

port type

b)

button or channel

c)

component type

d)

component orientation

e)

component name

26.

What do these lines of code do?

a)

motors for ports 2 and 5 half power in reverse, motors for ports 3 and 4 half power, only while button 6-d is pressed

b)

motors for ports 3 and 4 full power in reverse, motors for ports 2 and 5 full power, only if button 6-d is pressed

c)

motors for ports 2 and 5 half power in reverse, motors for ports 3 and 4 half power, only if button 6-d is pressed

d)

motors for ports 2 and 5 full power in reverse, motors for ports 3 and 4 full power, only when button 6-d is pressed

27.

3000 milliseconds is the same as

a)

3 minutes

b)

3 hours

c)

3 seconds

d)

3ml

28.

Statements run in English reading order. As soon as one command is complete, the next runs.

a)

(right-to-left, top-to-bottom).

b)

(left-to-right, bottom-to-top).

c)

(left-to-right, top-to-bottom).

d)

(right-to-left, bottom-to-top).

29.

When the program runs out of statements and reaches the ____ symbol in task main, all motors stop, and the program ends.

a)

]

b)

;

c)

{

d)

}

30.

How does RobotC know where one statement ended and the other began?

a)

It knows because of the semicolon at the end of each line.

b)

It knows because of the curly brackets at the end of each line.

c)

It knows because of the square brackets at the end of each line.

d)

It knows because of the bracket at the end of each line.

31.

Every __________________ ends with a semicolon. It’s like the period at the end of a sentence.

a)

sentence

b)

code

c)

statement

d)

option

32.

Every punctuation pair consists of an “_______” punctuation mark and a “________” punctuation mark.

a)

"first" "last"

b)

"starter" "ending"

c)

"initial" "ending"

d)

"opening" "closing"

33.

Different commands make use of different punctuation. The motor command uses square brackets and the wait1Msec command uses _____________.

a)

curly brackets

b)

parentheses

c)

square brackets

d)

semi-colon

34.

The control structure “___________” directs the program to the main body of the code. When you press “Start” or “Run” on the robot, the program immediately goes to task main and runs its code.

a)

task main

b)

starting up

c)

main body

d)

body start

35.

The left and right curly braces { } belong to the_________structure. They surround the commands which will be run in the program

a)

running

b)

main body

c)

command

d)

task main

36.

Normally, statements run only once, but with a __________, they can be told to repeat over and over for as long as you want

a)

while loop

b)

repeater

c)

duplicator

d)

infinity runner

37.

Statements are commands to the robot. Each statement is also usually written on its own line to make it ________.

a)

easier for the robot to read

b)

organized

c)

neat

d)

easier for humans to read.

38.

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)

D. None of the answers are correct.

39.

Pseudocode is

a)

A false code

b)

A code, written in English, that the robot can understand.

c)

A code, written in binary language, that the robot can understand.

d)

A set of basic steps that the human can use to plan the program.

40.

________ 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

41.

Which of the following is a reason that programmers use pseudocode?

a)

It keeps the plan for the program organized.

b)

Writing out the exact code commands takes too much time.

c)

It allows people who can’t read code to understand the plan for the program.

d)

All of the answers are true.

42.

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

43.

A multiline comment ends with:

a)

The pressing of the Enter key

b)

A single slash /

c)

An asterisk and a slash */

d)

Two slashes //

44.
How do we declare(present) a variable ?
a)
int  a;
b)
int  a
c)
int ;
d)
a ;
45.

Where do you start writing your code?

a)

1

b)

2

c)

3

d)

4

46.

How will behave the robot within these codes below?

motor[leftMotor] = 0;

motor[rightMotor] = 100;

a)

Move Forward

b)

Move Backward

c)

Turn Right

d)

Turn Left

47.

How will behave the robot within these codes below?

motor[leftMotor] = 100;

motor[rightMotor] = 0;

a)

Move Forward

b)

Move Backward

c)

Turn Right

d)

Turn Left

48.

How will behave the robot within these codes below?

motor[leftMotor] = 100;

motor[rightMotor] = 100;

a)

Move Forward

b)

Move Backward

c)

Turn Right

d)

Turn Left

49.

What does == mean?

a)

Is equal to

b)

is not equal to

c)

greater than

d)

less than

50.

What does != mean

a)

is equal to

b)

is not equal to

c)

greater than

d)

less than

51.

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

52.

What does && mean?

a)

Is equal to

b)

Next

c)

OR

d)

AND

53.

What does || mean?

a)

A Wall

b)

A Path

c)

And

d)

OR

54.

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

55.

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

56.

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

57.

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

58.

Value of touch sensor when not pressed

a)

0

b)

1

c)

63

d)

127

59.

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

a)

True

b)

False

60.

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

a)

True

b)

False

61.

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

62.

Which is an example of pseudocode?

a)
b)
c)
63.

What is pseudocode?

a)

Shorthand notation for programming which uses a combination of informal programming structures and verbal descriptions of code.

b)

Set of instructions that control the operation of a computer.

c)

Anything your robot does

64.

Which of the following are rules for Variable Names?

a)

A variable name can not have spaces in it

b)

A variable name can have symbols in it

c)

A variable name can not start with a number

d)

A variable name can not be the same as an existing reserved word

65.

Which of the following are proper Variable Names?

a)

line counter

b)

distance3

c)

timeCounter

d)

time1[T1]

66.

Which data type has positive and negative whole numbers, as well as zero?

a)

String

b)

integer

c)

Boolean

d)

Floating Point Decimal

67.

Which data type has a string of characters that can include numbers, letters, or typed symbols?

a)

integer

b)

string

c)

boolean

d)

floating point decimal

68.

Which data type uses True or False and is useful for expressing the outcomes of comparisons?

a)

floating point decimal

b)

integer

c)

string

d)

boolean

69.

Which one is the correct description of the following statement?

sum = variable1 + variable2;

a)

Adds the value in “variable1” to the value in “variable2”

b)

stores the result in the variable “sum”

c)

Adds the value in “variable1” to the value in “variable2”, and stores the result in the variable “sum”

d)

Adds the sum of variable 2 and 2 as the increment

70.

Which is the correct description for the following statement?

count = count + 1;

a)

Adds 1 to the current value of “count” and places the result back into “count” (effectively, increases the value in “count” by 1)

b)

Adds 1 to the current value of “count” and places the result back into “count” (effectively, increases the value in “count” by 2)

c)

Adds the current value of “count” to 1 and places the result plus one back into “count” (effectively, increases the value in “count” by 2)

71.

Which one is the most correct description of the following statement?

int zero = 0;

a)

Add zero as the integer

(combination declaration and assignment statement)

b)

Creates the variable x with an initial value of 0 (combination declaration and assignment statement)

c)

Declare zero as an integer

d)

Declare zero as an initial integer