/* An if - else example. A program to advise you if you need an umbrella. */ import java.util.Scanner; class Advisor { public static void main(String[] args) { Scanner scan = new Scanner (System.in); String reply; System.out.print ("Is it raining outside? (yes/no) "); reply = scan.nextLine(); if (reply.equals("yes")) System.out.println ("Do not forget your umbrella."); else System.out.println ("You do not need an umbrella for now."); } }