Everything in a Sandwich Rewards App - Upgrading Software and JavaFX
Text-Based Starter Code
Access Text-Based Starter Classes Here
Text-Based Missions
Mission 1
You have been hired to update the Everything On a Sandwich rewards app. The company would like the software to be running on the latest version of Java. This is an effort to make the app more modern and data oriented. To do this, complete the following:
- Identify classes that are representing data rather than actual objects.
- Remodel this data as a record instead.
In
RewardAppStarter.java, there are two comments that prompt you to:
- Replace if statements with switch statements or expressions
- Update output to use textblocks
Mission 2
The current app only allows for rewards that apply to all customers. Modify the app to allow customers to earn rewards that are specific to them.
Mission 3
Modify the app to include a birthday reward where customers receive one free cookie if purchased the week before or after their birthday.
Mission 4
The company would like to reward customers for their loyalty by having them earn points based on their purchases at Everything On a Sandwich. Modify the app to keep track of a customers loyalty points. Loyalty points should start at 0 and can be increased.
Note: You do not need to add the actual functionality for when to update the points based on the purchases at this time.
Mission 5
Modify the app to include special reward based on the number of points a customer has earned. The following table can be used to set the discounts:
| Number of points |
Discount |
| 1,000 |
$2.00 |
| 5,000 |
$5.00 |
| 10,000 |
$7.00 |
| 20,000 |
$10.00 |
| ------------------------------ |
------------- |
For each 20,000 points after, the customer will receive an additional $10.00 discount on their purchase.
The discount amount can only be applied to a single purchase and any discounted money that isn’t needed for the bill will be forfeit. For example, if the customer has 20,000 points, but their bill is $9.50. The customer will receive their meal for free. The additional $0.50 discount will be forfeit.
Once the customer uses a discount, that number of points is subtracted from their total number of points. For example, a customer has 7,000 points and purchases a cookie and a drink for $2.10. They choose to use the 1,000-point discount and pay the $0.10 in cash. Their new point total is 6,000 points.