Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Visual Basic Open the Shipping Solution (Shipping Solution.sln) file contained in the VB2015 Chap09Shipping Solution-Two-Dimensional folder. The btnDisplay_Click procedure should display a shipping charge that

Visual Basic

Open the Shipping Solution (Shipping Solution.sln) file contained in the VB2015\ Chap09\Shipping Solution-Two-Dimensional folder. The btnDisplay_Click procedure should display a shipping charge that is based on the number of items a customer orders. The order amounts and shipping charges are listed in Figure 9-57. Store the minimum order amounts and shipping charges in a two-dimensional array. Display the appropriate shipping charge with a dollar sign and two decimal places. Test the application appropriately.

image text in transcribed

This is what i have how do i make it two dim array.

Public Class frmMain Private Sub btnExit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub txtPoints_Enter(ByVal sender As Object, ByVal e As EventArgs) Handles txtPoints.Enter txtPoints.SelectAll() End Sub Private Sub txtPoints_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles txtPoints.KeyPress ' accepts only numbers and the Backspace key If (e.KeyChar "9") AndAlso e.KeyChar ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtPoints_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles txtPoints.TextChanged lblGrade.Text = String.Empty End Sub Private Sub btnDisplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDisplay.Click

' Display the letter grade associated with a students total points earned.

Dim intGrade As Integer Dim searchForPoints As Integer

Dim intPoints() As Integer = {450, 400, 350, 300, 0}

Dim strGrades() As String = {"A", "B", "C", "D", "F"}

' Assign a letter grade to a variable.

searchForPoints = Integer.Parse(txtPoints.Text)

For intGrade = 0 To 4

If searchForPoints

lblGrade.Text = strGrades(intGrade + 1)

ElseIf searchForPoints = intPoints(intGrade) Or searchForPoints

lblGrade.Text = strGrades(intGrade)

ElseIf searchForPoints > 450 Then

searchForPoints = intPoints(intGrade)

lblGrade.Text = strGrades(intGrade)

End If

Next

End Sub

End Class

Minimum points Maximum points Grade 299 300 349 414 350 415 464 500 465 Minimum points Maximum points Grade 299 300 349 414 350 415 464 500 465

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

What information should be placed on a decision tree?

Answered: 1 week ago