Technical Support System

     Untuk projek yang saya lakukan untuk sekarang adalah membuat sebuah program yang dapat menjadi techinal support system, program ini bertujuan untuk membantu mengatasi sebuah client yang mengalami suatu kendala dalam sistem dari aplikasi tersebut. Tipe techincal support yang saya buat ini merupakan chatbot.

Diagram Class :



Source Code

SupportSystem.java

public class SupportSystem
{
private InputReader reader;
private Responder responder;
public SupportSystem(){
reader = new InputReader();
responder = new Responder();
}
public void start(){
boolean finished = false;
printWelcome();
while(!finished){
String input = reader.getInput();
if(input.startsWith("finish")) {
finished = true;
}
else if(input.indexOf("bug")!=-1) {
String response = responder.generateResponse1();
System.out.println(response);
}
else if(input.indexOf("connection")!=-1) {
String response = responder.generateResponse2();
System.out.println(response);
}
else if(input.indexOf("password")!=-1) {
String response = responder.generateResponse3();
System.out.println(response);
}
else if(input.indexOf("blue screen")!=-1) {
String response = responder.generateResponse4();
System.out.println(response);
}
else {
String response = responder.generateResponse5();
System.out.println(response);
}
}
printGoodbye();
}
private void printWelcome()
{
System.out.println( "Welcome!");
System.out.println();
System.out.println("We are gonna help you to solve your problems.");
System.out.println("What's the issue?");
System.out.println("Type 'finish' to close this system.");
}
private void printGoodbye() {
System.out.println("Terima kasih telah telah menggunakan tech support kami.");
}
}
view raw gistfile1.txt hosted with ❤ by GitHub
Responder.java
import java.util.*;
public class InputReader
{
String kata;
public String getInput()
{
Scanner sc = new Scanner(System.in);
kata = sc.nextLine();
return kata;
}
}
view raw gistfile1.txt hosted with ❤ by GitHub
InputReader.java
import java.util.*;
public class InputReader
{
String kata;
public String getInput()
{
Scanner sc = new Scanner(System.in);
kata = sc.nextLine();
return kata;
}
}
view raw gistfile1.txt hosted with ❤ by GitHub


Output



Comments

Popular Posts