desislava_topuzakova

03. Speed Info

Oct 11th, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SpeedInfo_03 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner (System.in);
  6.         //1. прочитаме скоростта -> double
  7.         //2. проверка за скоростта
  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. }
Add Comment
Please, Sign In to add comment