AlphaBet

Code

import java.util.Scanner;

public class AlphaBet
{
	public static void main( String[] args )
	{
        Scanner keyboard = new Scanner(System.in);
        
        String aaa;
        int time1, time2, time3, time4, time5;
        String name1 = "Carswell";
        String name2 = "Jones";
        String name3 = "Smith";
        String name4 = "Young";
        String name5 = "Young";
        System.out.println(" what is your last name " );
        aaa = keyboard.nextLine();
        time1 = (aaa.compareTo(name1) );
        time2 = (aaa.compareTo(name2) );
        time3 = (aaa.compareTo(name3) );
        time4 = (aaa.compareTo(name4) );
        time5 = (aaa.compareTo(name5) );
        
        if ( time1 <= 0 )
        {
            System.out.println ( " you won't have to wait long " + aaa );
        }
        else if ( time2 <= 0 )
        {
            System.out.println ( " thats not bad " + aaa);
        }
        else if ( time3 <= 0 )
        {
            System.out.println ( "Looks like a bit of a wait " + aaa );
        }
        else if ( time4 <= 0 )
        {
            System.out.println ( " its gonna be a while " + aaa );
        }
        else if ( time5 <= 0 )
        {
            System.out.println ( " not going anywhere for a while" + aaa );
        }
        
    }
}
     

AlphaBet

Assignment 51