

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Files to submit: 1. hw3.py For Help:
Hopefully by now, you’ve gotten your robot out of the box and made friends with it (or at least acquaintances); given it a name and a back story. Well, how about now you take it out to a dance? Of course, you’ll have to teach your robot to dance. Using the movement functions: http://wiki.roboteducation.org/Myro_Reference_Manual#Movement_Functions have your robot do a little dance. The dance should last for at least seconds, and contain at least 3 distinct dance moves, ie don’t just go back and forth for 30 seconds; vary the dance a bit. Pretend you’ve got a spastic robot. In addition to the movement, your robot should also make some noise! The beep() function is very helpful – it allows the robot produce various tones. You are allowed (and encouraged) to make your own helper functions that contain individual dance moves. Write your dance as a function called dance() , and save it into a file called hw3.py. As always, please name your file exactly as requested.
For the next 3 parts, you will be writing small functions that convert between the Standard (US) and Metric measuring systems. For part A, you will write a function called area() which takes in a value in US Standard square inches and coverts that value into the Metric square centimeters. For reference, there are 6.45 square centimeters in one square inch. Please return the value. Save this function in your hw3.py file as well. Sample Output:
area(2)
area(5)
In this section, you will need to convert volumes. There are 2.11 US pints in one liter. Write a function called volume() that takes in a value in liters and converts it to US pints. Since we want to know what we’re dealing with, print the value out with a nice little sentence explaining the conversion that just happened. Please print the values to 2 decimal places. See the sample output below. Save this function in your hw3.py file as well. Sample Output:
volume(1) There are 2.11 US pints in 1.00 liters volume(4) There are 8.44 US pints in 4.00 liters
Just like the previous two problems, it’s conversion time. One average spider monkey is equal to 37.62533333333 hockey pucks. Seriously. Write a function called monkeys() that takes in a number of monkeys and prints out the resultant conversion into hockey pucks. Please round the number of hockey pucks to 4 decimal places. See the sample output for more clarification. Save this function in your hw3.py file as well. Sample Output:
monkeys(3) There are 112.8760 hockey pucks in 3.000000 average spider monkeys monkeys(11.57) There are 435.3251 hockey pucks in 11.570000 average spider monkeys Source for the conversion factor: http://www.weirdconverter.com/ You should totally go there and play around with conversions that don’t make any sense. Impress your professors! Entertain your friends! Dazzle your family!