smithcsrobot.weebly.comsmithcsrobot.weebly.com/.../roboticsprogpracticetest5-23-2018take…  ·...

7
Practice Test Name:_____________ A) B) C) D) E) F) G) H) I) J) K) L) M) N) O) P) Q) R) S) T) Matching: 1) ___ Shaft Collar 2) ___ Gear 3) ___ Sprocket 4) ___ Shaft Encoder 5) ___ Delrin Bearing Flat 6) ___ Motor 7) ___ Keps nut 8) ___ ‘C’ Channel 9) ___ Gusset 10) ___ High strength chain 11) ___ Chassis rail 12) ___ Treads 13) ___ Ultrasonic range finder 14) ___ Bumper Sensor 15) __ Limit Switch 16) ___ Mecanum Wheel 17) ___ Line

Transcript of smithcsrobot.weebly.comsmithcsrobot.weebly.com/.../roboticsprogpracticetest5-23-2018take…  ·...

Page 1: smithcsrobot.weebly.comsmithcsrobot.weebly.com/.../roboticsprogpracticetest5-23-2018take…  · Web viewType the word VOID (all caps) and then the function name. Where should you

Practice Test

Name:_____________

A)

B)

C)

D)

E)

F)

G)

H)

I)

J)

K)

L)

M)

N)

O)

P)

Q)

R)

S)

T)

U)

Matching:

1) ___ Shaft Collar2) ___ Gear3) ___ Sprocket4) ___ Shaft Encoder5) ___ Delrin Bearing Flat6) ___ Motor7) ___ Keps nut8) ___ ‘C’ Channel9) ___ Gusset10) ___ High strength chain11) ___ Chassis rail12) ___ Treads13) ___ Ultrasonic range finder14) ___ Bumper Sensor15) __ Limit Switch16) ___ Mecanum Wheel17) ___ Line following sensor18) ___ Omni directional wheel19) ___Angle bar20) ___ Cortex21) ___ Nyloc nut

Page 2: smithcsrobot.weebly.comsmithcsrobot.weebly.com/.../roboticsprogpracticetest5-23-2018take…  · Web viewType the word VOID (all caps) and then the function name. Where should you

1. A function allows you to:a. Use a sensor of your own designb. Use an analog sensor as a digital sensorc. Write a segment of code once, name it and then use it throughout the programd. Write a segment of code once and then use it under a different name throughout the

program2. How do you call a function?

a. Type the word CALL (all caps) and then the function nameb. Type the word USE (all caps) and then the function namec. Type the function name as a command, ending with a semicolond. Type the word VOID (all caps) and then the function name

3. Where should you declare a function in a program?a. It is part of the pragma statementsb. Between the pragma statements and task mainc. Right after task maind. Anywhere in the program as long as it is used before it is declared

4. A parameter is a special variable that allows you to pass data into a function.a. Trueb. False

5. Where do you specify a parameter in a function?a. In the pragma statementsb. Between the pragma statement and task mainc. Anywhere in the program as long as it is specified before it is usedd. Between the parentheses directly after the function name

6. If you are going to use a parameter with the same value more than once in a program, it is not necessary to provide a value for the second or subsequent times you use it.

a. Trueb. False

7. A parameter allows a function to be used many times in a program with different values.a. Trueb. False

8. The Ultrasonic Rangefinder is:a. An Analog Sensorb. A Digital Sensorc. A Boolean Sensord. A Character Sensor

9. What equation does the Ultrasonic Rangefinder use to calculate distance?a. Distance = Speed * Timeb. Distance = Speed / Timec. Distance = Speed * Time / 2d. Distance = Speed * 2 / Time

Page 3: smithcsrobot.weebly.comsmithcsrobot.weebly.com/.../roboticsprogpracticetest5-23-2018take…  · Web viewType the word VOID (all caps) and then the function name. Where should you

10. What is the correct code for using the Ultrasonic Rangefinder?a. while(SensorValue[sonarSENSOR] > threshold)b. while[sonarSENSOR] > thresholdc. while(sonarSENSOR) > thresholdd. while[ultrasonicSENSOR] > threshold

11. Why is it important to clear the encoders before starting the program?a. If you didn’t clear them, they would always start from a positive value and would go off

courseb. If you didn’t clear them, they would always start from a negative value and would go off

coursec. If you didn’t clear them, they could start with a non-zero value and the robot would

make corrections based on the bad data, causing the robot to go off coursed. It’s not important in this case. It was put there to assure that you would get into the

habit of always clearing the encoders12. Why did the robot stop when it could not detect an object?

a. It actually did not stopb. The default value of the Ultrasonic Sensor, when it cannot detect an object is less than

the threshold valuec. It didn’t know what to do and stopping is the fail-safe conditiond. The threshold value was set too low

