Question: Write a python code and class diagram for the following Car Dealership The ordering system of XYZ Car Dealership needs to be updated, and they
Write a python code and class diagram for the following Car Dealership The ordering system of XYZ Car Dealership needs to be updated, and they want you to help. Sedans, trucks, SUVs, and minivans are the four different vehicle types sold by this dealership. The dealer should have the dealer's name, address and a list of vehicles. Each vehicle has basic information like model, base price, color, model year. Besides, you are required to add at least two additional attributes to each type of vehicle as each type has its own additional information. For example, SUV should have roof-rack type, and truck should have cargo bed size etc. You can assume that the base prices for each of these four types of vehicles are fixed; $30,000 for sedans, $35,000 for trucks, $40,000 for SUVs and $45,000 for minivans. Additionally, there are several options for every type of vehicle, including enhanced safety features ($3,000), security ($1,000), entertainment $(2,000), and sunroofs ($2,500). Since each car can have zero or more options installed, a single vehicle can even have the same option (like a sunroof) added twice. The cost of the base version plus the cost of any installed options must be precisely calculated by the program. Additionally, the car dealership keeps a stock of vehicles with preconfigured options so inventory management features should be provided. Other Object-oriented programming requirements: Create a class diagram that shows the main classes in your design along with their relationships. Draw it using the DrawIO Visual Studio Code extension. Inheritance should be used when one class is kind of another. In cases when one class is part of another, use aggregation or composition. Pick appropriate access modifiers like private, protected, and public. Add getters and setters wherever they are required. Add iterators when objects attributes are mutable such as dictionaries and lists. Include standard basic algorithms in the class for adding a new, removing an existing vehicle, searching for a vehicle according to a given specification, and printing a list of available vehicles. Let the user search the dealer's inventory to find the most and least expensive vehicle. Allow users to create the vehicles of their wishes with the desired options and calculate the final price.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
