Final answer:
To simulate a piggy bank with the Coins class, start with a value of $1.41 from 4 quarters, 3 dimes, 2 nickels, and 1 penny, then add 2 quarters, 2 dimes, and 6 pennies to reach a total of 15 coins and $2.12.
Step-by-step explanation:
To start a simulated piggy bank with the Coins class, first we need to determine the value of the initial coins: 4 quarters (4 x $0.25 = $1.00), 3 dimes (3 x $0.10 = $0.30), 2 nickels (2 x $0.05 = $0.10), and 1 penny ($0.01). This gives a starting total of $1.41.
To reach exactly $2.12 with a total of 15 coins, we need to add coins worth $0.71, while the total number of added coins is 10 (since we start with 10 coins). One possible combination to reach a total of $2.12 with 15 coins is to add 2 quarters ($0.50), 2 dimes ($0.20), and 6 pennies ($0.06). With this, the total value would be $1.41 + $0.50 + $0.20 + $0.06 = $2.12 and the total number of coins would be 4+2 quarters, 3+2 dimes, 2 nickels, and 1+6 pennies, which equals 15 coins.
Once you have the right amount, you would call the method to print the bank count and then the bank total to confirm your values.