Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the following code, the user is supposed to enter the gender (M for male, F for female and X for do not wish to
In the following code, the user is supposed to enter the gender (M for male, F for female and X for do not wish to enter). The code will then print whether the person is male or female or did not prefer to answer
Note: to check equality in character, you use a single quotation instead of double. ('A', 'a', 'b')
char gender = scan._______ ().charAt(0); |
String result; |
if ( _______ == _______ ){ |
_________ = "You are Male"; |
}else if (_________ ==________ ){ |
__________ = "You are Female"; |
}else{ |
___________ = "you did not mention your gender; |
} |
System.out.println("Gender : " +__________ ); Fill in the blanks to the incomplete program. |
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