Question
Assignment 2: Online Pizza Ordering Description You are to develop a web application for online pizza ordering. You are to develop a customer ordering pages
Assignment 2:
Online Pizza Ordering Description You are to develop a web application for online pizza ordering. You are to develop a customer ordering pages where customers can place their orders, have their orders stored in the database, and obtain a receipt.
The Front Door
On the initial request from a customer, a web page should appear in his/her browser asking for some basic information: first name, last name, email address, phone number, street address and whether they are ordering for pick-up or delivery.
You should use HTML5 input attributes to control the user as much as possible (e.g. type=email, type=tel, required, selected, etc.) If is able to get past the page without providing all the information, an error page should appear indicating problem with a hyperlink back to the first page.
The Order Page
If the user submits the information correctly, they will get to the page for entering their order. This page should print a personalized welcome message and should contain the current view of their shopping cart. It should also contain a form they can use to add a pizza to the cart and a Proceed to Checkout link or button.
Order information for one pizza:
You will need to include form elements for the following:
1. Pizza size (S, M, L, XL). Prices are $9.99, $12.99, $14.99, and $19.99 (default: large)
2. A selection of at 10 extra toppings (in addition to cheese and sauce) that allows the users to select as many or as few as they want. Each topping adds $1 to the price of the pizza, but for every 3 toppings they choose they get a fourth for free.
Add another pizza: When the user presses the Add Pizza button, the page should reload, the pizza they ordered should appear in the shopping cart section, and they should be able to use the form to add another pizza. You could choose to use one or more servlets here, but it should look to the user like they never left the ordering page.
The Receipt page
When the user clicks the Proceed to Checkout link, they should get to a receipt page where they find the following: 1. Their user information from the welcome page
2. A summary of their order with the price of each item
3. The tax (13%)
4. The final total
5. The estimated delivery time (current time plus 45 minutes) or pickup time (current time plus 20 minutes) This page should also save their order to the database.
Structure
You should construct your web app according to the multi-tier architecture for web apps that we have been developing in class.
Presentation Tier
This Tier consists of HTML and CSS files plus HTML output from Servlets.
- All HTML pages should link to a common CSS file.
- Try to make the presentation of the site look ok, using images and CSS rules to make it look at least a little bit like a pizza ordering site.
- Use appropriate HTML5 form elements and attributes to control the user as much as possible. It should be hard for the user to send bad data to your Servlets.
- All errors should be handled gracefully with some kind of an error page or error message presented to the user and, if appropriate, a chance to go back and start again.
Application Tier
This Tier consists of Servlets and other Java objects in three separate layers (use three different packages to make the distinction clear).
Web Code
This layer consists of Servlets to receive HTTP requests issue HTTP responses. Servlets should save information from the customer in a Session object until it is time to commit the information to the database, then the Session should be invalidated.
Business Code
This layer consists of classes with methods to implement pricing rules and to create objects to store information about the customer and their orders. (Example: You might have a Pizza class that can be used to store information about a pizza but which also has Static methods for adding up prices, calculating taxes, etc. over a list of Pizza objects. Or you might prefer to have methods for adding up prices in a different class altogether.)
Data Access Code
This layer consists of a Data Access object that connects and disconnects from the database and commits orders to the database. If a customer orders multiple pizzas, each pizza they are ordering should appear as a single order in the database.
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