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

Form application or Console…Visual Studio C# Create an application that can be u

ID: 3673789 • Letter: F

Question

Form application or Console…Visual Studio C#

Create an application that can be used to calculate the total amount due for purchases. Allow any number of items to be entered. Determine the total due including sales tax and shipping. Sales tax of 7.75% is charged against the total purchases. Shipping charges can be determined based on the number of items purchased. Use the following chart to determine the shipping charge. Fewer than 3 items $3.50 3 to 6 items $5.00 7 to 10 items $7.00 11 to 15 items $9.00 more than 15 items $10.00

Display an itemized summary containing the total purchase charge, number of items purchased, sales tax amount, shipping charge, and grand total.

Explanation / Answer

Option Strict On Public Class Form1 Dim OrderLines As List(Of OrderLine) = New List(Of OrderLine) Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click Dim intQuantity As Integer If Not Integer.TryParse(txtQuantity.Text, intQuantity) Then MsgBox("Error in entering quantity") Exit Sub End If Dim decPrice As Decimal If Not Decimal.TryParse(txtPrice.Text, decPrice) Then MsgBox("Error in entering price") Exit Sub End If Dim decTotal As Decimal = decPrice * CDec(intQuantity) txtTotal.Text = decTotal.ToString OrderLines.Add(New OrderLine(txtItem.Text, intQuantity, decPrice)) ListUpdate() End Sub Private Sub ListUpdate() ListBox1.Items.Clear() For Each O As OrderLine In OrderLines ListBox1.Items.Add(O.ToString) Next End Sub Private Structure OrderLine Dim LineItem As String Dim LineQuantity As Integer Dim LinePrice As Decimal Public Sub New(ByVal Item As String, ByVal Quantity As Integer, ByVal Price As Decimal) LineItem = Item LineQuantity = Quantity LinePrice = Price End Sub Public Overloads Function ToString() As String Return LineItem & " " & LinePrice.ToString _ & " " & LineQuantity.ToString _ & " " & (LinePrice * CDec(LineQuantity)).ToString End Function End Structure End Class

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote