Assignemnt #51 - Alphabet

Code

    /// Name: Caelan Dorstad
    /// Period: 6
    /// Program Name: Alphabetical
    /// File Name: Alphabetical.java
    /// Date Finished: 10/29/2015
    
    import java.util.Scanner;
    
    public class Alphabetical{
        public static void main(String[] args){
            Scanner keyboard = new Scanner(System.in);
            
            String last;
            
            System.out.print("What's your last name?: ");
            last = keyboard.next();
            
            if (last.compareTo("Carswell")<=0){
                System.out.println("you don't have to wait long");
            }
            
            else if (last.compareTo("Jones")<=0){
                System.out.println("that's not bad");
            }
            
            else if (last.compareTo("Smith")<=0){
                System.out.println("looks like a bit of a wait");
            }
            
            else if (last.compareTo("Young")<=0){
                System.out.println("it's gonna be a while");
            }
            
            else {
                System.out.println("not going anywhere awhile?");
            }
        }
    }
    

Picture of the output

Assignment 39