You are a traveler and traveling to a country where the currency denominations are unknown and as you travel, you get

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

You are a traveler and traveling to a country where the currency denominations are unknown and as you travel, you get

Post by answerhappygod »

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 number of notes you give is minimum.//Assume that the denominations are in such a way that any amount can be paid.(java)
InputTake input of all the currency denominations ( random order)
OutputPrint the minimum no of notes that you will be using to pay the net amount.
TestCase 1Enter the size of currency denominations 3Enter the currency denominations value5110Enter the amount you want to pay12Your payment approach in order to give min no of notes will be10:11:2
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply