Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Friday, July 15, 2011

VB-41 : Calculate future value of an investment

Compute FV(Future Value) of an investment.The formula used is as follows:

FV=Investment*(1+Interest )years
Also,design a splash screen for this application.Use appropriate controls to design the user interface.
A)    Program Design : 
    ( Design & Code  for Splash Screen didn't give)

(B) Property(Controls Used) :
  •      4 Labels and their CAPTIONS are Investment Amount(Rs.),nvestment Period(Years),Interest Rate and Future Value is .
  •    One Command Button and its CAPTION is Calculate Future Value.
  •     4 Text Boxes

(C) Attaching Code to the Object :


Private Sub Command1_Click()

Dim investment As Single
Dim rate As Single
Dim years As Integer
Dim FV As Single

investment = Val(Text1.Text)
rate = Val(Text3.Text)
years = Val(Text2.Text)
FV = investment * power((1 + rate / 100), years)
Text4.Text = FV
End Sub

Private Function power(base As Double, raise As Integer) As Double
power = 1
For i = 1 To raise
power = power * base
Next
End Function

      • ====================================================================
        Back to Home   &  VB
    ===========================================================

    No comments: