Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the Class diagram or structure of this question: Suppose that we have many kind of vehicles: Car, Moto, Truck, and Bicycle . These vehicles share

the Class diagram or structure of this question:

Suppose that we have many kind of vehicles: Car, Moto, Truck, and Bicycle. These vehicles share the characteristics: Color, Make, Model, Year, Price, and NumberOfPassengers. The Car and Truck have additional attributes: Engine, NumberOfDoors and VIN (Vehicle Identification). The Moto has additional attributes: Engine and VIN (Vehicle Identification). The Bicycle has an additional attribute: BicycleType (RoadBicycle or MountainBicycle) using an enumeration.

  1. Define the hierarchy of products (vehicles).
  2. Use the factory method pattern to create the different vehicles.
  3. Define the abstract factory pattern associated to the vehicle creation. In this part, you need to create a factory for each kind of vehicles.
  4. For the Car, we specialize by creating subclasses for the different kind of cars (SportsCar, LuxuryCar). We define a decorator to add some accessories to the car: MusicSystem, SunRoof, TouchScreen
  5. Define a single class VehicleShop representing a shop for selling and buying vehicles. A unique instance can be created for this shop.
  6. Define the main class to instantiate the VehicleShop and the other classes to test them.

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_2

Step: 3

blur-text-image_3

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

State the importance of control

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Question Can life insurance be used in a Keogh (HR 10) plan?

Answered: 1 week ago