Option Explicit On 
Option Strict On

Public Class frmSavings
  Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

  Public Sub New()
    MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    'Add any initialization after the InitializeComponent() call

  End Sub

  'Form overrides dispose to clean up the component list.
  Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    If disposing Then
      If Not (components Is Nothing) Then
        components.Dispose()
      End If
    End If
    MyBase.Dispose(disposing)
  End Sub
  Friend WithEvents Label2 As System.Windows.Forms.Label
  Friend WithEvents Label3 As System.Windows.Forms.Label
  Friend WithEvents txtDeposit As System.Windows.Forms.TextBox
  Friend WithEvents txtInterest As System.Windows.Forms.TextBox
  Friend WithEvents txtMonths As System.Windows.Forms.TextBox
  Friend WithEvents txtFinal As System.Windows.Forms.TextBox
  Friend WithEvents Label4 As System.Windows.Forms.Label
  Friend WithEvents btncalculate As System.Windows.Forms.Button
  Friend WithEvents btnExit As System.Windows.Forms.Button
  Friend WithEvents Label1 As System.Windows.Forms.Label
  Friend WithEvents Button1 As System.Windows.Forms.Button

  'Required by the Windows Form Designer
  Private components As System.ComponentModel.Container

  'NOTE: The following procedure is required by the Windows Form Designer
  'It can be modified using the Windows Form Designer.  
  'Do not modify it using the code editor.
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.Label1 = New System.Windows.Forms.Label()
    Me.Label2 = New System.Windows.Forms.Label()
    Me.Label3 = New System.Windows.Forms.Label()
    Me.txtFinal = New System.Windows.Forms.TextBox()
    Me.btncalculate = New System.Windows.Forms.Button()
    Me.txtInterest = New System.Windows.Forms.TextBox()
    Me.btnExit = New System.Windows.Forms.Button()
    Me.txtMonths = New System.Windows.Forms.TextBox()
    Me.Label4 = New System.Windows.Forms.Label()
    Me.txtDeposit = New System.Windows.Forms.TextBox()
    Me.SuspendLayout()
    '
    'Label1
    '
    Me.Label1.Location = New System.Drawing.Point(8, 16)
    Me.Label1.Name = "Label1"
    Me.Label1.TabIndex = 0
    Me.Label1.Text = "Monthly Deposit"
    '
    'Label2
    '
    Me.Label2.Location = New System.Drawing.Point(8, 48)
    Me.Label2.Name = "Label2"
    Me.Label2.TabIndex = 0
    Me.Label2.Text = "Yearly Interest"
    '
    'Label3
    '
    Me.Label3.Location = New System.Drawing.Point(8, 80)
    Me.Label3.Name = "Label3"
    Me.Label3.TabIndex = 0
    Me.Label3.Text = "Number of Months"
    '
    'txtFinal
    '
    Me.txtFinal.Location = New System.Drawing.Point(120, 112)
    Me.txtFinal.Name = "txtFinal"
    Me.txtFinal.TabIndex = 0
    Me.txtFinal.TabStop = False
    Me.txtFinal.Text = ""
    '
    'btncalculate
    '
    Me.btncalculate.Location = New System.Drawing.Point(80, 144)
    Me.btncalculate.Name = "btncalculate"
    Me.btncalculate.TabIndex = 3
    Me.btncalculate.Text = "&Calculate"
    '
    'txtInterest
    '
    Me.txtInterest.Location = New System.Drawing.Point(120, 48)
    Me.txtInterest.Name = "txtInterest"
    Me.txtInterest.TabIndex = 1
    Me.txtInterest.Text = ""
    '
    'btnExit
    '
    Me.btnExit.Location = New System.Drawing.Point(80, 176)
    Me.btnExit.Name = "btnExit"
    Me.btnExit.TabIndex = 3
    Me.btnExit.TabStop = False
    Me.btnExit.Text = "E&xit"
    '
    'txtMonths
    '
    Me.txtMonths.Location = New System.Drawing.Point(120, 80)
    Me.txtMonths.Name = "txtMonths"
    Me.txtMonths.TabIndex = 2
    Me.txtMonths.Text = ""
    '
    'Label4
    '
    Me.Label4.Location = New System.Drawing.Point(8, 112)
    Me.Label4.Name = "Label4"
    Me.Label4.TabIndex = 0
    Me.Label4.Text = "Final Balance"
    '
    'txtDeposit
    '
    Me.txtDeposit.Location = New System.Drawing.Point(120, 16)
    Me.txtDeposit.Name = "txtDeposit"
    Me.txtDeposit.TabIndex = 0
    Me.txtDeposit.Text = ""
    '
    'frmSavings
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(244, 225)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnExit, Me.btncalculate, Me.Label4, Me.txtFinal, Me.txtMonths, Me.txtInterest, Me.txtDeposit, Me.Label3, Me.Label2, Me.Label1})
    Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
    Me.Name = "frmSavings"
    Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
    Me.Text = "Savings Account"
    Me.ResumeLayout(False)

  End Sub

#End Region
  Dim Deposit As Double
  Dim Interest As Double
  Dim Months As Double
  Dim Final As Double

  Private Sub btncalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalculate.Click
    Dim IntRate As Double
    'read values from text boxes
    Deposit = Val(txtDeposit.Text)
    Interest = Val(txtInterest.Text)
    IntRate = Interest / 1200
    Months = Val(txtMonths.Text)
    'compute final value and put in text box
    Final = Deposit * ((1 + IntRate) ^ Months - 1) / IntRate
    txtFinal.Text = Format(Final, "0.00")
  End Sub


  Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
    End
  End Sub




End Class
