Question: Please write using Swift programming language. If possible, please use a greedy or a dynamic programming solution. o 1. Create a Swift playground Specify the
Please write using Swift programming language. If possible, please use a greedy or a dynamic programming solution.

o 1. Create a Swift playground Specify the playground name as: A01_lastName_firstName 2. Define a class named The class contains the following public elements: - A Double stored property that contains the amount of money (dollars and cents) described by an object of the class. A read-only, computed property. The getter calculates and returns the minimum number of U.S. bills and coins that add up to the amount in the stored property. The return value is an Int array of length 9 that contains (beginning with index 0 of the array) the number of $50 bills, $20 bills, $10 bills, $5 bills, $1 bills, 25 coins, 10 coins, 5 coins, and 1 coins. For example, if the stored property contains 47.23, the return value is: 0 [0, 2, 0, 1, 2, 0, 2, 0, 3] However, if the amount in the stored property is negative, return nil. . An initializer with one Double parameter; it assigns the parametric value to the stored property. 3. In the playground (outside of the class): o Define 6 variables of type Cash. Initialize one to a negative number; initialize another to zero; initialize the remaining variables to random-ish amounts in the range of 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
