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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!