/**
 * ChatbotApp - Main chatbot application for the final project
 *
 * Part of Part III of the book "Introduction to Programming in Java"
 *
 * To run: java -cp .;../../lib/sqlite-jdbc-*.jar chatbot.ChatbotApp
 */

package chatbot;

import java.util.Scanner;

/**
 * Main entry point for the chatbot application.
 */
public class ChatbotApp {

    public static void main(String[] args) {
        ChatbotController controller = new ChatbotController();
        Scanner scanner = new Scanner(System.in);

        System.out.println("========================================");
        System.out.println("       Advanced TutorJavaBot");
        System.out.println("========================================");
        System.out.println();
        System.out.println("Type 'exit' to quit.");
        System.out.println("Type 'help' to see available options.");
        System.out.println();

        while (true) {
            System.out.print("User: ");
            String input = scanner.nextLine();

            if (input.equalsIgnoreCase("exit")) {
                System.out.println("Bot: Goodbye!");
                break;
            }

            String response = controller.handleMessage(input);
            System.out.println("Bot: " + response);
            System.out.println();
        }

        scanner.close();
    }
}
