Advertisement
joseleonweb

Untitled

Aug 21st, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Termostat {
  4.  
  5.   public static final double LIMIT = 21.0;
  6.  
  7.   public static void main (String[] args) {
  8.     Scanner lector = new Scanner(System.in);
  9.  
  10.     System.out.print("Quina temperatura fa? ");
  11.     double temperatura = lector.nextDouble();
  12.     lector.nextLine();
  13.  
  14.     if (temperatura >= LIMIT) {
  15.       System.out.println("Activa l'aire condicionat.");
  16.     } else {
  17.       System.out.println("Atura l'aire condicionat.");
  18.     }
  19.   }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement