-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOrderTwoCities.java
More file actions
executable file
·28 lines (26 loc) · 961 Bytes
/
OrderTwoCities.java
File metadata and controls
executable file
·28 lines (26 loc) · 961 Bytes
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
/* */ package ch04;
/* */
/* */ import java.util.Scanner;
/* */
/* */ public class OrderTwoCities {
/* */ public static void main(String[] args) {
/* 7 */ Scanner input = new Scanner(System.in);
/* */
/* */
/* 10 */ System.out.print("Enter the first city: ");
/* 11 */ String city1 = input.nextLine();
/* 12 */ System.out.print("Enter the second city: ");
/* 13 */ String city2 = input.nextLine();
/* */
/* 15 */ if (city1.compareTo(city2) < 0) {
/* 16 */ System.out.println("The cities in alphabetical order are " + city1 + " " + city2);
/* */ } else {
/* */
/* 19 */ System.out.println("The cities in alphabetical order are " + city2 + " " + city1);
/* */ }
/* */ }
/* */ }
/* Location: /Volumes/TXS.128G/hope useful/practice/2020.jar!/ch04/OrderTwoCities.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/