Assignemnt #91
Code
/// Name: Connor Siri
/// Period: 7
/// Program Name: Baby
/// File Name: Baby.java
/// Date Finished: 12/4/2015
import java.util.Random;
import java.util.Scanner;
public class Baby
{
public static void main( String[] args )
{
Random r = new Random();
Scanner keyboard = new Scanner(System.in);
int x = 1 + r.nextInt(10), y = 1 + r.nextInt(10), z = 1 + r.nextInt(10), w = 1 + r.nextInt(10) ;
int h = y + x;
int g = z + w;
System.out.println("Baby Blackjack!");
System.out.println("\n You drew a " + y + " and " + x);
System.out.println("Your total is " + h );
System.out.println("\nThe Dealer has " + z + " and " + w);
System.out.println("Dealer's total is " + g);
if ( h > g )
{
System.out.println("You win");
}
else if ( g>h )
{
System.out.println("The dealer wins.");
}
else
{
System.out.println("It is a tie, split the pot");
}
}
}
Picture of the output