01
Assignment Overview
In this assignment, you'll design and implement a complete object-oriented system. You'll create a class hierarchy for a Vehicle Management System that demonstrates all four pillars of OOP: Abstraction, Encapsulation, Inheritance, and Polymorphism.
Skills Applied: Classes & Objects (4.1), Inheritance (4.2), Polymorphism (4.3), and Encapsulation (4.4) from Module 4.
Classes
Design proper class structures with constructors
Inheritance
Create parent-child class relationships
Polymorphism
Override methods and use interfaces
Encapsulation
Hide data with access modifiers
02
Requirements
Part 1: Abstract Base Class (30 points)
- Create an abstract
Vehicleclass with common properties - Include: make, model, year, price, fuelType
- Define abstract methods:
startEngine(),calculateFuelEfficiency() - Implement proper constructors and encapsulation
Part 2: Concrete Classes (35 points)
- Create
Carclass extending Vehicle (add: numDoors, trunkCapacity) - Create
Motorcycleclass extending Vehicle (add: engineCC, hasABS) - Create
Truckclass extending Vehicle (add: payloadCapacity, numAxles) - Implement all abstract methods appropriately for each type
Part 3: Interfaces (30 points)
- Create
Rentableinterface with methods:calculateRentalCost(int days),isAvailable() - Create
Serviceableinterface with methods:scheduleService(),getServiceHistory() - Implement interfaces in appropriate vehicle classes
- Demonstrate interface polymorphism
Part 4: Demonstration (30 points)
- Create a
VehicleManagerclass with an array of vehicles - Demonstrate polymorphism by iterating through different vehicle types
- Show interface usage with rental and service operations
- Include a main method with comprehensive testing
03
Submission Guidelines
Folder Structure: Submit all files in a folder named
assignment4_yourname
Required Files:
Vehicle.java- Abstract base classCar.java,Motorcycle.java,Truck.javaRentable.java,Serviceable.java- InterfacesVehicleManager.javaMain.java- Test programUML_Diagram.png/pdf- Class diagramREADME.txt
Ready to submit? Include a UML diagram of your class hierarchy!
Submit Now
04
Grading Rubric
| Criteria | Points | Description |
|---|---|---|
| Abstract Base Class | 30 | Proper abstraction with abstract methods |
| Concrete Classes | 35 | Correct inheritance and method implementation |
| Interfaces | 30 | Proper interface design and implementation |
| Demonstration | 30 | Polymorphism demonstrated effectively |
| Total | 125 |