Intro to Robots Lab 7. Intro to Robots Behaviour-based Robot Control Exercise: Design and implement...
-
Upload
alison-hutchinson -
Category
Documents
-
view
214 -
download
1
Transcript of Intro to Robots Lab 7. Intro to Robots Behaviour-based Robot Control Exercise: Design and implement...
![Page 1: Intro to Robots Lab 7. Intro to Robots Behaviour-based Robot Control Exercise: Design and implement a behaviour-based program that has a robot moving.](https://reader036.fdocuments.net/reader036/viewer/2022082820/56649ef15503460f94c01d45/html5/thumbnails/1.jpg)
Lab 7
![Page 2: Intro to Robots Lab 7. Intro to Robots Behaviour-based Robot Control Exercise: Design and implement a behaviour-based program that has a robot moving.](https://reader036.fdocuments.net/reader036/viewer/2022082820/56649ef15503460f94c01d45/html5/thumbnails/2.jpg)
Behaviour-based Robot Control
• Exercise: Design and implement a behaviour-based program that has a robot moving back and forth between two flashlights, 10 feet apart and shining at each other. The flashlights are located on top of a couple of books that act as obstacles for the robots.
![Page 3: Intro to Robots Lab 7. Intro to Robots Behaviour-based Robot Control Exercise: Design and implement a behaviour-based program that has a robot moving.](https://reader036.fdocuments.net/reader036/viewer/2022082820/56649ef15503460f94c01d45/html5/thumbnails/3.jpg)
Programming Exercises:
• Using the sequence, selection and iteration control structures, design and implement a program that simulates a soda machine. • Accept denominations of 5¢, 10¢, 25¢ and $1. • Sodas should cost 75¢ each. • The machine should give change where appropriate.• The machine should offer 3 choices of soda• Upon sale, the machine should display a message
saying the soda has been delivered• Extra: The machine should keep track of how many
sodas have been sold and know if it is out of a particular soda type.
![Page 4: Intro to Robots Lab 7. Intro to Robots Behaviour-based Robot Control Exercise: Design and implement a behaviour-based program that has a robot moving.](https://reader036.fdocuments.net/reader036/viewer/2022082820/56649ef15503460f94c01d45/html5/thumbnails/4.jpg)
Programming Exercises:
• Implement a program that calculates and prints out a list of monthly payments on a home equity loan. The program must allow you to enter: – Loan Amount– Annual interest rate (y%)– Loan Duration (in months)
• Monthly Payment Calculation is:
• Obviously
Monthly Payment = (Loan Balance + Current Monthly Interest Amount) Number of Months Remaining on Loan
New Loan Balance = Old Loan Balance + Monthly Interest – Monthly Payment
![Page 5: Intro to Robots Lab 7. Intro to Robots Behaviour-based Robot Control Exercise: Design and implement a behaviour-based program that has a robot moving.](https://reader036.fdocuments.net/reader036/viewer/2022082820/56649ef15503460f94c01d45/html5/thumbnails/5.jpg)
Exercise:
• Go to a local bank and find out the formula for calculating the monthly payment on– A mortgage– A home equity loan– A car loan
• Compare the three mechanisms for total interest paid.