commit again

This commit is contained in:
2026-09-24 09:17:22 +09:00
parent ea4435babe
commit 22821c879c
7 changed files with 131 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,19 @@
package hotelReservation;
public class DeluxeRoom extends Room {
private int serviceFees;
public DeluxeRoom (int roomNumber,int serviceFees) {
super (roomNumber,6990); //make service fees for Deluxe romm
this.serviceFees = serviceFees;
}
@Override
public double calculateTotal (int nights) {
return (pricePerNight*nights)+serviceFees;
}
@Override
public String getRoomInfo() {
return "Delixe Room Number" +roomNumber+ "includeing Service Fees";
}
}

View File

@@ -0,0 +1,16 @@
package hotelReservation;
import javax.swing.JFrame;
public class Reception {
public static void main(String[] args) {
// To Male Frame In GUI
JFrame frame = new JFrame("Booking Here");
frame.setSize(500, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(null);
frame.setVisible(true);
}
}

View File

@@ -0,0 +1,29 @@
package hotelReservation;
public class Reservation {
private String guestName;
private Room room;
private String checkInDay;
private int nights;
public Reservation(String gustName, Room room, String checkInDay, int nights) {
this.guestName = gustName;
this.room = room;
this.checkInDay = checkInDay;
this.nights = nights;
}
// Detail of Booking information (so se should be make new object {totalCost}
// from room calculate **from override
public String getReservationDetails() {
double totalCost = room.calculateTotal(nights);
return "===== BOOKIN DETAILS =====\n" +
"GUEST NAME :" + guestName + "\n" +
"CHECKIN DATE :" + checkInDay + "\n" +
room.getRoomInfo() + "\n" +
"STAY:" + nights + " night\n" +
"TOTAL AMMOUNT :" + totalCost + "Yen\n";
}
}

View File

@@ -0,0 +1,20 @@
package hotelReservation;
public class Room {
protected int roomNumber;
protected int pricePerNight;
// Constructor
public Room (int roomNumber,int pricePreNight) {
this.roomNumber= roomNumber;
this.pricePerNight = pricePreNight;
}
//1 ammount for every room
public double calculateTotal (int nights) { //this method will be override in otherclass
return pricePerNight*nights;
}
//Show Info for firt time
public String getRoomInfo() { //this method will be override in otherclass
return "Room Number"+ roomNumber+"Per Night"+pricePerNight;
}
}

View File

@@ -0,0 +1,9 @@
package hotelReservation;
public class StandardRoom extends Room {
public StandardRoom(int roomNumber) {
super(roomNumber,1450); //make stsndar Room price for per nigh
}
}