Question: 2. Write in Swift code using a dictionary, the cards are the key, value pairs GiftCard[] cards = new GiftCard[4]; cards[0] = new GiftCard(Target,25.0); cards[1]
2. Write in Swift code using a dictionary, the cards are the key, value pairs
GiftCard[] cards = new GiftCard[4];
cards[0] = new GiftCard("Target",25.0);
cards[1] = new GiftCard("Macy's",50.0);
cards[2] = new GiftCard("Walmart",75.0);
cards[3] = new GiftCard("Boscovs",80.0);
for (i = 0; i < numCards; i++)
{System.out.print(cards[i]);
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
