Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a program that determines whether or not it is possible to construct a particular total using a specific number of coins. For example, it

Create a program that determines whether or not it is possible to construct a particular total using a specific number of coins. For example, it is possible to have a total of $1.00 using four coins if they are all quarters. However, there is no way to have a total of $1.00 using 5 coins. Yet it is possible to have $1.00 using 6 coins by using 3 quarters, 2 dimes and a nickel. Similarly, a total of $1.25 can be formed using 5 coins or 8 coins, but a total of $1.25 can not be formed using 4,6 or 7 coins.
Your program should read both the dollar amount and the number of coins from
the user. It should display a clear message indicating whether or not the entered dollar amount can be formed using the number of coins indicated. Assume the existence of quarters, dimes, nickels, and pennies when completing this problem. Your solution must use recursion. It can not contain any loops.
Just exactly same question, but I want to know if I want to solve if it's possible to make the total amount using a certain number of coins, how I can do that. And also if I want to know the minimum way of consturcting the amount using these numbers, how I can do that.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions