Assignemnt #50
Code
/// Name: Holden Ganch
/// Period: 7
/// Program Name: Fiftieth Program
/// File Name: Challenge.java
/// Date Finished: 11/7/2015
import java.util.Scanner;
class Challenge {
public static void main(String[] args) {
System.out.println("");
System.out.println("");
System.out.print("Comparing 'holden' with 'ryan' produces ");
System.out.println("holden".compareTo("ryan"));
System.out.println("");
System.out.print("Comparing 'happy' with 'sad' produces ");
System.out.println("happy".compareTo("sad"));
System.out.println("");
System.out.print("Comparing 'hamburger' with 'hot dog' produces ");
System.out.println("hamburger".compareTo("hot gog"));
System.out.println("");
System.out.print("Comparing 'mouse' with 'cat' produces ");
System.out.println("mouse".compareTo("cat"));
System.out.println("");
System.out.print("Comparing 'all' with 'none' produces ");
System.out.println("all".compareTo("none"));
System.out.println("");
System.out.println("");
System.out.print("Comparing 'red' with 'blue' produces ");
System.out.println("red".compareTo("blue"));
System.out.println("");
System.out.print("Comparing 'yes' with 'no' produces ");
System.out.println("yes".compareTo("no"));
System.out.println("");
System.out.print("Comparing 'good' with 'bad' produces ");
System.out.println("good".compareTo("bad"));
System.out.println("");
System.out.print("Compare 'opera' with 'rap' produces ");
System.out.println("opera".compareTo("rap"));
System.out.println("");
System.out.print("Compare 'hat' with 'hood' produces ");
System.out.println("hat".compareTo("hood"));
System.out.println("");
System.out.println("");
System.out.print("Comparing 'money' with 'money' produces ");
System.out.println("money".compareTo("money"));
System.out.println("");
System.out.print("Comparing 'birth' with 'birth' produces ");
System.out.println("birth".compareTo("birth"));
}
}
Picture of the output