Advertisement
bobo_bobkata

Untitled

Nov 27th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. package ConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class edno {
  6.  
  7. public static void main(String[] args) {
  8. Scanner scanner = new Scanner(System.in);
  9.  
  10. double age = Double.parseDouble(scanner.nextLine());
  11. String pol = scanner.nextLine();
  12. String mm = "m";
  13. String ff = "f";
  14.  
  15. if(pol.equals(mm)){
  16. if(age<16){
  17. System.out.println("Master");
  18. }else{
  19. System.out.println("Mr.");
  20. }
  21. }if(pol.equals(ff)){
  22. if(age<16){
  23. System.out.println("Miss");
  24. }else{
  25. System.out.println("Ms.");
  26. }
  27. }
  28.  
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement