Advertisement
Spocoman

09. Weather Forecast

Aug 20th, 2024
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. import java.util.Objects;
  2. import java.util.Scanner;
  3.  
  4. public class WeatherForecast {
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.         String weather = scanner.nextLine();
  8.  
  9.         if (Objects.equals(weather, "sunny")) {
  10.             System.out.println("It's warm outside!");
  11.         } else {
  12.             System.out.println("It's cold outside!");
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement