document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /**
  2.  * The responder class represents a response generator object.
  3.  * It is used to generate an automatic response to an input string.
  4.  *
  5.  * @author Naufaliando
  6.  * @version 1.0
  7.  */
  8. public class Responder
  9. {
  10.     /**
  11.      * Constructor for objects of class Responder
  12.      */
  13.     public Responder()
  14.     {  
  15.     }
  16.    
  17.     String response;
  18.     /**
  19.      * The responses to problems
  20.      */
  21.     public String generateResponse(String problem)
  22.     {
  23.         if(problem.contains("blue screen")){
  24.             response = "Please restart device if possible";  
  25.         }
  26.        
  27.         else if(problem.contains("keyboard")){
  28.             response = "Please restart device if possible";  
  29.         }
  30.        
  31.         else if(problem.contains("wifi")){
  32.             response = "Please check your modem or your laptop settings";  
  33.         }
  34.        
  35.         else if(problem.contains("location")){
  36.             response = "You can check our service center in gmaps";  
  37.         }
  38.        
  39.         else if(problem.contains("lagging")){
  40.             response = "Force stop your application if it\'s unnesessary";  
  41.         }
  42.        
  43.         else if(problem.contains("over heating")){
  44.             response = "Shut down your laptop and leave it for a while";  
  45.         }
  46.        
  47.         else{
  48.             response = "How can I help you?";  
  49.         }
  50.         return response;
  51.     }
  52. }
  53.  
');