Courses‎ > ‎Intro to CS - Half Year‎ > ‎Dyrland-Weaver‎ > ‎Work‎ > ‎

### Work 03: 9/14

posted Sep 14, 2018, 11:06 AM by JonAlf Dyrland-Weaver   [ updated Sep 16, 2018, 11:44 AM ]
 Write the following racket functions. Save and submit a .rkt file with your definitions and test cases.areaCHas 1 parameter representing the diameter of a circleReturns the area of that circleExamples:`(areaC 20) ==> 314``(areaC 5) ==> 19.625`hypotenuseHas 2 parameters representing the 2 non-hypotenuse legs of a right triangle.Returns the length of the hypotenuse of the right triangleRemember what your good friend Pythagoras taught you: a2 + b2 = c2Examples:`(hypotenuse 3 4) ==> 5``(hypotenuse 11 60) ==> 61`perimFromAreaHas 1 parameter representing the area of a square.Returns the perimeter of that squareExamples:`(perimFromArea 25) ==> 20``(perimFromArea 10) ==> 12.649110640673518`areaDonutConsider a 2-dimensional donut, which is essentially a circle with a circular hole cut out of the middle.Takes 2 parameters representing the diameter of the outer circle and the inner circle, respectivelyReturns the area of that donut. Hint: you should already have written a function that finds the area of a circleExamples:`(areaD 20 5) ==> 294.375`Submit this on the hw server under racket-1