Advertisement
cgorrillaha

MagpieRunner2

Oct 14th, 2021
771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /**
  4.  * A simple class to run the Magpie class.
  5.  * @author Laurie White
  6.  * @version April 2012
  7.  */
  8. public class MagpieRunner2
  9. {
  10.  
  11.     /**
  12.      * Create a Magpie, give it user input, and print its replies.
  13.      */
  14.     public static void main(String[] args)
  15.     {
  16.         Magpie2 maggie = new Magpie2();
  17.        
  18.         System.out.println (maggie.getGreeting());
  19.         Scanner in = new Scanner (System.in);
  20.         String statement = in.nextLine();
  21.        
  22.         while (!statement.equals("Bye"))
  23.         {
  24.             System.out.println (maggie.getResponse(statement));
  25.             statement = in.nextLine();
  26.         }
  27.     }
  28.  
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement