/*********************************************************************** * Author: Eric Heim * Date Created: 5/31/2011 * Course: CS0007 * Description: Shows the functionality of the logical OR operator * by determining if we can play a baseball game ***********************************************************************/ import java.util.Scanner; public class LogicalOrOperator { public static void main(String[] args) { char raining, bothTeamsPresent; Scanner keyboard = new Scanner(System.in); System.out.print("Is it raining (Y or N)? "); raining = keyboard.nextLine().charAt(0); System.out.print("Are both teams present (Y or N)? "); bothTeamsPresent = keyboard.nextLine().charAt(0); if(raining == 'Y' || bothTeamsPresent == 'N') { System.out.println("We can't play..."); } else { System.out.println("Play ball!"); } } }