Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the Python code that would create an instance of your Vehicle class (as if you were using the Python interpreter.) Call your Vehicle myCar.

Write the Python code that would create an instance of your Vehicle class (as if you were using the Python interpreter.) Call your Vehicle myCar. Its VIN should be CSIT104

Write the Python code that would set the mileage of your variable myCar to 1908. (Hint: use the method you created called setMileage.)

image text in transcribed

# python3 code # please refer to screenshot and take care if indentations class Vehicle: # class constructor which sets VIN and sets mileage to 0 def _init_(self, VIN) selfVIN VIN self.mileage0 # method that sets mileage of vehicle def setMileage(self, mileage) self.mileage mileage vehicle Vehicle"UP98TY") vehicle.setMileage(23) print ("Vehicle ldentification Number: ", vehicle.VIN) print ("Vehicle mileage: ", vehicle.mileage) che00 ?? cheas sh main. ??? input txt # python3 code # please refer to screenshot and take care if indentations 5 class Vehicle: # class constructor which sets VIN and sets mileage to ? def init(self, VIN): self.VIN VIN self.mileage ubuntu@ayushv: /Desktop/codes/cheggsolution python3 e-py ubuntu ayushv: Vehicle Identification Number: UP9STY Vehicle mileage: 23 ubuntu ayushvsDesktop/c 16 # method that sets mileage of vehicle def setMileage(self, mileage): hoggsolutLos 12 13 self.mileage nileage 16 vehicle Vehicle("UP98TY") 17 vehicle.setMileage (23) 18 19 print ("Vehicle Identification Number: ", vehicle.VIN) 28 print ("Vehicle mileage: ", vehicle.mileage)

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions