50) Design a form and write program in visual basic for function procedure to input principle amount, rate and time in year in three different text boxes. Calculate simple interest using function procedure and print simple interest in a text box on the form?


Function SInterest(ByVal principle As Currency, ByVal rate As Single, ByVal time As Single) As Double
    SInterest = (principle * rate * time) / 100
End Function


Private Sub Command1_Click()
    Dim p, s As Currency, r, t As Single
    p = Val(Text1.Text)
    r = Val(Text2.Text)
    t = Val(Text3.Text)
    s = SInterest(p, r, t)
    Text4.Text = s
End Sub


Private Sub Command2_Click()
End Sub



Comments are closed.

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: