Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
Python Object Oriented Programming Assignment

1. Vehicle

Write Object Oriented Python code for the following:

1. Vehicle:

a) Write a Python class to represent a Vehicle which includes make string, model string, 17 character VIN, vehicle type (small, medium, large), and 4 digit year. Vehicle object cannot exist without these values. There should be __str__ method to return formatted string with all values.

b) Write test code to create an instance of Vehicle and print the values of the attributes to the console.

2. VehicleReservation:

a) Write a Python class to represent a vehicle reservation which stores reservation id, pickup date, drop off date, Vehicle object (from earlier exercise), rate per day (vehicle type: small=$29.99, medium=$39.99, large=$49.99), and total price per reservation. When vehicle reservation instance is created, it must be provided with id, pickup date, drop off date, and Vehicle object. The constructor must assign the values to all the instance attributes. There should be functionality to change the dates and Vehicle object and obtain the price per reservation. The reservation price cannot be changed by the user. There should be __str__ method to return formatted string with all values.

b) Write test code to create an instance of vehicle reservation; obtain and print reservation price; change drop off date and vehicle and obtain and print updated reservation price; and print all the values of the reservation. 

3. Account:

a) Write a Python class to represent an account which includes account id, mailing address, email, and a list of VehicleReservation objects. When Account instance is created, it must have id, mailing address, and email. Account should provide functionality to update email and mailing addresses, add reservation, delete reservation by id, get reservation object by id; and print all account data using __str__.

b) Write test code to create an instance of account; create reservation instance and add to the account; create another reservation instance and add to the account; print all the values of the account; delete one reservation using the reservation id; 

4. Reservation:

a) Write a Python class to represent a generic reservation which includes start date, end date, reservation id, and reservation price; Reservation object cannot exist without all the values. Price cannot be changed by the user and needs to be calculated.

b) Write a Python class to represent hotel reservation which inherits from reservation class. In addition it stores room type single or double and the value must be assigned at creation time. Reservation price is calculated as number of days times rate per room. Single room rate is $100 and double is $125. When hotel reservation instance is created, it must be provided with id, start date, end date, and room type. The constructor must assign the values to all the instance attributes. There should be functionality to change the dates and room type (methods must automatically update the corresponding attributes) and obtain the price per reservation. Constructor and methods must made sure that end date is at minimum one day after start date. The id, rate, and reservation price cannot be changed by the user. There should also be functionality to display all the values of the reservation.

c) Copy VehicleReservation (from earlier exercise) call it VehicleReservation2 class and change it to inherit from Reservation.

d) Copy and modify Account’s test code to add vehicle reservation and then hotel reservation all else being the same

support
close