0

I have payroll database, on my payroll payslip i would like to make money denominations for the salary of each employee, I.e if an employe has got 759 Dollar then the cashier wil withdraw 7 one hundreds ,1 Fifty Dolar, 9 ten dollars from a banck please give me a code in vb.net

Salary hundred Fifty ten

759 7 1 9

Please help me thans a lot

RossFabricant
  • 12,364
  • 3
  • 41
  • 50

1 Answers1

0

Here's an answer in python:

# Target amount
amount = 759

# The denominations to be used, sorted
denoms = [100, 50, 20, 10, 5, 1]

# Take as many of each denomination as possible
for d in denoms:
  count = amount // d
  amount -= count * d
  print "%ix%i" % (count, d)

Sample output:

7x100
1x50
0x20
0x10
1x5
4x1
brian-brazil
  • 31,678
  • 6
  • 93
  • 86