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