Log in
Sign up for FREE
arrow_back
Library

Coding Quiz

star
star
star
star
star
Last updated over 3 years ago
10 questions
1
1
1
1
1
1
1
1
1
1
Question 1
1.

What would be the output of the following program:


Question 2
2.

What would be the output of this function?

Question 3
3.

Question 4
4.

What exactly is the error?

Question 5
5.

What is the error in this code?



Question 6
6.

Question 7
7.

Which robot will drive further?

Question 8
8.

Which robot would drive further?

Question 9
9.

Which robots Joints will rotate the most?

Question 10
10.

When I run this program, first sarah drives and then, after she is finished, peter drives. I want them to drive at the same time. How could I change the code so this will happen?

On what line of code is the bug?

1
2
3
4
5
6
7
They need to add "\n" at the end of the print statement.
'driveAngle(angle)' should be changed to 'driveDistance(distance)'
You can't use human names for robots, that's creepy.
How would you fix the error in the code?


A) Change 'sarah' and 'peter' to 'Sarah' and 'Peter' in line 2.
B) Change 'sarah' to 'robot' in line 2
C) Change 'robot.driveAngle(angle)' to 'sarah.driveAngle(angle)' in line 5.
D) Both B & C

Impossible to tell without knowing what color wheels they are using.
Change line 7 so that is reads: sarah.driveDistanceNB(distance, radius1);
Change line 8 so that it reads: peter.driveDistanceNB(distance, radius1);
Change line 3 so that it reads: double radius1 = 2.0;
Add the line of code to line 6 to read: sarah.setJointSpeed(45);