Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- public static void main(String args[]) {
- double minHot = 26.00;
- double maxHot = 35.00;
- double minWarm = 20.1;
- double maxWarm = 25.9;
- double minMild = 15.00;
- double maxMild = 20.00;
- double minCool = 12.00;
- double maxCool = 14.9;
- double minCold = 5.00;
- double maxCold = 11.9;
- java.util.Scanner scanner = new java.util.Scanner(System.in);
- double input = Double.parseDouble(scanner.nextLine());
- if (input >= minHot && input <= maxHot) {
- System.out.println("Hot");
- }
- else if (input >= minWarm && input <= maxWarm) {
- System.out.println("Warm");
- }
- else if (input >= minMild && input <= maxMild) {
- System.out.println("Mild");
- }
- else if (input >= minCool && input <= maxCool) {
- System.out.println("Cool");
- }
- else if (input >= minCold && input <= maxCold) {
- System.out.println("Cold");
- } else {
- System.out.println("Unknown");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement