I'm guessing by "bills" you want to know how much change to return and 
in what form?

This is long winded code, but simple to follow (although I can think of 
a shorter way). It will give the most of each bill until satifsifed.

I haven't used VB6 in quite a while, feel free to correct my syntax.

' The bill counts. The integer following "bill" is the denomination 
size. Forspace, add addt'l with 50, 20, etc for each denom.
Public Sub GiveChange(Amount as Single)
    Dim Bill100 as Integer

    ' Count how many 100s to give
    While Amount > 100
       Amount = Amount - 100
       Bill100 = Bill100 + 1
    Wend

    ' Now determine how many 50s
    While Amount > 50
       Amount - Amount - 50
       Bill50 = Bill50 + 1
    Wend

    ' Repeat for each bill, changing denomination

    ' Display results
    Label100.Caption = "100s: " & CStr(Bill100)
    ' Repeat
End Sub

If you want the shorter version let me know, I'll need a bit of time to 
polish it.

perwaiz_in wrote:

>
>
> Greetings.
>
> Dear friend this is the first time iam doing a project for supermarket
> using VB and SQl.Everything is okay.Only the problem with bills.Please
> tell me how to generate the bills.
>
> My email ID is [EMAIL PROTECTED]
>
> any help regarding this highly apprecaitable.
>
> with regards.
> (perwaiz Ahmed)
>
-- T.

1990 TA hardtop





'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [email protected]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to