Assignment #89

Code

/// Name: Jonathan Stine
/// Period: 5
/// Program name: Baby Blackjack
/// File Name: Blackjack.java
/// Date Finished: 3/4/2016
      
    import java.util.Random;
    public class Blackjack
    {
         public static void main(String [] args)
         {
              Random r = new Random();
              int p1 = 1 + r.nextInt(10);
              int p2 = 1 + r.nextInt(10);
              int c1 = 1 + r.nextInt(10);
              int c2 = 1 + r.nextInt(10);
              System.out.println("Baby blackjack");
              System.out.println("You drew a "+p1+" and a "+p2+".");
              System.out.println("Your total is "+(p1+p2)+".");
              System.out.println("The dealer has "+c1+" and a "+c2+".");
              System.out.println("The total is "+(c1+c2)+".");
              if ((p1+p2)>(c1+c2))
                  System.out.println("You win");
              else
                  System.out.println("You lose, GIMME ALL YOUR MONEY");
          }
      }

 
    

Code Output