Answer to Question #250154 in Python for phil

Question #250154

2 types of tyres in stock, namely for luxury vehicles and for construction vehicles.

Cons vehicle tyres cost twice the price of luxury vehicle tyres, the prices

depend on the wheel size according to the following price list for luxury vehicles:

Wheel Size: Price ($)

Less than 10 Inches: 3.50

10- 15 Inches: 4.00

Greater than 15 inches: 6.00


create a python program that implements the program:

a) Create a class called Home, which contains a function called Details for receiving the

values of the type of vehicle, the size of the tyres and the number of tyres for the

vehicle.

b) Create a class called Construction which contains:

i) A constructor

ii) A function called Calc for doing relevant calculations for calculating the total price

of the tyres purchased for construction vehicles.

c) Create a class called Luxury which contains:

i) A constructor

ii) A function called Calc for doing relevant calculations for calculating the total price

of wheels purchased for construction vehicles.



1
Expert's answer
2021-10-13T00:30:01-0400
class Home:
    def Details( type_of_vehicle, size_of_tyres, number_of_tyres):
        pass
class Construction():
    def __init__(self, wheelSize):
        self.wheelSize=wheelSize
    def Calc(self):
        price=0
        if (self.wheelSize<10):
            price=3.50*2
        elif (self.wheelSize>=10 and self.wheelSize<=15):
            price=4.00*2
        elif (self.wheelSize>15):
            price=6.00*2
        print("Price per tyre is: ",price)
class Luxury():
    def __init__(self, wheelSize):
        self.wheelSize=wheelSize;
    def Calc(self):
        price=0
        if (self.wheelSize<10):
            price=3.50
        elif (self.wheelSize>=10 and self.wheelSize<=15):
            price=4.00
        elif (self.wheelSize>15):
            price=6.00
        print("Price per tyre is: ",price)
           
c=Construction(8)
c.Calc()


l=Luxury(15)
l.Calc()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS