1.
According to the Robot-C video, what is the role of the programmer?
Correct Answer
B. Identifying the task, planning a solution, and explaining to the robot what it needs to do to reach the goal
Explanation
The role of the programmer, according to the Robot-C video, is to identify the task, plan a solution, and explain to the robot what it needs to do to reach the goal. The programmer is responsible for analyzing the problem, determining the steps required to solve it, and providing instructions to the robot on how to execute those steps. This involves understanding the goal and breaking it down into manageable tasks that the robot can understand and perform. The programmer's role goes beyond simply telling the robot what to do; it involves strategic thinking and problem-solving skills to ensure the robot can successfully achieve the desired outcome.
2.
According to the Robot-C video, what is the role of the robot?
Correct Answer
D. To follow the instructions given to it
Explanation
The role of the robot, according to the Robot-C video, is to follow the instructions given to it. This means that the robot's main purpose is to carry out specific tasks or actions as directed by the programmer. It is designed to adhere to the given instructions and perform the desired actions accurately and efficiently.
3.
Pseudocode is…
Correct Answer
D. A hybrid language that is half way between English and the programming language
Explanation
Pseudocode is a programming language that is designed to be easily understood by both the programmer and the robot. It is a hybrid language that combines elements of English language with programming language syntax. This allows the programmer to write code in a more human-readable format, making it easier to understand and debug. The robot can then interpret and execute the pseudocode instructions to perform the desired tasks.
4.
White spaces and line breaks are important in programming because…
Correct Answer
B. They make the code more readable for the programmer
Explanation
White spaces and line breaks are important in programming because they make the code more readable for the programmer. By adding white spaces and line breaks, the code becomes easier to understand and follow, especially when dealing with complex or lengthy code. It helps in organizing the code and separating different sections or blocks of code. Additionally, it improves code maintenance and collaboration among programmers by making it easier to identify and modify specific parts of the code.
5.
What is the difference between using // and /* */ in your program?
Correct Answer
A. // allow the programmer to insert a note on a single line and /* */ allow the programmer to use more than one line for notes
Explanation
The correct answer states that using // allows the programmer to insert a note on a single line, while /* */ allows the programmer to use more than one line for notes. This means that // can be used to add comments or explanations to a specific line of code, while /* */ can be used to add comments or explanations that span multiple lines of code.
6.
Identify the line in which the error exists in the following code:
1 task main ()
2 {
3
4 motor[motorC] = 100;
5 motor[motorB] = 100;
6 wait1Msec(2000);
7
8 }
Correct Answer
E. There is no error
7.
Identify the line in which the error exists in the following code:
1 task main ()
2 {
3
4 motor[motorC] = 100;
5 motor[motorB] = 100;
6 wait1Msec[2000];
7
8 }
Correct Answer
D. Line 6
Explanation
The error exists in Line 6. The code is trying to use the "wait1Msec" function, but it is using square brackets instead of parentheses to call the function. The correct syntax should be "wait1Msec(2000);"
8.
Identify the line in which the error exists in the following code:
1 Task main ()
2 {
3
4 motor[motorC] = 100;
5 motor[motorB] = 100;
6 wait1Msec(2000);
7
8 }
Correct Answer
A. Line 1
9.
What will the robot do when it follows the following commands:
1 task main ()
2 {
3
4 motor[motorC] = -100;
5 motor[motorB] = 100;
6 wait1Msec(2000);
7
8 }
Correct Answer
D. Do a point turn for 2 seconds
Explanation
The robot will do a point turn for 2 seconds because in the given code, the motor[motorC] is set to -100 and motor[motorB] is set to 100. This means that motorC will move in the opposite direction to motorB, causing the robot to turn on the spot. The wait1Msec(2000) command indicates that the robot will wait for 2000 milliseconds, which is equal to 2 seconds. Therefore, the robot will perform a point turn for 2 seconds.
10.
What will the robot do when it follows the following commands:
1 task main ()
2 {
3
4 motor[motorC] = -50;
5 motor[motorB] = -50;
6 wait1Msec(5000);
7
8 }
Correct Answer
C. Reverse at half speed 5 seconds
Explanation
The given code snippet is a part of a program for a robot. In the program, the motors for motorC and motorB are set to a speed of -50, which indicates reverse motion. The wait1Msec(5000) command pauses the program for 5 seconds. Therefore, the robot will reverse at half speed for 5 seconds.
11.
What will the robot do when it follows the following commands:
1 task main ()
2 {
3
4 motor[motorC] = -75;
5 motor[motorB] = 0;
6
7 motor[motorC] = 0;
8 motor[motorB] = 0;
9 wait1Msec(3000);
10
11 }
Correct Answer
B. Nothing
Explanation
The robot will do nothing because the motors are set to 0 in lines 5 and 8, and there are no other commands given to the motors. Additionally, there is a wait1Msec(3000) command in line 9, which means the robot will wait for 3 seconds before continuing to the next command, but there are no further commands after the wait. Therefore, the robot will simply do nothing.
12.
Control structures such as task main or if-else:
Correct Answer
C. Control the “flow” of commands: they choose which commands to run and when
Explanation
Control structures such as task main or if-else control the "flow" of commands: they choose which commands to run and when. They determine the sequence and conditions under which different commands are executed by the robot. These control structures are essential for programming the robot to perform specific tasks and make decisions based on certain conditions. They play a crucial role in directing the overall behavior and functionality of the robot.