User Tools

Site Tools


gibson:teaching:fall-2014:math445:hw4

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== Math 445 HW4 ====== **Problem 1:** Write a function ''coincount'' that computes the dollar value of a number of quarters, dimes, and nickels. Use it to compute the dollar value of 18 quarters, 5 dimes, and 12 nickels. **Problem 2:** Write a function ''hms2decimal'' that converts a time in hours, minutes, and seconds and converts it to hours in decimal. Use it to calculate the decimal equivalent of 6 hours, 27 minutes, and 18 seconds. **Problem 3:** Write a function ''decimal2hms'' that converts a time in decimal hours to hours, minutes, and seconds. Use it to compute the hours, minute, and seconds equivalent of 18.782 hours. **Problem 3:** Write a function ''polar2cartesian'' that converts polar coordinates ''r, theta'' to Cartesian coordinates ''x,y''. Use it to compute the Cartesian coordinates of ''r=2, theta=pi/6''. **Problem 4:** Write a function ''cartesian2polar'' that converts Cartesian coordinates ''x,y'' to polar coordinates ''r, theta''. Use it to compute the polar coordinates of ''x=2, y=3''. **Problem 5:** It is likely that for problem 4 you used an inverse trigonometric function to get the value of ''theta'' from ''x'' and ''y''. Are there any special values of ''x,y'' for which this calculation would fail? Revise ''cartesian2polar'' function so that it uses an ''if-else'' statement in order to work around this problem.

gibson/teaching/fall-2014/math445/hw4.1412625158.txt.gz · Last modified: 2014/10/06 12:52 by gibson