Question: java language ! Problem #1: (20 pts Write a method Military Service(char cint age) that takes two parameters, a character (F for female and M

java language ! Problem #1: (20 pts Write a method Military Service(charjava language !

Problem #1: (20 pts Write a method Military Service(char cint age) that takes two parameters, a character (F for female and M for male) and an age, then prints whether the person should serve in the military or not. If the age is 18 or above and the gender is M. the service is mandatory. Write a program that asks the user to enter the age and the gender then displays whcther the scrvice is mandatory or not. Sample Run 1: Enter the age of the user: 20 Enter the gender, F for female and M for male: M The person should serve in the military Sample Run 2: Enter the age of the user: 15 Enter the gender, F for female and M for male: M The person should not serve in the military Sample Run 3: Enter the age of the user: 23 Enter the gender, F for female and M for male: F The person should not serve in the military Sample Run 4: Enter the age of the user: 23 Enter the gender, F for female and M for male: G wrong entry

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!