Assignemnt #89

Code

///colin hinton
///5th period
///BBJ.java
///12/7/2015

import java.util.Random;

class BBJ
{
    public static void main (String [] args)
    {
        Random r = new Random();
        
        System.out.println("Welcome to baby BlackJack!!");
        System.out.println();
        int x = (1 + r.nextInt(10));
        int y = (1 + r.nextInt(10));
        System.out.println("You drew "  + x + " and "  + y + ".");
        int z = (x + y);
        System.out.println("Your total is " + z );
        System.out.println();
        int a = (1 + r.nextInt(10));
        int b = (1 + r.nextInt(10));
        System.out.println("The dealer has "  + a + " and " +  b + ".");
        int c = (a + b);
        System.out.println("Dealer's total is " + c);
        System.out.println();
        if (z > c)
        {
            System.out.println("You Win!");
        }
        else if ( z == c)
        {
            System.out.println("You Tie??");
        }
        else 
        {
            System.out.println("You lost");
        }
    }
}
    

Picture of the output

Assignment 1