Question
Create a class called Tank that will be used to represent fuel tanks. Tanks will have two properties named capacity and percent_full. Add a creator
Create a class called "Tank" that will be used to represent fuel tanks. Tanks will have two properties named capacity and percent_full. Add a creator to the class that takes two arguments from the user and fills the properties. Default the percent full parameter to 0 if the user creates a tank with only capacity. In a main def (outside the class) create an instance of the class Tank with a capacity of 22 gallons that is 3/8 full. calculate the estimated number of gallons in the tank, by accessing the properties of the object, and display tht number. Call main at the bottom of your code to start 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