book = Microsoft Visual Basic 2015 RELOADED
problem = Chapter 4, page 224, exercise #21
In Visual Studio 2015 I need to create an application that determines whether a customer is entitled to free shipping when ordering from JimJoe’s website. JimJoe’s does not charge shipping on any order when the customer belongs to the JimJoe’s Free Shipping Club. It also doesn’t charge shipping for any order totaling $100 or more. The application should display one of the following messages: “Your shipping is free!” or “You will be charged for shipping.”
Editable code:
Public Class Form1
Dim customer(0 To 6) As String
Dim flag As Boolean
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
flag = 0
customer(0) = "Felina"
customer(1) = "Bianca"
customer(2) = "Sonali"
customer(3) = "Jin"
customer(4) = "Paul"
customer(5) = "Carl"
customer(6) = "Cathrene"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs)
Handles Button1.Click
For i = 0 To 6
If (customer(i).Equals(TextBox1.Text) Or TextBox2.Text >= 100)
Then
flag = 1
End If
Next
If (flag) Then
MsgBox("Your shipping is free!")
Else
MsgBox("You will be charged for shipping.")
End If
flag = 0
End Sub
End Class
Get Answers For Free
Most questions answered within 1 hours.