vb.net - Visual Basic Change maker program -


i'm writing program class , i've been stuck day now. program needs give change user inputted decimal. in 9.41 9 dollars, 1 quarters, 1 dimes, 1 nickel, 1 penny. results aren't correct great thanks!

public class tessitorenlab3      private sub btncalculate_click(sender object, e eventargs) handles btncalculate.click          dim balance integer         dim remainingbalance integer         dim txtamount double          txtamount = cdbl(txtamount1.text) 'i renamed text box txtamount1...           balance = (cint(txtamount / 1))         lstresults.items.add(balance & " dollars")         remainingbalance = balance * 100          balance = remainingbalance / 25         lstresults.items.add(balance & " quarters")         remainingbalance = balance * 100          balance = remainingbalance / 10         lstresults.items.add(balance & " dimes")         remainingbalance = balance * 100          balance = remainingbalance / 5         lstresults.items.add(balance & " nickels")         remainingbalance = balance * 100          balance = remainingbalance / 0.01         lstresults.items.add(balance & " pennies")      end sub  end class 


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -