Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 Design and implement a Python class, Funnel, which defines and processes an open funnel object which has a conical part and a cylindrical

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Question 2 Design and implement a Python class, Funnel, which defines and processes an open funnel object which has a conical part and a cylindrical part as shown below: r1 h1 large cone r2 h2 small cone h3 cylinder The large cone is cut at the bottom (into a smaller cone) to fit the cut end into the open cylinder to form the funnel. To compute the surface area of the funnel you need to compute the surface area of the larger cone minus the 5 79 To compute the surface area of the funnel you need to compute the surface area of the larger cone minus the surface area of the smaller cut-up cone plus the surface area of the open cylinder. Thus, the formula to compute the total surface area of the funnel is: Funnel SA = t.rl. (r1+ V (h1 + h2)2 + r12 - 11.r2 :-(r2 + V. h2? + r22) + 2 - Tr2. h3 Where: r1 is the radius of the top (mouth) of the larger cone h1 is the height of the larger cone (from top to the cut made to fit into the funnel/mouth of the smaller cone) r2 is the radius of the cylindrical part and the cut made in the larger cone (mouth of the smaller code) to fit it into the funnel h2 is the height of the smaller cone h3 is the height of the cylindrical part of the funnel (the funnel stem) . The Funnel object has the following characteristics: NoOfFunnels is a class variable that keeps track of number of funnels created (initally O). Noof Funnels automatically increments with each new object created, i.e., when the first object is NoOfFunnels is a class variable that keeps track of number of funnels created (initally O). NoofTunnels automatically increments with each new object created, i.e., when the first object is created, its NoofFunnels should be 1, when the second object is created, its NoofFunnels should be 2, etc. funnelID is 100 more than funnel number (i.e., when the first object is created, its funnelID should be 101, when the second object is created, its funnelID should be 102, etc.) rl is the radius of the top (mouth) of the larger conical part in centimetres r2 is the radius of the cylindrical part where it fits at the lower part of the funnel at height h2 hl is the height of the larger conical part in centimetres h2 is the height of the smaller cone (cut from larger cone) h3 is the height of the cylindrical part of the funnel (funnel stem) o O Define a constructor method for the Funnel class and also include the following methods: accessor methods get FunnelID to retrieve the ID of the funnel o getFunnelMouth to retrieve the diameter of the mouth of the funnel get FunnelStem to retrieve the length of the cylinder/stem of the funnel mutator method updateHeight to update the height of the cylinder part of the funnel method computeSurfaceArea to compute the surface area/amount of steel required to construct the funnel o Activate Windows Also include a main function to create and test the defined class to include: creation of 3 funnel objects nrint the funnelin funnel mouth diamater and funnel stem length for the second funnel created O 6 9 o Also include a main function to create and test the defined class to include: creation of 3 funnel objects print the funnel ID, funnel mouth diameter and funnel stem length for the second funnel created print the total steel required (in square centimetres) to construct each one of the funnels print total steel required (in square centimetres) to construct all the funnels Sample input/output: With the input values for each of the three funnels as follows: r1=10, r2=5, h1=15, h2=3, h3=10 r1=8, r2=3, h1=10, h2=2, h3=8 r1=20, r2=8, h1=25, h2=5, h3=10 The output is as follows: Information about second funnel Funnel ID: 102 Funnel Mouth: 16 cm Funnel Stem: 8 cm Steel required for funnel with ID 101 is 1105.08 sq.cm Steel required for funnel with ID 102 is 652.07 sq.cm Steel required for funnel with ID 103 is 3586.56 sq.cm The total steel required for 3 funnels is 5343.71 sq.cm Call the file containing your class funnels.py

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

The company openly shares plans and information with employees.

Answered: 1 week ago

Question

6. How would you design your ideal position?

Answered: 1 week ago

Question

2. How do they influence my actions?

Answered: 1 week ago