Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner (System.in);
- double age = scanner.nextDouble();
- String gen = scanner.nextLine();
- switch (gen){
- case "m":
- if (age >= 16) {
- System.out.println("Mr.");
- }else {
- System.out.println("Master");}
- break;
- case "f":
- if (age >= 16) {
- System.out.println("Ms.");
- }else {
- System.out.println("Miss");}
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement