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

Category: Engineering

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;

   }

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Pay Someone To Write Essay