Computer problems,Computer help
*AX SOFT>>>Programming & Design

Visual Basic- StartingHelp?


Visual Basic - Change Machine?
Ok How do I make my program execute change. For example, if I have 3 text boxes with Amount of Purchase, Amount Tendered, and Change Due. And then 9 check boxes with 20,10,5,1, Dollars,Dimes,Nickels, Pennies and a label box corresponding to each one, and a Calculate Button,how do I make this work?

Ok so i Dont know where to start? I just need a starting point.

For Private Sub BtnCalculate Click(....
If Chktwenty.Checked=False then
---->intTwenty=intchange\2000
---->intChange=intChangeMod2000
lblTwenty=intTwenty

is that right to have the number of 20s given back appear in the label box next to 20?

sure you can do it that way.. but you will need to make sure you are getting the floor of the change/2000... or you can use a series of while loops..

while intchange >= 2000
{
intchange-= 2000
intTwenty+=1
}

while intchange >= 1000
{
intchange-= 1000
intTens+=1
}

while intchange >= 500
{
intchange-= 500
intfives+=1
}

while intchange >= 100
{
intchange-= 100
intones +=1
}
---- etc ---

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • Unix command helps!!?

    date -v -1d "+%D" >yesterday.txt (better read the man page to figure out why/how this works) ls -a /bin >~/temp/bin.txt

    ...
  • How do I make a groupbox border appear and darker and black?

    Basically the border code has a lot of border styles and some are pretty neat if the border size is set correctly. Like the style "inset": border: 5px inset #000; A simple border: ...

  • Adobe Photoshop Ghost Rider text recreate poster???

    Yes, you can create it in photoshop alone. No need additional images. 1. Steel effect can be achieved by gradient fill in blending options. Or, if your PS do not have blending option, just add a...

  • Changing text in a Div Box?

    Since the div has a class assigned to it, you refer to the class with CSS: <div class="Div1">HOW WOULD I CHANGE THIS TEXT???</div> <style type="text/css"> ...

  • Need help with Java programming (involving arrays)?

    Just write one yourself. It's easy. // array1 is already defined double total = 0; for( int i=0; i < array1.length; i++){ total+=array[i]; } double avg = total/array1.length;

    ...
  • Trying to understand a piece of code in VBA [excel]?

    Sub Processor() ->Beginning of subroutine:Processor Dim ConstantCells As Range ->Define ConstantCells as a range of cells Dim FormulaCells As Range ->like above statement Dim cell As...

  • How do I keep a running total score in c++?

    Set the value to 0 above the loop and add to the value test = 0; loop{ score = 15; test+=score; } cout << test

    ...
  • Use ASP .NET's membership system or roll your own?

    Well the pro's are pretty obvious. It offers you a ready component for use to save/retrieve users for your website, it integrates pretty well very easily with Login server controls thus saving...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster