Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Visual Basic Programming Project Design an application that determines the total

ID: 671992 • Letter: V

Question

Visual Basic Programming Project

Design an application that determines the total cost of a gym membership at “Bust a Gut Gym” based on membership options as follows:

Title bar shows the name of the gym.

The user will enter a membership beginning date and a membership end date.

Compute the total cost of the gym membership based on a cost of $2.50 per day (use a date function to determine the number of days from the beginning date to end date.

The user can also select one or more types of memberships options using check boxes:

Spa” has a one-time fee of $300.00 regardless of the time period

Linens” has a one-time fee of $100.00 regardless of the time period.

Add a button to display the itemized membership bill.

Add another button to show the grand/total cost which includes a surcharge of 10% of the total membership cost.

Use whatever other controls or functions you deem appropriate.

Explanation / Answer

Public Class Form1
Public tot As Double
  
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim d1, d2 As New Date

Dim c As TimeSpan

'Dim tot As Double

d1 = Convert.ToDateTime(TextBox1.Text)
d2 = Convert.ToDateTime(TextBox2.Text)

c = d2.Subtract(d1)
tot = c.Days * 2.5

If (CheckBox1.Checked = True) Then
tot = tot + 300
End If

If (CheckBox2.Checked = True) Then
tot = tot + 100
End If

MsgBox("Membership bill is " & tot)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim grn As Double
grn = (tot * 10 / 100) + tot
MsgBox("Grand Total " & grn)
End Sub
End Class