Question
Using the GUI classes, rather than Scanner....Make a program which displays an appropriate name for a person, using a combination of nested ifs and compound
Using the GUI classes, rather than Scanner....Make a program which displays an appropriate name for a person, using a combination of nested ifs and compound conditions. Ask the user for a gender, first name, last name and age.
If the person is female and 20 or over, ask if she is married. If so, display "Mrs." in front of her name. If not, display "Ms." in front of her name. If the female is under 20, display her first and last name.
If the person is male and 20 or over, display "Mr." in front of his name. Otherwise, display his first and last name.
Note that asking a person if they are married should only be done if they are female and 20 or older, which means you will have a single if and else nested inside one of your if statements.
can you add addtional stuff in there like joptionpane to make program presentable?
can someone help me plz?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started