import java.util.Scanner;

/**
 * A simple order-taking app to demonstrate the "if" control
 *
 * @author Mark Young
 * @version 1.1 2014-09-08
 */
public class StringConditionals {

    /**
     * Run this program.
     *
     * @param args command lines arguments (ignored)
     */
    public static void main(String[] args) {
        // create variables
        Scanner kbd = new Scanner(System.in);
        String answer;
        double amount = 0.00;

        // welcome customer
        System.out.print("\n\n"
            + "Welcome to GreesieBurger!\n"
            + "-------------------------\n\n");
        
        // ask for sandwich order
        System.out.print("What sandwich would you like? ");
        answer = kbd.nextLine();
        System.out.println(answer.toUpperCase() + "!");
        System.out.println("(" + answer.toLowerCase() + ")");
        amount += 8.95;

        // ask if want fries
        System.out.print("Would you like fries with that? ");
        answer = kbd.next();
        kbd.nextLine();
        if (answer.startsWith("y")) {
            System.out.println("FRIES!");
            System.out.println("(fries)");
            amount += 1.99;
        }

        // ask for drink order
        System.out.print("What can I get you to drink? ");
        answer = kbd.nextLine();
        System.out.println(answer.toUpperCase() + "!");
        System.out.println("(" + answer.toLowerCase() + ")");
        amount += 0.99;

        // report back total amount owed
        System.out.print("\n"
            + "That'll be $" + amount + ".\n\n");
        System.out.println("Thank-you for eating at GreesieBurgers!\n");
    }
}

