Week 7: Thursday ---------------- Q1. (35) Consider two sets of complex numbers, the first set contains 3 numbers and the second set contains 2 numbers. Implement each set as two arrays of doubles, where the first array represents the real part and the second one represents the imaginary part. Now, produce another set of complex numbers which are the multiplications of all complex numbers in the first set with those in the second. Note that the size of this set will be 6. Again, implement this set as two arrays. Input the complex numbers from the user and output them in the (a + i b) * (c + i d) = (e + i f) notation. For example, if one complex number is 3+2i and the second one is 4-3i, your program should output it in the following way: (3 + i 2) * (4 - i 3) = (18 - i 1) Q2. (65) Blackjack is a popular card game played in casinos. Here is the description of a simple version of it. There is a deck of cards, randomly shuffled. A deck of cards contain four suits, each of which contains 13 cards -- 2 to 9, jack, queen, king and ace. There are two players, the guest and the bank. First, the guest plays. She draws as many cards as she wants, as long as the total value does not exceed 21. When the guest stops, or goes "bust" (i.e., score over 21), the bank plays. The bank draws cards until its score is 16 or higher, and then stops. Cards have the following numeric values: 1. Numeric cards have numeric values; so a nine is worth nine points. 2. Jacks, queens and kings are worth ten points each. 3. Aces are worth either one point or eleven points. When calculating the value for a hand, all aces have the same value; either they are all worth eleven points, or they are all worth one point. Initially, the value eleven is used for the aces, but if that leads to a score above 21, then the value one is used instead. The winner is the player with the highest score that does not exceed 21. If the players end up with the same score, then the bank wins. The bank also wins if both players go bust. Use the function rand() that returns a random integer. You can use this function to generate a random integer within a particular range. For example, to generate a random integer between 1 and 10, you need to use (1 + rand() % 10). Design a Blackjack game, selecting cards randomly both for the guest and the banker. Print the value of both the hands and the winner. (You can select cards randomly, but make sure that the same card is not drawn more than once. Alternatively, assign the initial shuffling of the cards randomly, and pick up consecutively from the deck. You can use your own way as well.)