All pastes #16250 Raw Edit

Untitled

public text v1 · immutable
#16250 ·published 2005-06-29 03:58 UTC
rendered paste body
'This program was coded by:  Miakel Roberts
'Project number: Lab5
'The purpose of this program is to do: Is to show the use of Simple If end If and If Else End IF.
'Time spent: 2 hours
'Turned in: June 29, 2005

Option Explicit


Private Sub cmdIfElseCalcBalance_Click()
    Dim curBalance As Currency
    Dim curWithdrawal As Currency
    
    curBalance = Val(txtBalance.Text)
    curWithdrawal = Val(txtWithdrawal.Text)
    
    If curWithdrawal <= curBalance Then
        curBalance = (curBalance - curWithdrawal)
        lblBalance.Caption = Format(curBalance, "currency")
    Else
        lblBalance.Caption = "Insufficient Funds"
    End If
    
End Sub

Private Sub cmdIfElseCalcPay_Click()
    Dim curRevenue As Currency
    Dim curMinRevenue As Currency
    Dim curCommission As Currency
    
    curRevenue = Val(txtRevenue.Text)
    curMinRevenue = 10000
    
    If curRevenue <= curMinRevenue Then
        curCommission = (curRevenue * 0.1)
    Else
    
        curCommission = ((curRevenue * 0.12) + 100)
    End If
        
    lblPay.Caption = Format(curCommission, "Currency")
    
End Sub

Private Sub cmdIfElseCalcTax_Click()
    Dim curTaxes As Currency
    Dim curIncome As Currency
    Dim curTaxable As Currency
    
    curIncome = Val(txtIncome.Text)
    curTaxable = 30000
    
    If curIncome > curTaxable Then
        curTaxes = ((curIncome - curTaxable) * 0.28) + 4500
    Else
       
        curTaxes = (curIncome * 0.15)
    End If
        
    lblTax.Caption = Format(curTaxes, "currency")
        
End Sub

Private Sub cmdSimpleCalcBalance_Click()
    Dim curBalance As Currency
    Dim curWithdrawal As Currency
    
    curBalance = Val(txtBalance.Text)
    curWithdrawal = Val(txtWithdrawal.Text)
    
    If curWithdrawal > curBalance Then
        lblBalance.Caption = "Insufficient Funds"
    End If
    
    If curWithdrawal <= curBalance Then
        curBalance = (curBalance - curWithdrawal)
        lblBalance.Caption = Format(curBalance, "currency")
    End If
    
    
    
End Sub

Private Sub cmdSimpleCalcPay_Click()
    Dim curRevenue As Currency
    Dim curMinRevenue As Currency
    Dim curCommission As Currency
    
    curMinRevenue = 10000
    
    curRevenue = Val(txtRevenue.Text)
    
    If curRevenue > curMinRevenue Then
        curCommission = (curRevenue * 0.12) + 100
        lblPay.Caption = Format(curCommission, "Currency")
    
    End If
    
    If curRevenue <= curMinRevenue Then
        curCommission = (curRevenue * 0.1)
        lblPay.Caption = Format(curCommission, "Currency")
    End If
    
    
    
End Sub

Private Sub cmdSimpleCalcTax_Click()
    
    Dim curTaxes As Currency
    Dim curIncome As Currency
    Dim curTaxable As Currency
    
    curIncome = Val(txtIncome.Text)
    curTaxable = 30000
    
    If curIncome > curTaxable Then
        curTaxes = ((curIncome - curTaxable) * 0.28) + 4500
    End If
           
    If curIncome <= curTaxable Then
        curTaxes = (curIncome * 0.15)
    End If
        
    lblTax.Caption = Format(curTaxes, "currency")
                
End Sub