Assignemnt #59 and ThreeCardMonte Code /// Name: Yordan Rashkov /// Period: 7 /// Program Name: ThreeCardMonte /// File Name: ThreeCardMonte.java /// Date Finished: 11/28/2015 import java.util.Random; import java.util.Scanner; public class ThreeCardMonte { public static void main ( String[] args ) { Random r = new Random(); Scanner keyboard = new Scanner(System.in); int y, x = 1 + r.nextInt(3); System.out.println("There are three cards two are jacks and one is an ace"); System.out.println(""); System.out.println("Which one is it?"); System.out.println(""); System.out.println(" ## ## ##"); System.out.println(" ## ## ##"); System.out.println(" 1 2 3 " ); System.out.println(""); System.out.print("> "); y = keyboard.nextInt(); if ( x == 1 ) { if (y == x) { System.out.println("You nailed it! Fast Eddie reluctantly hands over your winnings, scowling."); System.out.println(""); System.out.println(" AA ## ## "); System.out.println(" AA ## ##"); System.out.println(" 1 2 3 "); System.out.println(""); } else { System.out.println("Ha! Fast Eddie wins again! The ace was card number 1."); System.out.println(""); System.out.println(" AA ## ## "); System.out.println(" AA ## ##"); System.out.println(" 1 2 3 "); System.out.println(""); } } else if ( x == 2 ) { if ( y == x ) { System.out.println("You nailed it! Fast Eddie reluctantly hands over your winnings, scowling."); System.out.println(""); System.out.println(" ## AA ## "); System.out.println(" ## AA ##"); System.out.println(" 1 2 3 "); System.out.println(""); } else { System.out.println("Ha! Fast Eddie wins again! The ace was card number 2."); System.out.println(""); System.out.println(" ## AA ## "); System.out.println(" ## AA ##"); System.out.println(" 1 2 3 "); System.out.println(""); } } else if ( x == 3 ) { if ( x == y ) { System.out.println("You nailed it! Fast Eddie reluctantly hands over your winnings, scowling."); System.out.println(""); System.out.println(" ## ## AA "); System.out.println(" ## ## AA"); System.out.println(" 1 2 3 "); System.out.println(""); } else { System.out.println("Ha! Fast Eddie wins again! The ace was card number 3."); System.out.println(""); System.out.println(" ## ## AA "); System.out.println(" ## ## AA"); System.out.println(" 1 2 3 "); System.out.println(""); } } } }