Assignemnt #51
Code
/// Name: Connor Siri
/// Period: 7
/// Program Name: Order
/// File Name: Order.java
/// Date Finished: 10/21/2015
import java.util.Scanner;
class Order{
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
String ln;
System.out.print("What's your last name? ");
ln = keyboard.next();
if (ln.compareTo("Carswell") <= 0)
{
System.out.println("You don't have to wait long.");
}
else if (ln.compareTo("Carewell") > 0 && ln.compareTo("Jones") <= 0)
{
System.out.println("That's not bad");
}
else if (ln.compareTo("Jones") > 0 && ln.compareTo("Smith") <= 0)
{
System.out.println("Looks like a bit of a wait");
}
else if (ln.compareTo("Smith") > 0 && ln.compareTo("Young") <= 0)
{
System.out.println("It's gonna be a while");
}
else
{
System.out.println("Not going anywhere for a while");
}
}
}
Picture of the output