Advertisement
veronikaaa86

03. Speed Info

Jun 13th, 2021
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. package conditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P03SpeedInfo {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. double speed = Double.parseDouble(scanner.nextLine());
  10.  
  11. String result = "";
  12. if (speed <= 10){
  13. result = "slow";
  14. } else if (speed <= 50) {
  15. result = "average";
  16. } else if (speed <= 150) {
  17. result = "fast";
  18. } else if (speed <= 1000) {
  19. result = "ultra fast";
  20. } else {
  21. result = "extremely fast";
  22. }
  23.  
  24. System.out.println(result);
  25. }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement