Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Personal {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- String gender = scan.nextLine();
- double years = Double.parseDouble(scan.nextLine());
- if ("m".equals(gender)) {
- if (years >= 16) {
- System.out.println("Mr.");
- } else {
- System.out.println("Master");
- }
- }
- if ("f".equals("Ms.")) {
- if (years >= 16) {
- System.out.println("Ms.");
- } else {
- System.out.println("Miss");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement