public class UserTerminalDialogExample { public static void main (String args[]) { String name; int age; double gpa; char grade; while (true) { //loop repeats indefinitely until user hits Enter // in response to name prompt //Prompt for name and respond name = SimpleIO.in.demandString("\nWhat's your name? (Or just hit Enter to quit)"); if (name.equals("")) break; // this is the only way to end the program gracefully SimpleIO.out.println("Hello, " + name + "!"); //Prompt for age and respond age = SimpleIO.in.demandInt("\nWhat's your age?"); SimpleIO.out.println("You're really " + age + " years old? You don't look it."); //Prompt for grade-point average and respond gpa = SimpleIO.in.demandDouble("\nWhat's your grade-point average?"); SimpleIO.out.println("Really? I've never met anyone with a " + gpa + " GPA before."); //Prompt for a letter grade and respond grade = SimpleIO.in.demandChar("\nWhat grade do you expect in this course?"); SimpleIO.out.println("Okay, I hope you're worthy of a " + grade + " grade."); } } }