aneliabogeva

Fruit or Vegetables

Nov 10th, 2020
45
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. import java.util.function.DoubleBinaryOperator;
  3.  
  4. public class BiggerNumber {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7. String product = scanner.nextLine();
  8.  
  9. switch (product){
  10. case "banana":
  11. case "apple":
  12. case "kiwi":
  13. case "cherry":
  14. case "lemon":
  15. case "grapes":
  16. System.out.println("fruit");
  17. break;
  18. case "tomato":
  19. case "cucumber":
  20. case "pepper":
  21. case "carrot":
  22. System.out.println("vegetable");
  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.

×