Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object GetCapital extends App {
- val capitals = Map("US" -> "Washington", "Germany" -> "Berlin")
- if (args.length < 1) {
- println("You must specify a country to look for.")
- System.exit(1)
- }
- val country = args(0)
- if (capitals.contains(country))
- println("The capital of " + country + " is: " + capitals(country))
- else
- Console.err.println("The given country is not in our list")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement