Question
Implement a class SodaCan with methods getSurfaceArea() and getVolume() . In the constructor, supply the height and radius of the can. 5 pts Surface Area
Implement a class SodaCan with methods getSurfaceArea() and getVolume(). In the constructor, supply the height and radius of the can. 5 pts
Surface Area = (2* pi * radius * height) + (2 * pi * radius2)
Volume = pi * radius2 * height
Use the following to run your class:
can = SodaCan (2,4)
print(The volume of the can is, can.getVolume())
print(The surface area of the can is, can.getSurfaceArea())
a) Your code with comments
b) A screenshot of the execution
please use python for run this Q and please read the Q carefully and run it step by step and don't forget to include the comments with the coding
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