1. Engineering
  2. Computer Science
  3. topic 6 more decisions conditionalswitch requirements for chapter 6 zylab...

Question: topic 6 more decisions conditionalswitch requirements for chapter 6 zylab...

Question details

Topic 6: More Decisions: conditional/switch Requirements for chapter 6 zyLab Full Program: Extend Decisions Program for writing Java programming

The local concert venue you wrote the program for in Topic 5 would like you to modify the program to handle an extended options.

Topic 5 can be found below.

https://www.Zookal.com/homework-help/questions-and-answers/topic-5-decision-flow-control-statements-requirements-chapter-5-zylab-full-program-decisio-q31819028?trackid=75c70559cdf8&strackid=430de25b5680&ii=1

 In addition to concert events, the venue has added DJ dancing events.

o Concerts tickets will now cost:

 44.00 each, if fewer than 10 tickets are purchased together

 40.00 each, if 10 or more tickets are purchased together o DJ dancing tickets will cost:

 25.00 each, if fewer than 10 tickets are purchased together

 20.00 each, if 10 or more tickets are purchased together

 The seating options have also been expanded. Choice are now:

o Floor tickets for free o Bleacher-type open seating for an additional $4.99 each o Reserved row seats for an additional $9.99 each o Reserved seats at a table for an additional $15.99 each

 T-shirts will now be priced according to how many are purchased, as follows: o $22.95 per shirt for 1 – 5 shirts o $21.25 per shirt for 6 – 12 shirts o $19.00 per shirt for more than 12 shirts

(1) Again, the program must use constants for ALL fixed prices, and for the ticket count and t-shirt count discount thresholds (so there should be no hardcoded numbers in the program calculations).

 Create the necessary constants (and remove old constants that no longer apply to the program) Read all the inputs from the users, after creating appropriate variables to hold each answer. Inputs are:

 Whether the customer wants tickets for (1) a concert or (2) a DJ dancing event. o After reading the user input, assign a value to a String variable that will hold a String description of the event type chosen (concert or DJ dancing).

 The number of tickets (include the customer’s event type in the prompt)

 What kind of seating the customer wants o Display a menu of choices to the user. o After reading the user input, assign a value to a String variable to hold a description of the seating chosen (floor, bleachers, row seat, or table)

 How many T-shirts to include

Sample input reading: Ticket Purchase Ordering System Enter 1 for the concert or 2 for DJ dancing: How many concert tickets? 10 Seating options are F-floor (no seats) Bbleachers (open seating) Rrow seats (reserved) T - table seats (reserved) Enter choice: How many t-shirts? 10

(2) Tests 1 – 3 Display 2 blank lines after reading all inputs. Then display an order summary.

 All order details should line up on the right with the last character in position 35.

 The event type should be displayed as the String description (not a number).

 The seating type should be displayed as the String description (not a letter).

 Only display the number of t-shirts ordered when the customer has actually ordered t-shirts. Otherwise, do not display the t-shirt order line

Sample order summary displa: TICKET ORDER Event type: Number of tickets: Seating type: Number of t-shirts concert 10 bleachers 1.0

(3) Tests 4 – 7 Calculate the bill information, including the total, using decisions to determine:

 Cost per ticket

 Cost per seat

 Cost per t-shirt Display a blank line. Then display the bill information, lined up on the right, ending at position 35, just like the order information above. All of the costs will still be under $10,000.00.

 Use decisions to control the following: o Do not display the seating cost, if the seating cost is 0 (i.e. floor). o Do not display the t-shirt cost, if t-shirt cost is 0 (i.e. no t-shirts were ordered). o Do not display the dividing line and total cost if there is ONLY a ticket cost (i.e. seating and t-shirt costs were both 0). This means that you will display only the ticket cost if there are no other costs.

Sample bill display: TICKET BILL Ticket cost: Seating cost: T-shirt cost: 400.00 49.90 212.50 Total 662.40

(4) Test 8 When the user enters anything other than f/F/b/B/r/R/t/T for the seating type

 Display the error message: Invalid choice - floor will be used

 Adjust the seating type accordingly

(5) Tests 9 & 10 To prevent scalping of concert tickets, no more than 25 concert tickets will be sold together (but there is no limit on DJ dancing tickets).

 Create a constant to hold the limit for concert tickets (25).

 After reading the number of tickets user input, decide whether the number of tickets purchased is valid, as follows: o When a user tries to buy more than 25 concert tickets:

 Display an error message that includes the defined constant, saying that the order will be adjusted to the maximum allowed.

 Adjust the number of tickets accordingly.

Tests 11 & 12 To prevent “coding to the tests”, the last tests in this zyLab are blind test. You will not be shown the inputs or outputs – the test platform will only tell you if you passed or failed the tests. If the previous code was written correctly, your program should also pass these tests.Sample Run 2 (smaller number of tickets, floor, no t-shirts): Ticket Purchase Ordering System Enter 1 for the concert or 2 for DJ dancing: 2 How many DJ dancing tickets? Seating options are F floor (no seats) Bbleachers (open seating) Rrow seats (reserved) T-table seats (reserved) Enter choice: How many t-shirts? TICKET ORDER Event type: Number of tickets: Seating type: DJ dancing floor TICKET BILL Ticket cost: 175.00

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution