Thank you so much Tavish for your help. I'm having trouble with two last things (I'm changing my major after struggling so much with Java). I need to get the game to loop while the user still has money. Also, I need it to print out the total amount of money that the user has. There is a printMenu towards the bottom, but I don't know how to utilize it. Thanks again
public static void main(String [] args) {
//establishing cards for hands
int userCardNumber=0;
int cpuCardNumber=0;
int top = 0;
int userNumCards;
int userMoney = 100;
int wantToPlay;
Scanner input = new Scanner(System.in);
Card [] deck = makeDeck();
Card[] userHand = new Card[7];//user hand array is 7 cards
Card[] cpuHand = new Card[7];//cpu hand array is 7 cards
shuffleDeck(deck);
userHand[userCardNumber++] = deck[top++];//deal a card to the user
userHand[userCardNumber++] = deck[top++];//deal a card to the user, top card also
cpuHand[cpuCardNumber++] = deck[top++];//deal a card to the cpu
cpuHand[cpuCardNumber++] = deck[top++];//deal a card to the cpu, top card also
System.out.println("User Money= $" +userMoney);
System.out.print("User Hand:");
printHand(userHand);
System.out.println("Top Card:" + cpuHand[0]);//displaying top card
System.out.println("How Many Cards Do You Want?");//asking user to take card(s)
userNumCards = input.nextInt();//input is the # the user enters
if(determineWinner(userHand, cpuHand) >= 0){//comparing hands
System.out.println("User Has Won");
}
else{
System.out.println("CPU Has Won");
}
}
int h1_total;
int h2_total;
if(isBlackJack(h1)){//if hand one is BlackJack...
return 15;///...return 15
} //end blackjack checks
// check non-blackjack results .. first setup hand totals
h1_total = getHandTotal(h1);
h2_total = getHandTotal(h2);
if(h1_total > 21){
return -10;//if the first hand is greater than 21, money =-10
}
else if(h2_total > 21){
return 10;//if second hand is greater than 21, money =10
}
else if(h1_total > h2_total){
return 10;//if the first hand is greater than the second, money =10
}
else if(h1_total < h2_total){
return -10;//if the first hand total is less than the second hand total,
//money =-10
}
return 0;//if none of the above are true, then money =0
}
public static void printMenu() {
System.out.println();
System.out.println("***********OPTIONS***********");
System.out.println("* 1 - Print hand *");
System.out.println("* 2 - Take another card *");
System.out.println("* 3 - Stand on current hand *");
System.out.println("* 4 - Show money balance *");
System.out.println("*****************************");
System.out.println("***** Your choice? *****");
System.out.println("*****************************");
System.out.println();
}
}