SHARE
TWEET

Untitled

a guest Jun 18th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class TemperatureChecker
  2. {
  3.     public void checkTemperature(int temperature)
  4.     {
  5.         if(temperature > 0)
  6.         {
  7.             System.out.println("Temperatura jest większa od 0");
  8.         }
  9.         else if(temperature == 0)
  10.         {
  11.             System.out.println("Temperatura jest równa 0");
  12.         }
  13.         else
  14.         {
  15.             System.out.println("Temperatura jest mniejsza od 0");
  16.         }
  17.     }
  18. }
  19.  
  20. public class Main
  21. {
  22.     public static void main(String[] args)
  23.     {
  24.         Scanner reader = new Scanner(System.in);
  25.         System.out.println("Enter a temperature: ");
  26.         int temperature = reader.nextInt();
  27.        
  28.         TemperatureChecker temperatureChecker = new TemperatureChecker();
  29.         temperatureChecker.checkTemperature(temperature;
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top