mehulalex patel wrote:how do I check the minimum and maximum capacity of each denomination.
Well, that would come from your enum, wouldn't it?
However, my main advice to you is to StopCoding (←click).
You've written (or been given) a pile of code, and you plainly don't understand how it works; so stop - NOW - sit back, and think.
Write out scenarios and work out how you would do it, and see how closely it comes to the code you've written. And don't be afraid to toss the whole lot in the bin if it's not right, because you will never code your way out of a mess.
Have you been given any specifications for your cash machine? Please tell us. you should use them to work out whether there is any connection between the paying in methods and the taking out methods.
Campbell Ritchie wrote:Welcome to the Ranch
Have you been given any specifications for your cash machine? Please tell us. You should use them to work out whether there is any connection between the paying in methods and the taking out methods.
no there is no relation between the paying and payout method.
my pay out method gives me out put as
10 * 163 = 1630
2 * 1 = 2
1 * 1 = 1
which is wrong because denomination 10 is exceeding its max limit ideally it should not go beyond 100.
below is the min/ max ,limit for each denominations
COIN1 (1, 5, 200), // 1 euro coins 5 is minimum limit and 200 is max limit.
COIN2 (2, 5, 150), // 2 euro coins 5 is minimum limit and 150 is max limit.
NOTE1 (5, 0, 120), // 5 euro notes 0 is minimum limit and 120 is max limit.
NOTE2 (10, 0, 100); // 10 euro notes 0 is minimum limit and 100 is max limit.
You will probably have to turn your computer off while you are doing that exercise.