The final project will be based on the beginning of the course. It will be to develop a small JSF application to order lunch. You will select one sandwich and then you can select multiple drinks. So the form would look something like this: see image.

You will need text fields for first name, last name, street address, city, state, and zip. Use a drop down list to select a sandwich. Place three types of sandwiches in the list.

Create check boxes for three drinks.

Create a text box to enter a value for a tip.

Your form does not have to look exactly like mine. Just make sure you have all the fields.

The fields on the form need to correspond to fields in a Java Bean.

Use the following validation checks:

  • The first and last names are required.
  • Only allow 2 characters to be entered for the state.
  • For the tip set it so 2 digits to the right of the decimal are entered

Make sure you have a place where error messages will appear when the form is not filled out correctly for those fields that have validation.

The submit button will call a method in the bean to calculate the total for the order. The method will have the prices for the different types of sandwiches and drinks. The total will be calculated and stored in a field in the bean with get and set methods.

The method will return a String that is the name of the next .html page to be displayed.

That page should look something like this: see image.

Only display the drinks that were selected on the previous form.

For the tip and the total, display these as currency.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.