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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -