Assignment #89 BabyBlackJack
Code
/// Name: Lacey Reese
/// Period: 5
/// Program Name: BabyBlackJack
/// File Name: BabyBlackJack.java
/// Date Finished 2/22/2016
import java.util.Random;
public class BabyBlackJack
{
public static void main( String[] args )
{
Random r = new Random();
int p1 = 1 + r.nextInt(10);
int p2 = 1 + r.nextInt(10);
int d1 = 1 + r.nextInt(10);
int d2 = 1 + r.nextInt(10);
int pTotal = p1 + p2;
int dTotal = d1 + d2;
System.out.println( "Baby Blackjack!!!!" );
System.out.println();
System.out.println( "You drew " + p1 + " and " + p2 + "." );
System.out.println( "Your total = " + pTotal + "." );
System.out.println();
System.out.println( "The dealer has a " + d1 + " and " + d2 + "." );
System.out.println( "Dealer's total is " + dTotal + "." );
if ( pTotal > dTotal ) {
System.out.println( "YOU WIN!!!! WAHOOOO" );
}
else if ( pTotal < dTotal ) {
System.out.println( "YOU LOSE!!!!SUCKSS" );
}
else {
System.out.println( "YOU TIED! REMATCH" );
}
}
}
Picture of the output
//