Question:
Define a class CONTAINER in Python with following specifications
Instance Attributes
- Radius,Height # Radius and Height of Container
- Type # Type of Container
- Volume # Volume of Container
Methods
- CalVolume() # To calculate volume
# as per the Type of container
# With the formula as given below:
| Type | Formula to calculate Volume |
|---|---|
| 1 | 3.14 * Radius * Height |
| 3 | 3.14 * Radius * Height/3 |
- GetValue() # To allow user to enter values of
# Radius, Height and Type.
# Also, this method should call
# CalVolume() to calculate Volume
- ShowContainer() # To display Radius, Height, Type
# Volume of the Container
C. Sir| Created: 9-Jan-2019 | Updated: 9-Jan-2019|CBSE12A-2018
