Advertisement
veronikaaa86

06. Speed Info

Jul 9th, 2022
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 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. String textResult = "";
  12. if (speed <= 10) {
  13. textResult = "slow";
  14. } else if (speed <= 50) {
  15. textResult = "average";
  16. } else if (speed <= 150) {
  17. textResult = "fast";
  18. } else if (speed <= 1000) {
  19. textResult = "ultra fast";
  20. } else {
  21. textResult = "extremely fast";
  22. }
  23.  
  24. System.out.println(textResult);
  25. }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement