Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class hotel {
  5.  
  6.  
  7.     public static void main(String[] args) {
  8.        
  9.  
  10.         Scanner input = new Scanner (System.in);
  11.         room lolObject = new room ();
  12.  
  13.        
  14.         System.out.println("Hello");
  15.         System.out.println("How many people are in your party? ");
  16.         String name = input.nextLine();
  17.        
  18.         lolObject.simpleMessage(name);
  19.        
  20.  
  21.        
  22.     }
  23.  
  24. }
  25.  
  26.  
  27. -----------------------------------------------------------------------------------------------------------
  28.  
  29. public class room {
  30.     public void simpleMessage(String name){
  31.  
  32.     if (name.equals("2")) {
  33.     System.out.println("We do not have any rooms that are for 2 people");
  34.     }
  35.     else{ System.out.println("We have space for you");
  36.     }
  37.    
  38.  
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement