Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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:1

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

Identify and control your anxieties

Answered: 1 week ago

Question

Understanding and Addressing Anxiety

Answered: 1 week ago