Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

More Books

Students also viewed these Databases questions

Question

4. Did the presenter offer a clear and memorable summary?

Answered: 1 week ago

Question

=+ Will it stimulate consumption, as the traditional view holds?

Answered: 1 week ago

Question

=+how will the policy affect the economy?

Answered: 1 week ago