A cashier in a supermarket returns change to customers. Suppose we want to write a program to help the cashier finding the possible combinations of coins that sum up to the change. Assume that the coin units available are 1, 2 and 5 Qurush (قروش) where there is infinite supply of every coin. Write a method that receive the amount of change to be paid to the customer and then Prints the different combinations by which the change can be paid to the customer.
in 10 min in machine independent language
Don't copy from chegg it is wrong there ,
solve if you had knowldege else i dislike
A cashier in a supermarket returns change to customers. Suppose we want to write a
Write a method that receive the amount of change to be paid to the customer and then Prints the different combinations by which the change can be paid to the customer.
Write a program to test this method.
Example: if the change is 7 then the different combinations are:
1 1 1 1 1 1 1,
1 1 1 1 1 2,
1 1 1 2 2,
1 2 2 2,
1 1 5,
2 5,
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images