Question
This is a Java Question Your half-sisters great uncle twice removed, Jesse, is a carnie in a small, traveling group of misfits calling their organization
This is a Java Question
Your half-sisters great uncle twice removed, Jesse, is a carnie in a small, traveling group of misfits calling their organization the Lucky Day Carnival. Youve been hired as a consultant to help them with a program that will make ticket sales faster by doing the calculations for them. Unfortunately, your half-sisters great uncle twice removed is a stubborn man and he will not like this program and wont pay you if it doesnt do exactly what he says, even if there is an easier way so make sure you explicitly follow all of his directions and meet all of his requirements!
Housekeeping Section:
Uncle Jesse says: Tickets are sold based on age. Normal adult tickets are priced at $10.50 each. Tickets for children are priced at half of the adult rate. If the group contains at least one senior, the ENTIRE GROUP gets a discount -- 10% off each ticket price.
Uncle Jesse says: I want the program to use three variables for the number of people in a party, one for the total number of adults, one for the total number of seniors, and one for the total number of children. For our test, we will have 3 adults, one of which is a senior, and 1 child.
1. Declare variables for the number of adults, children, and seniors. (Hint: these variables will not contain decimals; you cant have half a person!). Initialize the number of adults, seniors, and children to the information youve been given.
Uncle Jesse says: I next want the program to calculate the cost of the tickets for each group. These variables will hold monetary values.
2. Declare variables for ticket prices, for total ticket charge for each sub group, and for the grand total charge (and any others you might need). Initialize the adult price as $10.50. (Hint: monetary variables need decimal points).
Uncle Jesse says: Child ticket prices should always be half the adult ticket price, even if I change the adult price. So when you assign a value to that variable, make it based on the adult price variable.
3. Set the child ticket price as half the variable for the adult ticket price.
4. Create a header for your program. Uncle Jesse doesn't care what you call it!
Main Logic Section:
Use a simple decision statement so the program can determine whether or not to give the senior discount (Hint: You only get the discount if you have seniors in the group!).
Calculate the total charge for all of the adult tickets.
Use a simple decision statement to determine whether or not to calculate the child tickets and adjust the total price as necessary. (Hint: If we have no children in the group, why bother?)
4. Add all sub totals together and store in the appropriate variable.
End of File Section:
Uncle Jesse says: This is what the output should look like:
XYZ Carnival Ticket System (or whatever you named it!)
The total charge for adults is $28.35
The total charge for children is $5.25
The total charge for the tickets is $33.6
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