Advertisement
psi_mmobile

Untitled

Apr 15th, 2022
889
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1. public class MyClass {
  2.     public static void main(String args[]) {
  3.         double minHot = 26.00;
  4.         double maxHot = 35.00;
  5.        
  6.         double minWarm = 20.1;
  7.         double maxWarm = 25.9;
  8.        
  9.         double minMild = 15.00;
  10.         double maxMild = 20.00;
  11.        
  12.         double minCool = 12.00;
  13.         double maxCool = 14.9;
  14.        
  15.         double minCold = 5.00;
  16.         double maxCold = 11.9;
  17.        
  18.         java.util.Scanner scanner = new java.util.Scanner(System.in);
  19.        
  20.         double input = Double.parseDouble(scanner.nextLine());
  21.        
  22.         if (input >= minHot && input <= maxHot) {
  23.             System.out.println("Hot");
  24.         }
  25.        else if (input >= minWarm && input <= maxWarm) {
  26.             System.out.println("Warm");
  27.         }
  28.         else if (input >= minMild && input <= maxMild) {
  29.             System.out.println("Mild");
  30.         }
  31.         else if (input >= minCool && input <= maxCool) {
  32.             System.out.println("Cool");
  33.         }
  34.         else if (input >= minCold && input <= maxCold) {
  35.             System.out.println("Cold");
  36.         } else {
  37.         System.out.println("Unknown");
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement