NEW
Font size
S
M
L
XL
WorksheetsProgramming Functions
Total questions: 13
Worksheet time: 37mins
Name
Class
Date
1.
Which of the following would show a message to the user?
a)
scanf("Hello world!");
b)
printf("Hello world!");
c)
printf(Hello world!);
d)
printf("Hello world!")
2.
Which of the following functions is an input for the user to enter a name?
a)
scanf("&name", %s);
b)
printf("%s", &name);
c)
scanf("%s", &name);
d)
scanf("&s", %name);
3.
Which command moves the shown text to the next line?
a)
\t
b)
\n
c)
\r
d)
\s
4.
Which of the following is initializing a variable that allows decimals?
a)
string_t house;
b)
int house;
c)
array house;
d)
double house;
5.
Which of the following is initializing a variable that allows only whole numbers?
a)
string_t house;
b)
int house;
c)
array house;
d)
double house;
6.
Which of the following is initializing a variable that allows words?
a)
string_t house;
b)
int house;
c)
array house;
d)
double house;
7.
Which of the following functions repeats until a condition is met?
a)
while(x<10){
}
}
b)
if(x<10){
}
}
c)
else if(x<10){
}
}
d)
printf("Hello World!");
8.
Which of the following functions repeats when a condition is met?
a)
while(x<10){
}
}
b)
if(x<10){
}
}
c)
scanf("%d", &score);
d)
printf("Hello World!");
9.
What must be used at the start of any program that is used for controlling the linkbots?
a)
#include<linkbot.h>
CLinkbotI robot;
CLinkbotI robot;
b)
#linkbot.h
CLinkbotI robot;
CLinkbotI robot;
c)
#include<linkbot.h>
Linkbot robot;
Linkbot robot;
d)
#include<linkbot>
CLinkBotI robot;
CLinkBotI robot;
10.
What is the fastest degrees per second that the linkbots can rotate their wheels?
a)
6 degrees per second
b)
100 degrees per second
c)
200 degrees per second
d)
There is no limit
11.
Which of the followings lines would be used to change the speed of a single wheel?
a)
robot.setJointSpeed(100, NaN, 200);
b)
robot.setSpeed(6, 1.75);
c)
robot.driveDistance(10, 1.75);
d)
robot.setLEDColor("yellow");
12.
Which of the following lines changes the color of the light of the robot?
a)
robot.setLedColor("YELLOW");
b)
robot.setLEDColor(yellow);
c)
robot.setLEDColor("yellow");
d)
robot.setledcolor("yellow");
13.
Which of the following programs will drive forward 10 inches, turn right 30 degrees, and the drive forward 5 inches?
a)
robot.driveDistance(5, 1.75);
robot.turnRight(30, 1.75, 3.69);
robot.driveDistance(10, 1.75);
robot.turnRight(30, 1.75, 3.69);
robot.driveDistance(10, 1.75);
b)
robot.driveDistance(5, 1.75);
robot.turnRight(30, 1.75, 3.69);
robot.driveDistance(5, 1.75);
robot.turnRight(30, 1.75, 3.69);
robot.driveDistance(5, 1.75);
c)
rrobot.driveDistance(10, 1.75);
robot.turnRight(30, 1.75, 3.69);
robot.driveDistance(5, 1.75);
robot.turnRight(30, 1.75, 3.69);
robot.driveDistance(5, 1.75);
d)
robot.driveDistance(10, 1.75);
robot.turnLeft(30, 1.75, 3.69);
robot.driveDistance(5, 1.75);
robot.turnLeft(30, 1.75, 3.69);
robot.driveDistance(5, 1.75);
Reset
