+ 4
How do you go around this question?
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:
2 ответов
+ 4
You need to take a name from the user, and compare it to the male and female names and take appropriate actions.