Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class bgb
  4. {
  5.     public static void main(String[] args) {
  6.         Scanner console = new Scanner(System.in);
  7.  
  8.         double age = Double.parseDouble(console.nextLine());
  9.         String gender = console.nextLine();
  10.  
  11.         if (gender.equals("m") && age < 16) {
  12.             System.out.print("Master");
  13.         } else if (gender.equals("m") && age >= 16) {
  14.             System.out.print("Mr.");
  15.         } else if (gender.equals("f") && age < 16) {
  16.             System.out.print("Miss");
  17.         } else {
  18.             System.out.print("Ms.");
  19.         }
  20.     }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement