Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Room {
- private int roomNumber;
- private double pricePerNight;
- public Room(int roomNumber, double pricePerNight) {
- this.roomNumber = roomNumber;
- this.pricePerNight = pricePerNight;
- }
- public double calculateTotalCost(int nights) {
- return (pricePerNight * nights);
- }
- public double getPricePerNight() {
- return pricePerNight;
- }
- public int getRoomNumber() {
- return roomNumber;
- }
- public void setPricePerNight(double pricePerNight) {
- this.pricePerNight = pricePerNight;
- }
- public void setRoomNumber(int roomNumber) {
- this.roomNumber = roomNumber;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement