reset password
Author Message
gchan10
Posts: 27
Posted 13:58 Apr 25, 2016 |

For number 3 do we assume that the user inputs three different cities?

aalva190
Posts: 64
Posted 14:01 Apr 25, 2016 |

Yes, the user must be able to enter 3 cities. And then you alphabetically order them.

gchan10
Posts: 27
Posted 14:03 Apr 25, 2016 |

But what if the user inputs two cities that are the same? Do we assume that this can happen?

aalva190
Posts: 64
Posted 14:07 Apr 25, 2016 |

You might either have to specify each time you ask, or let the user enter as you believe the user will enter it, just make sure you code something that will allow you to do that. I do recomend to specify before anything, so your code does not get any errors. 

Recall that you use: next (); for strings for single words, and nextLine (); for strings as well , but if you believe that user might enter more then one word, then use nextLine ();.

rcamach7
Posts: 31
Posted 14:09 Apr 25, 2016 |

There wasn't any specifications on that so I believe as long as they're grouped together alphabetically there shouldn't be a problem.

aalva190
Posts: 64
Posted 14:13 Apr 25, 2016 |

Yeah, just assume the user Enters one city, (hits enter) second city, (hits enter) and third city (hits enter)... Hopefully that clarifies lol. 

kknaur
Posts: 540
Posted 15:14 Apr 25, 2016 |

Two or more cities could be the same, but it should still work.