ENGR 132 - QUIZ10

ENGR 132 - QUIZ10 - for t = 1:30...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style 4/24/11 ENGR 132 Wed/Fri 3:30-5:30
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/24/11 Quiz 10 – TEAM QUIZ Your team has been tasked with navigating robot along a wall for 30 seconds. The robot must stay within 50 cm of the wall, but no closer than 10 cm. Three user defined functions are available for your use. robot_wall_position: determines how close the robot is to the wall input arg: time output arg: position from wall (in cm) robot_too_close: steers robot away from the wall input arg: position from wall (in cm) output arg: none robot_too_far: steers robot towards to wall input arg: position from wall (in cm) output arg: none Using the most appropriate structures , write the code required to determine the robot position from the wall
Background image of page 2
4/24/11 Solution
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for t = 1:30 [position]=robot_wall_positio n(t) if position >=50 robot_too_far(position) elseif position <=10 robot_too_close(position) end end +5 teaming +5 code (+1 for loop code) (+1 if structure code) (+3 correctly calling each function) Click to edit Master subtitle style 4/24/11 ENGR 132 Tues/Thurs 9:30-11:30 4/24/11 Quiz 10 1) What is the definition of re-usability? 2) List three components that make a procedure re-usable. 4/24/11 Solution 1) Re-usability means that the procedure can be used by the direct user in new but similar situations. 2) Re-usable procedure Identifies who the direct user is and what the direct user needs in terms of the product, criteria for success,...
View Full Document

Page1 / 6

ENGR 132 - QUIZ10 - for t = 1:30...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online