All pastes #489797 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-15 18:26 UTC
rendered paste body
Option Explicit
Const CurBurgers As Currency = 1.25
Const CurFries As Currency = 0.75
Const CurSoda As Currency = 0.8

Private Sub cmdTotal_Click()
    Dim intBurgers As Integer, intFries As Integer
    Dim intSoda As Integer
    
    intBurgers = txtBurgers.Text
    intFries = txtFries.Text
    intSoda = txtSoda.Text
    
    lblTotal.Caption = "$" & TotalBill(intBurgers, intFries, intSoda)
End Sub

Function TotalBill(ByVal Burgers As Integer, ByVal Fries As Integer, _
    ByVal Soda As Integer) As Currency
    TotalBill = Burgers * CurBurgers + Fries * CurFries + Soda * CurSoda
End Function

Private Sub cmdDone_Click()
    Unload Me
End Sub