Assignment 51; RollCall
Code
// Donovan Rich
// Period 6
// Alphabetical Order
// RollCall.java
// 11/9/2015
import java.util.Scanner;
public class RollCall {
public static void main( String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.println( "What's your last name?" );
String lastName = keyboard.next();
if ( lastName.compareTo("Carswell") <= 0 )
{
System.out.println( "We'll be with your shortly." );
}
else if ( lastName.compareTo("Jones") <= 0 )
{
System.out.println( "This won't take too long." );
}
else if ( lastName.compareTo("Smith") <= 0 )
{
System.out.println( "This may be a while." );
}
else if ( lastName.compareTo("Young") <= 0 )
{
System.out.println( "I hope you didn't have plans." );
}
else
{
System.out.println( "Your bones will lie in the pyramid forever!" );
}
}
}
Picture of the output