Write a program that asks for the user's name and then writes that name to the monitor with either "Ms." or "Mr." in front, depending if the name is for a female or male. Assume that the only female names are
- Amy
- Buffy
- Cathy
and that the only male names are
- Elroy
- Fred
- Graham
All other names will be echoed without a title. The program continutes looping until the user hits "enter" without first typing a name.
C:\>java Title Enter a name: Amy Johnson Ms. Amy Johnson Enter a name: Fred Smith Mr. Fred Smith Enter a name: Zoltan Jones Zoltan Jones Enter a name:(this exercise comes from http://chortle.ccsu.edu/cs151/cs151java.html)