Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

how do you convert the for-each loop into a regular for loop?

how do you convert the for-each loop into a regular for loop? 

public static int getValueOfHand(Hand h) {

       int total = 0;

       for (Card card : h.getCards()) {

           total += getValueOfCard(card);

       }

       for (Card card : h.getCards()) {

           if (card.getType() == Card.Type.ACE && total <= 11) {

               total += 10;

           }

       }

       return total;

   }

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question