import java.util.Scanner; /** * Write a description of class TestProgram here. * * @author (your name) * @version (a version number or a date) */ public class TestProgram { public static void main() { Scanner input = new Scanner(System.in); boolean ok = false; String choice = ""; do { System.out.print("Do you want coffee or tea? > "); choice = input.nextLine().toLowerCase(); ok = (choice.equals("coffee") || choice.equals("tea") ); if (!ok ) System.out.println("Sorry we aren't serving " + choice); } while ( !ok ); System.out.println("Your " + choice + " is ready."); } }