Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in python Using the image, it is possible to make sense of the convoluted expression. First, the volume of the table top is computed (
in python
Using the image, it is possible to make sense of the convoluted expression. First, the volume of the table top is computed ( 6323.61. Then, the volume of the four legs is added (4pi0.8229.5). Your task is to transform the code above so that the code makes sense on its own for the readers (without the need for external scaffolding). There is one file used in this task - task3a.py. You will be making changes to this file. Start your work by opening the file in your Visual Stud Code. Find the line in the task3a.py stating T000 1. To complete T000 1 assign the following constants with the values as indicated. - Define three constants for the measures of the table top with the following names: TABLE_TOP_LENGTH, TABLE_TOP_WIDTH, TABLE_TOP_HEIGHT. Assign them with the following values: 63.0 for length, 23.6 for width, and 1.5 for height. These are measurements in inches. - Define two constants for the measures of a table leg with the following names: TABLE_LEG_BASE_RADIUS and TABLE_LEG_HEIGHIT.Assi them with the following values: 0.8 for the radius and 29.5 for the height. First, complete the deciaration of the box_vol function by including the length, width and height parameters. Implement the body of the function so that it returns the volume of the box determined by the arguments provided to the three parameters. Feel free to refresh your memory on how to calculate the volume of a box. Second, implement the cylinder_vol function with the base_radius and height parameters. The function returns the volume of the cylinder determined by the arguments provided to the two parameters. Feel free to refresh your memory on how to calculate the volume of a cylinder. In TODO 3 you will implement the table_vol function with the tt _tength, ttwidth, tt_height, leg_base_rad and leg_height parameters ( tt_* parameters relate to the table top and leg_* parameters to the legs). With the box_vol and cylinder_vol functions in place, it may be surprisingly easy to implement a function that computes the volume of a table. All you need to do within the table_vot function is to call the box_vol for computing the volume of the table top, and cylinder_vot for computing the volume of a leg (remember that our table has four legs). In 70004 , you will leverage all the hard work done so far and compute the volume of the table. Define the table_volume variable and assign it with the function call to table vol supplying the constants defined in Tooo 1 as parameters. Congratulations: You have implemented the small script that not only computes the volume of the table, but also is readable and self-explanatory (i.e. anyone can easily understand what is the likely purpose of the program) 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