Skip Top Navigation Bar

Everything in a Sandwich Rewards App - Upgrading Software and JavaFX

The owners of Everything In a Sandwich restaurant have a rewards app for their customers to get discounts. The app was written in Java 8 and the company would like you to upgrade the app to the latest version in an effort to keep the app current. They are also asking for a few new features to be added to the app.

This series of missions requires you to write program code to use the following topics. Tutorials for available topics have been linked.

App Contents

The current app creates customer profiles with the following information:

The current app has rewards that apply to all customers of the app. These rewards contain the name of the offer, the amount of discount the customer will receive, and an expiration date for using the offer.

Text-Based Set Up

Add all six starter classes to your project.

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:

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.

JavaFX Setup

Now that you are familiar with the rewards app, let's make the switch to a visual interface by using JavaFX.

We recommed using intelliJ and SceneBuilder for this project. For those unfamiliar with JavaFX and SceneBuilder, work through this Scene Builder Set-up and Overview first.

Set-up a new JavaFX project and add your the following files from your text-based project:

Add the additional JavaFX Starter files.

Image of app with rewards app logo. It has two buttons. One for register and one rewards.

JavaFX Missions

Mission 1

Modify the app so that the subscriber can update their contact information. To make this modification, you will need to modify the apps interface by adding a new scene.

Mission 2

This company is looking for your input. Write a proposal for a new modification or enhancement for the app. Once this is approved, implement the change by modifying the app.

Mission 3

Investigate what happens on the registration page if you click submit without entering any information? Modify the app so that customer information is required to contain information to enroll as a subscriber of the app.