Assignemnt #89
Code
/// Name: Daniel Nguyen
/// Period: 6
/// Program Name: bbyb Program
/// File Name: bbyb.java
/// Date Finished: 9/9/2015
import java.util.Scanner;
import java.util.Random;
public class bbyb
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int x = 1 + r.nextInt(10);
int y = 1 + r.nextInt(10);
int a = 1 + r.nextInt(10);
int b = 1 + r.nextInt(10);
int z = x + y;
int c = a + b;
System.out.println("You drew " + x + " and " + y + ".");
System.out.println("Your total is " + z + ".");
System.out.println("");
System.out.println("The dealer has " + a + " and " + b + ".");
System.out.println("The dealer's total is " + c);
if (c > z)
System.out.println("You lose!");
if (z > c)
System.out.println("You win!");
else if (z == c)
System.out.println("Its a tie..");
}
}
Picture of the output