The project should display a different amount if the new release check box and the dvd {or vhs} radio button are both checked, its displaying the regular price.
This is my code:
Option Strict On
Public Class videoBonanzaSaleForm
Inherits System.Windows.Forms.Form
' Declare Constants
Const DVD_PRICE_Decimal As Decimal = 2.5D
Const NEW_RELEASE_DVD_Decimal As Decimal = 3D
Const VHS_PRICE_Decimal As Decimal = 1.8D
Const NEW_RELEASE_VHS_Decimal As Decimal = 2D
Const DISCOUNT_RATE_Decimal As Decimal = 0.1D
' Declare module-level variables.
Dim customerCountInteger As Integer
Dim grandTotalDecimal, totalDecimal, itemAmountDecimal As Decimal
Private Sub calculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculateButton.Click
' Calculate and display the current amounts.
Dim priceDecimal, discountDecimal As Decimal
If titleTextBox.Text <> "" Then
If dvdRadioButton.Checked = True Or vhsRadioButton.Checked = True Then
' Find the price.
If dvdRadioButton.Checked Then
priceDecimal = DVD_PRICE_Decimal
ElseIf vhsRadioButton.Checked Then
priceDecimal = VHS_PRICE_Decimal
ElseIf newReleaseCheckBox.Checked And dvdRadioButton.Checked Then
priceDecimal = NEW_RELEASE_DVD_Decimal
ElseIf newReleaseCheckBox.Checked And vhsRadioButton.Checked Then
priceDecimal = NEW_RELEASE_VHS_Decimal
End If
' Calculate the extended price and add to order total.
If memberCheckBox.Checked Then
discountDecimal = priceDecimal * DISCOUNT_RATE_Decimal
Else
discountDecimal = 0
End If
itemAmountDecimal = priceDecimal - discountDecimal
totalDecimal += itemAmountDecimal
itemAmountLabel.Text = itemAmountDecimal.ToString("C")
totalLabel.Text = totalDecimal.ToString("C")
Else
MessageBox.Show("A Movies Format Must Be Selected", "Data Entry Error", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Else
MessageBox.Show("A Title Must Be Entered.", "Data Enrty Error", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
titleTextBox.Focus()
End If
' Allow a change only for a new order.
memberCheckBox.Enabled = False
' Allow clear after an order has begun.
clearButton.Enabled = True
' Reset format Radio Buttons and clear text box.
vhsRadioButton.Checked = False
dvdRadioButton.Checked = False
titleTextBox.Clear()
End Sub