13. Light intensity readings from the Line Tracking Sensor range from:a. 0 to 100b. 0 to 1000c. 0 to 4095d. -100 to +100

14. The Line Tracking Sensor is not affected by ambient light.a. Trueb. False

15. The Line Tracking Sensor is a digital sensor since it only has two conditions, light and dark.a. Trueb. False

16. When calculating the threshold for a single Line Tracking Sensor, add the high and low sensor values and divide by 2.

a. Trueb. False

17. When using three Line Tracking Sensors, your robot must check the left sensor first, then the center sensor and then the right sensor

a. Trueb. False

18. It makes no difference which encoder you use to control the duration of the line tracking behavior

a. True – Both wheels always travel the same number of rotationsb. False – On a curve, the inside wheel always travels a shorter distance than the outer

wheel.

Page 4: smithcsrobot.weebly.comsmithcsrobot.weebly.com/.../roboticsprogpracticetest5-23-2018take…  · Web viewType the word VOID (all caps) and then the function name. Where should you

19. How can you access the value of a timer?a. Use the timeX[ ] command, where X is the number of your timerb. Use the time1[ ] command, where the timer being used is specified between the square

bracketsc. Use the StopWatch1[ ] command, where the timer being used is specified between the

square bracketsd. You can’t. You must use a stopwatch

20. In the condition, while (time1[T2] > 30000) { } ,a. The robot will run until the timer, T2, is less than 30000 msecsb. The robot will run until the timer, T2, is greater than 30 secondsc. The robot will run until the timer, time1, is greater than 30000 msecsd. The robot will not run unless the timer, T2, is greater than 30000 msecs when it

encounters this condition.21. When using an If Statement, when the condition between the parentheses is true:

a. The commands between the curly braces are run foreverb. The commands between the curly braces are run only oncec. The commands between the curly braces are skipped overd. The commands between the curly braces are skipped over and then checked again

22. Why is a While Loop required when using the remote control?a. That’s the way the VEXnet is programmedb. So that the information to the robot is continuously updatedc. Without a While Loop, the robot would drive around in circlesd. A While Loop is used to keep the batteries from running low

23. What side effect did the method of improving low speed control have?a. There were no side effectsb. The robot was no longer able to move at top speedc. The robot did not turn as welld. The motors became jumpy, like they were not getting continuous signals from the

remote.24. A shaft encoder is:

a. An analog sensor that measures the distance the robot travelsb. A sensor that moves the wheel axle the number of times it has been programmed to do

soc. An analog sensor that codes its output so that only your robot, with its code breaker

information, can use itd. A digital sensor that measures the amount of rotation on the axle which passes through

its sensor

25. Encoder wires must be plugged:a. Into any analog portsb. Into any adjacent analog portsc. Into any adjacent digital portsd. Into one analog and one digital port

Page 5: smithcsrobot.weebly.comsmithcsrobot.weebly.com/.../roboticsprogpracticetest5-23-2018take…  · Web viewType the word VOID (all caps) and then the function name. Where should you

26. What are the parts of a while loopa. The ‘while’ command and the body of the body of code that is loopedb. The ‘while’ command and the condition to control when the loop should be stoppedc. The ‘while’ command, the condition to control when the loop should end and the body

of the code that is loopedd. The ‘while’ command, the condition to control when the loop should be stopped and its

square braces.27. In our Labyrinth using Encoders program, we could also have caused the robot to go a shorter,

straight distance by:a. Changing the power level of both motorsb. Changing the power level of the left motorc. There is no other way to change the distance the robot travels other than changing the

number of counts on the encoderd. Changing the power level of the right motor

28. How is the robot able to determine it is veering?a. A touch sensor on the side of the robot is pressed when the robot runs into a side wallb. A light sensor on the front of the robot senses that it is traveling over a black linec. The left and right encoders are not the same valued. It can’t – the programmer has to tell it that it is veering

29. An IF-ELSE statement allows the robot to run two different portions of code at the same time.a. Trueb. False

30. If the WHILE loop were not part of the program, the IF statements would:a. Run continuouslyb. Cause the robot to run straight foreverc. Run only onced. An IF statement will not run if it is not part of a WHILE loop

31. In your program the WHILE loop was used to control:a. The overall distance the robot movesb. The use of the IF statementsc. The overall length of the programd. The speed of your robot

32. To get the robot to move in a circle, you would:a. Use the MotorCircle commandb. Turn on only one motorc. Assure that the Wait1Msec command was at least 3000d. Make sure that the motor is connected to Port 1

33. A millisecond is a millionth of a second.a. Trueb. False

Page 6: smithcsrobot.weebly.comsmithcsrobot.weebly.com/.../roboticsprogpracticetest5-23-2018take…  · Web viewType the word VOID (all caps) and then the function name. Where should you