Assignment 51

code

///Mutsu Osoegawa
///Period: 7
///Project Name: Alphabetical Order
///File Name: AlphabeticalOrder.java
///Date: 11/2/2015

import java.util.Scanner;
public class AlphabeticalOrder
{
    public static void main( String[] args )
    {
        String lastName;
        int a, b, c, d;
        Scanner keyboard = new Scanner(System.in);
        System.out.print( "What's your last name? " );
        lastName = keyboard.next();
        a = lastName.compareTo("Carswell");
        if ( a <= 0 )
        {
            System.out.println( "You don't have to wait long " + lastName + "." );
        }
        else if ( a > 0 )
        {
            b = lastName.compareTo("Jones");
        if ( b <= 0 )
        {
            System.out.println( "That's not bad " + lastName + "." );
        }
        else if ( b > 0 )
        {
            c = lastName.compareTo("Smith");
        if ( c <= 0 )
        {
            System.out.println( "Looks like a bit of a wait " + lastName + "." );
        }
        else if ( c > 0 )
        {
            d = lastName.compareTo("Young");
        if ( d <= 0 )
        {
            System.out.println( "It's going to be a while " + lastName + "." );
        }
        else if ( d > 0 )
        {
            System.out.println( "Notgoing anywhere for a while " + lastName + "." );
        }
        }}}
    }
}