Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 4 The lateral surface area of a right-circular cone (a right cone with a base that is a circle) can be calculated by the
Exercise 4 The lateral surface area of a right-circular cone (a right cone with a base that is a circle) can be calculated by the function: f:h, r f(h, r); f(h, r) = ar 1p +h where h is the height of the cone and r is the radius of the circular base. Step 1: Use a calculator to determine the area of a right circular cone for various positive values of r and h. These will be your test cases for Step 5. Step 2: Create a new editor window and save it. Use lab3ex4.py as the file name. Step 3: Type this function header: def area_of_cone (height, radius): This function will return the lateral surface area of a right circular cone with the specified height and radius. Complete the function definition. For the value of t, use variable pi from the math module. Python's math module also has a function that calculates square roots. To find out about this function, use Python's help facility. In the shell, type: >>> import math >>> help(math.sart) Step 4: Save the code, then click Run. Correct any syntax errors. Step 5: Use the shell to test your function. Use the test cases you prepared in Step 1. For each test, is the actual result (the value returned by the function) equal to the expected result (the value you calculated in Step 1)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started