Question: Python 3 Q1) You are given the file Lab_Automobile.py which has an incomplete python class called Automobile. Complete the given class by implementing the following
Python 3


Q1) You are given the file "Lab_Automobile.py" which has an incomplete python class called Automobile. Complete the given class by implementing the following methods: get horsepower), get_ color(), and get_worth(). You may find the following information useful for implementation of get_worth method: The worth of the automobile can be computed by using the following formula: worth horsepower*length*color factor*10 where color factor is 3 if the automobile's color is "red", 2 if the automobile's color is "yellow" or "blue", and 1 otherwise. In addition to completing the Automobile class, you have to complete the main) function which is also in the given file. The main function will ask the user to enter the length, horsepower, and color of arn automobile. You do not need to do any input validation i.e. you carn assume that the user always enters a valid integer for automobile's length and horsepower and a valid string for the automobile's color. Using the information entered by the user, you must create an instance of the Automobile class and use the get_worth method in the class to print the worth of the automobile. The output of your program must closely match the given output sample: Sample Run Enter automobile's length in meters: 3 Enter automobile's horsepower: 200 Enter automobile s color: wh1te This automobile is worth $6000. Another sample run Enter automobile's length in meters: 5 Enter automobile's horsepower: 700 Enter automobile's color: red This automobile is worth $105000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
