aneliabogeva

Personal Titles

Nov 10th, 2020
47
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class BiggerNumber {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. double age = Double.parseDouble(scanner.nextLine());
  7. String gender = scanner.nextLine();
  8.  
  9. switch (gender) {
  10. case "m":
  11. if(age < 16){
  12. System.out.println("Master");
  13. }
  14. else{
  15. System.out.println("Mr.");}
  16. break;
  17. case "f":
  18. if(age < 16){
  19. System.out.println("Miss");
  20. }
  21. else{
  22. System.out.println("Ms.");}
  23. break;
  24. default:
  25. System.out.println("unknown");
  26. }
  27. }
  28. }
  29.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×