Assignment #51
Code
/// Gian Adoremos
/// Period: 7
/// Program Name: FiftyFirst Program
/// File Name: AlphabeticalOrder.java
/// Date Finished: 11/19/2015
import java.util.Scanner;
public class AlphabeticalOrder
{
public static void main(String[] args)
{
String name;
Scanner keyboard = new Scanner(System.in);
System.out.print("What's your last name? ");
name = keyboard.next();
if (name.compareTo("Carson") <= 0)
System.out.println("We'll get to you soon, " + name + ".");
else if (name.compareTo("Jamestown") <= 0)
System.out.println("We'll get to you pretty soon, " + name + ".");
else if (name.compareTo("Schmuck") <= 0)
System.out.println("You're going to wait a bit, " + name + ".");
else if (name.compareTo("Yi") <= 0)
System.out.println("You're probalby never going to make it, " + name + ".");
else
System.out.println("Just give up, " + name + "?");
}
}
Picture of the output