title: Discount and Interest rate program in vb.net
body: <p>I am trying to figure out how to finish this program and get the calculations to display in the textboxes. This is what I have so far and basically the code will take the purchase price and the redemption rate and calculate the discount and interest rate. Not sure what I am doing wrong though.    </p>
  
  <pre><code>Option Strict On
  
  Public Class _Default
      Inherits System.Web.UI.Page
  
      Dim Purchase As Double
      Dim Redemption As Double
      Dim DiscountRate As Double
      Dim InterestRate As Double
  
      Protected Sub btnCalculate_Click(sender As Object, e As EventArgs) _
                                              Handles btnCalculate.Click
  
          Double.TryParse(txtPurchase.Text, Purchase)
          Double.TryParse(txtRedemption.Text, Redemption)
          Double.TryParse(txtDiscount.Text, DiscountRate)
          Double.TryParse(txtInterest.Text, InterestRate)
  
          If (CDbl(txtPurchase.Text) &lt;= 0) Then
              MsgBox("Please enter an amount greater than 0")
  
          End If
  
          If (CDbl(txtRedemption.Text) &lt;= 0) Then
              MsgBox("Please enter an amount greater than 0")
          End If
  
          DiscountRate = Purchase - Redemption / Purchase
          InterestRate = Purchase - Redemption / Redemption
  
      End Sub
  End Class
  </code></pre>