Question: Problem Description: Congratulations! Your budding Java skills have gotten you a promotion at the local 50-screen megaplex, up from the ticket counter to the IT

Problem Description:
Congratulations! Your budding Java skills have gotten you a promotion at the local 50-screen megaplex, up from the ticket counter to the IT department as an associate software engineer. Management is trying to develop a new ticket pricing strategy that will simplify pricing, attract customers, and still maximize revenues.
Actual ticket pricing is still being determined, but for starters they want you to come up with some simple prototype code, to determine which one of 5 ticket pricing rates should be charged, based upon the following 3 input parameters:
Day of the week
Time of day
Patron age
[int: 1=Monday to 7=Sunday]
[boolean: false=afternoon, true=evening]
[int: 0 or greater]
Your program simply needs to prompt the user for the above 3 pieces of data, and determine whether each of the 5 pricing rates will be true or false.
Each ticket pricing rate will be represented by ONE compound conditional expression. All 5 conditional expressions are mutually exclusive, such that only ONE of the rates can be true at any one time: the other 4 rates must be false.
Heres one example of such a (bogus) conditional expression:
// declarations boolean rateZ;
// computations
rateZ = ( ( (age >= SENIOR) && (day != SUNDAY) ) || (!time) );
In the above example: rateZ is (when the age is greater than or equal to 60) AND (the day is not Sunday), OR (whenever its an afternoon show).
See the movie ticket rates matrix on the following page for the specifics. On this diagram:
The 3 user inputs are indicated in RED [2 ints, 1 boolean], you need to prompt for these.
Explanations for each of the rates are as shown.
Use named CONSTANTS for age and day of week values, for example: final int SENIOR = 60;
final int MONDAY = 1; etc.
You need to come up with one (compound) conditional expression, for each of the 5 colored ticket price regions.
The 5 output rates will all be boolean T/F conditional variables, similar to the example shown above and discussed in the weekly lecture materials.
Requirements: Name your file ConditionsFL.java
1. Data Input:
Using Scanner, prompt the user for the following 3 items of input data:
o day number: 1=Monday up to 7=Sunday [int]
o time of day: either afternoon or evening, only 2 possible values, so: [boolean]
Forautomatedtesting,mustuse: afternoon=false,evening=true o patron age: 0 on upward [int]
For now, you can assume that all data is entered properly, so no error checking needed.
Make sure your prompts are very clear and specific about what is requested.
Use format strings and format specifiers exclusively for the input prompts.
o Think in terms of fixed-width label text (%Ns)
o NO TABBING or hardcoded whitespace for this input!
2. Computations:
See the ticket pricing matrix on the prior page.
Use named CONSTANTS for the various age and date boundaries in your condition
logic, not hardcoded numeric values. Declare these at the head of your file as usual.
Review sample output below
 Problem Description: Congratulations! Your budding Java skills have gotten you a

3GRASP execs javs ConditionsRL JGRASP exect 3ava ConditionaRL MOVIE RATES Enter day of week (1-Mon 7-Sun) s Evening shov? > true Enter patron age 67 Enter day of veek (1-Hon7-Sum)> Evening show?> true Enter patron age > 2 talae Rate 0 (no charge) Rate 1 (kids race) Rate 0 (no charge) t Rate 1 (kids rate) s Rate 2 (senior rate) Ealse Rate 3 (discount showa) false Rate 4 (fall price): Rate 2 (enior zace) true Rate 3 (disoount showa): talse Race(full price) tai " GRASP operation complete. GRASP ExECS 3avs ConditionaR GRasP execs 3avs Conditio E RATES ATES Enter day of veek (1-Hon Evening show? > false Enter patron age > 42 Enter day of veek (1 Evening show?> talse Enter patron age > Rate 0 (no charge) s talse Rate tno charge) Rate i (kids zate) Rate 2 (eensor rate) alae Rate (full price): coumt shows)s RASPI operation conpiete Race 4 (511 price) talse Enter day of veek (1-Mon 7-5un) 2 Evening show? > Enter patzon age > 45 ate o (no charge) t kate 3 (as.count how111 talat GRASP: opezation complece MacBook Air 888 F 2 3 4 8 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!