Question: Please help me create this program in Java 7 or 8. No copy and paste from stackoverflow. I need an original program that I can
Please help me create this program in Java 7 or 8. No copy and paste from stackoverflow. I need an original program that I can study from with no errors in the IDE(eclipse neon). Thanks.
1. Asks the user for the names of 3 cities, separated by spaces. It is assumed that a given city name won't have spaces in it. So assume you won't have a city name like "San Antonio".
For example your program prints this: "Please input 3 city names separated by spaces in one line and press Enter."
The user then will type something like:
Houston Eugene Phoenix
and press Enter.
2. Your program then prints the 3 city names in alphabetical order. For example:
Eugene
Houston
Phoenix
The goal of this assignment is to get used to Strings in Java and how to compare those strings. Look for a string method that helps you compare two strings and use it's output to compare the 3 city names above. You may also need to use the if/else statement and maybe even the switch statement.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
