OOP Assignment 6
OOP Assignment 6
Task Description:
TASK #2
Your task:
iii. In the main class, simulate the payment process by allowing the user
to choose a payment method and handle the exceptions gracefully
using try-catch blocks, prompting the user to retry if an exception is
thrown.
Task Description:
TASK #3
Task Description:
ii. Define two interfaces: Drivable with methods such as drive() and
stop(), and Loadable with methods such as loadCargo(int weight)
and unloadCargo().
iii. Implement classes Car, Bike, and Truck that implement the Drivable
interface. The Truck class should also implement the Loadable
interface. Each class should define its unique attributes and methods
while adhering to the interface contracts.
iv. Create main class in package mainpkg and implement all classes in
main class.