d number of end zone tickets. Both number of ticket textboxes should contain 0 initially. Your program should display (using a listbox) the name (in firstName(space)lastName format), invoice number, sideline ticket subtotal, endzone ticket subtotal, and total order cost. The subtotals and total should formatted to currency. Tickets prices are set as follows: - Sideline tickets - $35 - End Zone tickets - $15 In addition to the above ticket cost, the fan has to pay a $1.00 service charge per ticket. For each order (each time Calculate Cost

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

Write a program that will take orders for upcoming football game tickets and will let the user know the total
cost of their order.
The fan is to be prompted (using textboxes) to enter their name (in lastName,(space)firstName format), number
of sideline tickets, and number of end zone tickets. Both number of ticket textboxes should contain 0 initially.
Your program should display (using a listbox) the name (in firstName(space)lastName format), invoice number,
sideline ticket subtotal, endzone ticket subtotal, and total order cost. The subtotals and total should formatted to
currency.
Tickets prices are set as follows:
- Sideline tickets - $35
- End Zone tickets - $15
In addition to the above ticket cost, the fan has to pay a $1.00 service charge per ticket.
For each order (each time Calculate Cost is clicked), an invoice number needs to be generated. The format of
this number is:
- First two letters of the first name (Upper Case)
- First two letters of the last name (Upper Case)
- Hyphen (dash/minus) “-“
- Current order number
o (Note: Order number should be set as a class variable. The initial value should be 1000. After
successfully processing an order, the order number should be incremented by 1.)
- Hyphen (dash/minus) “-“
- Total number of tickets
Your program should have three button events. These should perform the following tasks:
- Calculate Cost (perform the calculations and display the output).
- Clear Form (clear the name, reset tickets to 0, clear the listbox, and set the focus to the first textbox).
- Exit (end the program).

 

*******CORRECT MY CODE WITHOUT USING IF STATEMENTS"*********

Dim name As String
name = txtName.Text
Dim sname As String() = name.Split(" , ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
Dim fname, lname As String
fname = sname(0).ToUpper()
lname = sname(1).ToUpper()
Dim invoice As String
Dim orderNumber As String
invoice = fname(0) + lname(0) + fname(1) + "FB" + Str(orderNumber)
Dim sideline, endzone As Integer
sideline = Convert.ToUInt32(txtSideline.Text)
endzone = Convert.ToUInt32(txtEnd.Text)
Dim sideCost, endCost, finalCost As Double
sideCost = sideline * 20.0
endCost = endzone * 10.0
finalCost = sideCost + endCost + (1.0 * (sideline + endzone))
lstOutput.Items.Add("Customer Name: " + String.Format("{0, 10}", lname(1)) + " " + String.Format("{0,-10}", fname(0)))
lstOutput.Items.Add("Invoice Number: " + String.Format("{0, 10}", invoice))
lstOutput.Items.Add("Sideline Tickets: " + String.Format("{0,10}", " $") + sideCost.ToString("0.00"))
lstOutput.Items.Add("End Zone Tickets: " + String.Format("{0,10}", " $") + endCost.ToString("0.00"))
lstOutput.Items.Add("Total Cost: " + String.Format("{0,20}", " $") + finalCost.ToString("0.00"))
orderNumber = orderNumber + 1
End Sub

Private Sub btnClearForm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtSideline.Text = "0"
txtEnd.Text = "0"
txtName.Text = ""
lstOutput.Items.Clear()
End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class

Expert Solution
Step 1: The given code contains the below errors `
  • Incorrect Formatting of the Invoice Number
  • Incorrect Ticket Price Calculation:
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education