Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Now, write the code to create Car and CarSeller class in below code editor. All data members of each class should be marked as *

Now, write the code to create Car and CarSeller class in below code editor. All data members of each class should be marked as **private**(a leading underscore in the name). Since they're private, if you need to access them from outside the class, you should do so via get or set methods.
**Car**
* init method - takes as parameters four values with which to initialize the Car: its color, make, model and fuel
* get and set methods for each of the data members: get_color(), get_make(), get_model(), get_fuel(), set_color(), set_make(), set_model() and set_fuel().
**CarSeller**
CarSeller object represents a person who owns a couple of cars that they would want to sell.
CarSeller object has three data members:
* name of the car seller
* a list of car objects owned by the car seller
* location of the car seller
* add_car: takes a car object and adds the car to the list of cars owned by the CarSeller
*get_car_by_model takes the model name of the car and returns a list of car objects that are of the given model owned by the Car Seller
*paint_car takes model, make and new_color as parameters and updates all the cars owned by the Car Seller to new_color

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions