Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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(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 entryStep 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