fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Scanner kbReader = new Scanner (System.in);
  13. System.out.print("What is the weather today?");
  14. String theWeather = kbReader.nextLine();
  15. if(theWeather.equals ("Sunny"))
  16. {
  17. System.out.println("It's sunny outside.");
  18. }
  19. else if(theWeather.equals("Rainy"))
  20. {
  21. System.out.println("Use an umbrella");
  22. }
  23. else if(theWeather.equals("Snowy"))
  24. {
  25. System.out.println("It's snowy outside");
  26. }
  27. else if(theWeather.equals("Windy"))
  28. {
  29. System.out.println("It's windy outside");
  30. }
  31. }
  32. }
Success #stdin #stdout 0.11s 54608KB
stdin
Sunny
stdout
What is the weather today?It's sunny outside.