/** * The computer picks heads (true) or tails (false). The user guesses. */ import java.util.Scanner; public class MindReader { public static void main(String[] args) { Boolean computerChoice; // true means heads Boolean userChoice; // true means heads computerChoice = Math.random() < .5; // print out computers's choice /* if ( ) System.out.println("The computer chose heads."); else System.out.println("The computer chose tails."); */ Scanner in = new Scanner(System.in); System.out.println("What do you believe the computer chose?: heads or tails (h/t): "); String userInput = in.next(); // Set userChoice depending on user input /* if ( ) { userChoice = true; } else { userChoice = false; } /* // print out user's choice /* if ( ) System.out.println("You chose heads."); else System.out.println("You chose tails."); */ // print out whether the user guessed correctly or not. /* if ( ) { System.out.println("You are correct - CONGRATULATIONS!"); } else { System.out.println("Sorry, you are wrong. Better luck next time."); } */ } }