Lab Exercises For Visual Basic 6.0
Lab Exercises For Visual Basic 6.0
Dismas Ombuya
Technical University Of Kenya
Pset(x,y), color
The Interface
The Code
v = a * (5 - w) ^ 2 - b * (5 - w) + c
pic_graph.PSet (w, 5 - v)
Next w
End Sub
In this program, we need to insert four text boxes for the user to
enter the initial cost, the salvage value, the asset's life and the
period of depreciation. Besides that, insert a label to display the
amount of depreciation and a command button to compute the
depreciation.
Interface
The Code
Private Sub Command1_Click()
Dim Int_Cost, Sal_Value, Asset_Life, Deperiod, Depre_Amt As Double
Int_Cost = Val(Txt_Cost.Text)
Sal_Value = Val(Txt_Salvage.Text)
Asset_Life = Val(Txt_Life.Text)
Deperiod = Val(Txt_Period.Text)
Depre_Amt = DDB(Int_Cost, Sal_Value, Asset_Life, Deperiod)
Lbl_Dpre.Caption = Format(Depre_Amt, "$###,###,000.00")
End Su