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