Advertisement
Vladkoheca

main.java

Jan 10th, 2025 (edited)
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.37 KB | Source Code | 0 0
  1. public class Main {
  2.     public static void main(String[] args) {
  3.  
  4.         Room room = new Room(320, 200);
  5.         Receptionist receptionist = new Receptionist("Iliqn", "night shift");
  6.  
  7.         System.out.println();
  8.  
  9.         System.out.println("The sum of the price from all nights is: " + room.calculateTotalCost(5));
  10.  
  11.         System.out.println("The room number is: " + room.getRoomNumber() + "\nThe price per night is: " + room.getPricePerNight());
  12.  
  13.         System.out.println();
  14.  
  15.         room.setRoomNumber(321);
  16.         room.setPricePerNight(180);
  17.  
  18.         System.out.println("The new room number is: " + room.getRoomNumber());
  19.         System.out.println("The new price per night is: " + room.getPricePerNight());
  20.  
  21.         System.out.println();
  22.  
  23.         System.out.println("The new sum of the price from all nights is: " + room.calculateTotalCost(5));
  24.  
  25.         System.out.println();
  26.  
  27.         System.out.println("The name of the receptionist is: " + receptionist.getName() + "\nHis shift is: " + receptionist.getShift());
  28.  
  29.         System.out.println();
  30.  
  31.         receptionist.setName("Ilko");
  32.         receptionist.setShift("day shift");
  33.  
  34.         System.out.println("The new name of the receptionist is: " + receptionist.getName());
  35.         System.out.println("His new shift is: " + receptionist.getShift());
  36.         System.out.println(receptionist.checkIn());
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement