Question
Java programming help 1. Write a program that uses the following static methods to determine the total price of ordering tickets to a local concert.
Java programming help
1. Write a program that uses the following static methods to determine the total price of ordering tickets to a local concert. Adult tickets costs $25 each. Children's tickets costs $20 each.
getAdultQuantity This method should ask the user to enter the number of adult tickets to purchase and then return the value as an int.
getKidQuantity This method should ask the user to enter the number of child tickets to purchase and then return the value as an int.
calculateTicketTotal This method should accept both the quantity of adult and child tickets as arguments. Calculate and return the total for the tickets (a double).
calculateFee This method should accept the ticket total as an argument and return the processing fee (a double). The fee is 7% of the total.
printReceipt This method should accept the quantity of adult tickets, quantity of child tickets, ticket total, and processing fee. It should calculate the grand total and display a receipt which includes quantities, ticket total, fees and grand total.
For example, if the user ordered 3 adult tickets and 2 child tickets, the receipt might look like this:
Box Office
3 adults @ 25 = 75.00
2 children @ 20 = 40.00 Ticket total = $115.00
Processing fee = $8.50
Grand Total = $123.50 Enjoy the show!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started