Problem:- Program for displaying the Denominations of an Amount or Money Change Breakdown or Find total number of ways to make change using given set of coins or java currency denominations or java program to display the currency denomination of a given amount or Write A Java Program To Find Denomination Needed for A Given Amount Along With The Total Number of Notes.
Generally, Notes are used in banks are given below in descending Order. It is dependent on country wise there is some country Denomination. Below are the India and USA currency as you know after 8 November 1000 Rs. Ban in India Cause Black Money, We Thank Our Prime Minister Mr. Narendra Damodardas Modi ( Man of action ) for such a biggest action.
INDIA ( Rupees ) USA ( Dollar ) INDIA ( Rupees )
( Before 8 Nov. 2016 ) ( Present ) ( Present )
1000 100 2000
500 50 500
100 20 100
50 10 50
20 5 20
10 2 10
5 1 5
2 2
1 1
Logic:- The Logic Behind we have to divide a money by Above Money lets take an example Suppose money is 16108 then follow the Step We are taking an example of Indian Currency In present
Step 1:- Then First we divide 16108 by 2000 then we get 8, 2000 rs notes then go to step 2
Step 2:- After divide 2000 we get a remainder 108 The we know that 108 is not divisible by 500 to go to next step
Step 3:- Now divide 108 by 100 then we get 1, 100 rs note now remainder is 8 go to next step
Step 4:- 8 is divisible by 50 and 20 nor 10 so we escape now go to next step
Step 5:- Now divide 8 by 5 we get a 1, 5 rs notes and remainder is 3 to go to next step
Step 6:- Now divide 3 by 2 we get 1, 2 rs notes and remainder is 1
so follow the next step
Step 7:- This is the Last step divide 1 by 1 we get zero remainder now print the total no of denomination needed and along with total no of count require to fulfill a requirement
So for 16108 You Need to
No.
8 * 2000 = 16000
1 * 100 = 100
1 * 5 = 5
1 * 2 = 2
1 * 1 = 1
Total =12 Notes For minimum Transaction
Method 1:- Denomination For Indian Rupees
Method 2:- Denomination For USA Dollar
Output:
Enter The Amount in Rupees :
160108
Total Number Of 2000 Rupees Notes :80
Total Number Of 100 Rupees Notes : 1
Total Number Of 5 Rupees Notes Or Coin : 1
Total Number Of 2 Rupees Notes Or Coin : 1
Total Number Of 1 Rupees Note Or Coin : 1
Total Number Of Notes Require :
84
----------------------------------------------------------
Enter The Amount in Dollar :
6789
Total Number Of 100 Dollar : 67
Total Number Of 50 Dollar : 1
Total Number Of 20 Dollar : 1
Total Number Of 10 Dollar Or Coin : 1
Total Number Of 5 Dollar Or Coin : 1
Total Number Of 2 Dollar Or Coin : 2
Total Number Of Dollar Require :
73
need an explanation for this answer? contact us directly to get an explanation for this answer