Visual Basic Please, no C++ The Middletown Wire copany sells spools of cooper wi
ID: 3763859 • Letter: V
Question
Visual Basic Please, no C++
The Middletown Wire copany sells spools of cooper wiring for $100 each. The nornal delivery charge is $10 per spool. Rush delivery costs $15 per spool. Create an applicatio that displays the status of an order. The status of an order should include the following:
-The number of spools ready to ship.
-The number of spools on back order.
-The shipping and handling charges.
-The total amount due.
The aplication's form should resemble the one shown in figure 6-24.
The user should enter the number of spools oredered into a text box, and check the Rush Delivery check box if rush delivery is desired.When calculate Total button is clicked, an input box should appear asking the user to enter the number of spools currently in stock. If the uer has ordered more spools than are in stock, a portion of the order is back-ordered. For example if the usr orders 200 spools and there are only 150 spools in stock, then 150 spools are ready to ship and 50 spools are back-ordered.
Explanation / Answer
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Integer = InputBox("Enter Stock")
Dim ord As Integer = Val(TextBox1.Text)
Dim backord, tot As Integer
If ord > a Then
ord = a
backord = ord - a
End If
If (CheckBox1.Checked) Then
tot = (ord * 100) + (ord * 15)
Else
tot = (ord * 100) + (ord * 10)
End If
MsgBox("Total bill is " & tot)
End Sub
End Class
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.