if someone could help me solve this problem i would be really thankfull:
This task is about a cash machine simulation issuing banknotes. The starting balance is to be given by the user. A withdrawal can be requested by a user (one or more times) entering the desired amount. The simulated cash machine has (an unlimited number of) banknotes with values 100, 50, 20, 10, 5. Your algorithm should issue preferrably high banknotes and fill up with smaller ones if necessary to match the amount of withdrawal. The cash machine simulator displays the numbers of banknotes with their respective value (from highest to lowest) and the new balance after withdrawal. If the requested withdrawal is higher than the current balance, the user can try again. If the desired amount cannot be issued because there is no possible combination of banknotes matching the requested withdrawal, she can try again, too. If the withdrawal entered by the user is 0, the program quits. This is a possible interaction: Starting balance : 3333 Amount to withdraw : 245 2 x 100 note 2 x 20 note 1 x 5 note New balance : 3088 Amount to withdraw : 0 Good bye
Aucun commentaire:
Enregistrer un commentaire