Assignment02 (SP24 BSE 047)
Assignment02 (SP24 BSE 047)
ASSIGNMENT 02
Reg-no: - SP24-BSE-047
Question No.01:
CUSTOMER
- name: String
- contactInfo: String
- paymentDetails: String
- reservations: Reservation[]
+ searchRooms()
+ makeReservation()
+ cancelReservation()
+ modifyReservation()
+ checkInOnline()
1
1
MAN
Y
HOTEL RESERVATION
- name: String
- reservationDate: localDate
- location: String
- checkInDate: localDate
- rooms: Room[]
- checkOutDate: localDate
- totalCost: double
+ addRoom() + calculateTotalCost()
+ removeRoom() + getDurationOfStay()
+ getAvailableRooms() + cancel()
+ updateRoomDetails() + modify()
+ generateInvoice()
1
MAN
1
Y
ROOM
- roomNumber: String
- type: String
- ratePerNight: double
- isAvailable: boolean
+ markAsAvailable()
+ markAsOccupied()
+ CheckAvailablity()
Question No.02: DEALER
- Customers: Customer[]
CUSTOMER
- person: Person
- vehicle: Vehicle
+ getperson(): Person
+ getVehicle(): Vehicle
+ printCustomerInfo(): void
VEHICLE PERSON
- make: String - name: String
- model: String - age: int
- year: int - address: String
- price: double
+ getName(): String
+ getMake(): String
+ getAge(): int
+ getPrice(): double
+ displayDetails(): void
CAR
- numDoors: int
- numPassengers: int
+ getNumDooors(): int
+ isFamilyCar(): boolean
Code
class Vehicle {
private String make;
private String model;
private int year;
private double price;
public Car(String make, String model, int year, double price, int
numDoors, int numPassengers) {
super(make, model, year, price);
this.numDoors = numDoors;
this.numPassengers = numPassengers;
}