So I have this problem where I can’t wrap my head around it. Here the assignment:
A programmer walks into a flower shop. He has $100 in his pocket, and wants to spend all his money to buy roses. However, there 3 types of roses: white ones, yellow ones and red ones.
Yellow ones cost $5 each, white ones cost $7 each and red ones cost $10 each.
How many combinations are there so that he can buy at least one rose of each color? And he has to spend all the money he has, he shouldn’t be able to buy any roses for the money left.
So I know it’s about for loops here but I don’t know/understand how to organize the loop, how do I set the data and get to this combination number? Can you please help me out with this?
I don’t know where to start since I really don’t understand how to do this…