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
Get step-by-step solutions from verified subject matter experts
