Answered step by step
Verified Expert Solution
Question
1 Approved Answer
coding data structure in java You are a traveler and traveling to a country where the currency denominations are unknown and as you travel you
coding data structure in java
You are a traveler and traveling to a country where the currency denominations are unknown and as you travel you get to know about the denomination in random order. You want to make a payment of amount x, in such a way that the higher denomination is used to make exact payment. Input Take input of all the currency denominations ( random order) Take input of the amount that you want to pay. Output Print the minimum no of notes that you will be using to pay the net amount. TestCase 1 enter the size of currency denominations 3 TestCase 1 enter the size of currency denominations 3 enter the currency denominations value 5 1 10 enter the amount you want to pay 12 Your payment approach in order to give min no of notes will be 10:1 1:2 TestCase 2 enter the size of currency denominations 5 enter the currency denominations value enter the size of currency denominations 5 enter the currency denominations value 60 5 12 78 25 enter the amount you want to pay 128 Your payment approach in order to give min no of notes will be 78:1 25:2 TestCase 3 enter the size of currency denominations 4 enter the currency denominations value 12 5 123 18 TestCase 3 enter the size of currency denominations 4 enter the currency denominations value 12 5 123 18 enter the amount you want to pay 158 Your payment approach in order to give min no of notes will be 123:1 18:1 12:1 5:1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started