document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import java.util.*;
  2. /**
  3.  * Class mengimplementasikan technical support system
  4.  * Class utama untuk memanggil class lainnya
  5.  * @author Ghifari Astaudi Ukumullah
  6.  * @version 0.1 (2020.11.16)
  7.  */
  8. public class SupportSystem
  9. {
  10.     private InputReader reader;
  11.     private Responder responder;
  12.     /*
  13.      * Creates a technical support system.
  14.      */
  15.     public SupportSystem(){
  16.         reader = new InputReader();
  17.         responder = new Responder();
  18.     }
  19.     /**
  20.      * Start the technical support system. This will print a
  21.      * welcome message and enter into a dialog with the user.
  22.      * until the user ends the dialogs.
  23.      */
  24.     public void start (){
  25.         boolean finished = false;
  26.        
  27.         printWelcome();
  28.         while (!finished) {
  29.             HashSet<String> input =  reader.getInput();
  30.             if (input.contains("bye")){
  31.                 finished = true;
  32.             }
  33.             else{
  34.                 String response = responder.generateResponse(input);
  35.                 System.out.println (response);
  36.             }
  37.         }
  38.         printGoodbye();
  39.     }
  40.     /**
  41.      * Print a welcome message to the screen.
  42.      */
  43.     public void printWelcome(){
  44.         System.out.println (
  45.             "Welcome to the Ghifari Technical Support System.");
  46.         System.out.println();
  47.         System.out.println ("Tolong beritahu masalah Anda");
  48.         System.out.println (
  49.             "Kami akan membantu masalah Anda.");
  50.         System.out.println (
  51.             "Tulis \'bye\' jika ingin mengakhiri");
  52.     }
  53.     /**
  54.      * Print a good-bye message to the screen.
  55.      */
  56.     public void printGoodbye(){
  57.         System.out.println ("Senang mengobrol dengan Anda. Bye...");
  58.     }
  59. }
  60.  
  61.  
');