veronikaaa86

06. Speed Info

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