-
Notifications
You must be signed in to change notification settings - Fork 0
/
DictionaryOrder.java
60 lines (51 loc) · 2.32 KB
/
DictionaryOrder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import java.util.Scanner;
public class DictionaryOrder {
public static void main( String[] args ) {
Scanner keyboard = new Scanner(System.in);
String name;
System.out.print( "Make up the name of a programming language! " );
name = keyboard.nextLine();
if ( name.compareToIgnoreCase("c++") < 0 )
System.out.println( name + " comes BEFORE c++" );
if ( name.compareToIgnoreCase("c++") == 0 )
System.out.println( "c++ isn't a made-up language!" );
if ( name.compareToIgnoreCase("c++") > 0 )
System.out.println( " comes AFTER c++" );
if ( name.compareToIgnoreCase("go") < 0 )
System.out.println( " comes BEFORE go" );
if ( name.compareToIgnoreCase("go") == 0 )
System.out.println( "go isn't a made-up language!" );
if ( name.compareToIgnoreCase("go") > 0 )
System.out.println( " comes AFTER go" );
if ( name.compareToIgnoreCase("java") < 0 )
System.out.println( " comes BEFORE java" );
if ( name.compareToIgnoreCase("java") == 0 )
System.out.println( "java isn't a made-up language!" );
if ( name.compareToIgnoreCase("java") > 0 )
System.out.println( " comes AFTER java" );
if ( name.compareToIgnoreCase("lisp") < 0 )
System.out.println( " comes BEFORE lisp" );
if ( name.compareToIgnoreCase("lisp") == 0 )
System.out.println( "lisp isn't a made-up language!" );
if ( name.compareToIgnoreCase("lisp") > 0 )
System.out.println( " comes AFTER lisp" );
if ( name.compareToIgnoreCase("python") < 0 )
System.out.println( " comes BEFORE python" );
if ( name.compareToIgnoreCase("python") == 0 )
System.out.println( "python isn't a made-up language!" );
if ( name.compareToIgnoreCase("python") > 0 )
System.out.println( " comes AFTER python" );
if ( name.compareToIgnoreCase("ruby") < 0 )
System.out.println( " comes BEFORE ruby" );
if ( name.compareToIgnoreCase("ruby") == 0 )
System.out.println( "ruby isn't a made-up language!" );
if ( name.compareToIgnoreCase("ruby") < 0 )
System.out.println( " comes AFTER ruby" );
if ( name.compareToIgnoreCase("visualbasic") < 0 )
System.out.println( " comes BEFORE visualbasic" );
if ( name.compareToIgnoreCase("visualbasic") == 0 )
System.out.println( "visualbasic isn't a made-up language!" );
if ( name.compareToIgnoreCase("visualbasic") < 0 )
System.out.println( " comes AFTER visualbasic" );
}
}