Reference no: EM133920714
Object Oriented Programming
Programming Assignment
Overview
In this assignment, you will implement a simple Pizza Ordering System in Java using fundamental procedural programming concepts. The program allows users to place and manage a set of pizza orders and includes basic reporting and administrative features.
For this assignment, you must only use concepts covered in Weeks 1-7. This includes data types/variables, branching, loops, methods and objects. Arrays and ArrayLists (or any other collections), user-defined classes (other than the required single PizzaOrderingSystem class), file I/O, and exception handling are explicitly prohibited. Submissions violating these constraints will result in marks being deducted.
Carefully read the specification below. Make sure you have all the information necessary to start writing the program. If you are uncertain of something, do not make assumptions. Instead, post your questions to the "Programming Assignment 1" discussion board forum and check it regularly.
Note that you can complete this assignment either individually or in pairs (if you will be working as a pair, make sure to send an email to notify your course coordinator about this before you start working together). Your solution must be your own work. You may be required to participate in an oral exam for quality assurance, consisting of an interview with one staff and will last approximately 10 minutes. During this time, we will ask you questions about your assignment. Get expert-level assignment help in any subject.
Program Structure Requirements
You must implement a menu-driven console application (TIO) where users can place and manage pizza orders. The program must be a single class, PizzaOrderingSystem, and all data must be managed and stored within this single class. Your program should contain the following logical components:
Class Variables
Order Data Storage: Variables for tracking overall sales, order count, and details of the most recent order (such as its total cost, quantity, pizza type, size, adds-on cost, etc) for later modification or cancellation.
Statistics Counters: Counters for tracking the sales of each pizza type and size, as well as add-on items.
Methods
You must use a minimum of 10 methods to modularise your code. All I/O handling must be done within appropriate methods.
Functionality Requirements
The program must provide the following functionality:
Menu System
The program must display a main menu with 9 options:
View Pizza Menu
Place New Pizza Order
Compare Two Pizza Orders
Simulate Daily Special Offer
View Daily Sales Report
View Pizza Sales Statistics
Modify a Previous Order
Cancel an Order
Exit
The menu should re-display after each action until the user exits.
Core Functionality
View Pizza Menu: Display a hardcoded menu with the following three pizza types, each with S, M, and L sizes and corresponding prices.
∗ The menu must include the following pizzas and prices:
Name S Price M Price L Price
Margherita $8.00 $10.00 $12.00
Neapolitan $9.00 $11.00 $13.50
Marinara $9.50 $11.50 $14.00
Place New Pizza Order: This is the central function. It must:
∗ Prompt the user for pizza type, size, and quantity.
∗ Each new order can include a maximum of 10 pizzas, but only of a single type selected from the three available on the menu (i.e., mixed types of pizzas are not allowed within the same order).
∗ Use helper methods to ask/offer the user optional toppings (extra cheese, olives) and side items (garlic bread, soft drink). For example, "Would you like to add toppings and sides? (Y/N)", "Add Extra Cheese? (Y/N)", "Add Olives? (Y/N)", "Add Garlic Bread? (Y/N)", and "Add Soft Drink? (Y/N)"
∗ The prices for add-ons are as follows:
Extra Cheese: $1.50
Olives: $1.00
Garlic Bread: $4.00
Soft Drink: $2.50
∗ Calculate the subtotal (base cost + add-ons).
∗ Apply a 10% tax to the subtotal.
∗ Display a well-formatted receipt. The following is a sample receipt of 5 small Marinara pizzas with extra cheese in the required format:
Compare Two Pizza Orders:
∗ Prompt the user to select two different pizzas and their corresponding sizes.
∗ Display their prices and display which order is cheaper or if they are equal.
Simulate Daily Special Offer:
∗ Similar prompts and helper methods to those when placing a new order to get order details.
∗ Use Math.random() to select one of three pre-defined special offers (e.g., "Buy One, Get One Half Off", "20% off total", or "free side with a large pizza").
∗ The "Buy One, Get One Half Off" offer can only be applied to the total cost before tax if the user orders at least 2 pizzas.
∗ The program must then proceed with the order, applying the chosen special offer (while displaying an output message to the user) to the final calculation.
Modify a Previous Order:
∗ This option only applies to the immediately preceding order.
∗ The program should inform the user of the last order's details.
∗ Allow the user to change the size or quantity of this last order.
∗ Recalculate the cost and update the sales and all relevant statistics counters accord- ingly.
∗ Display an updated receipt.
Cancel an Order:
∗ This option also only applies to the immediately preceding order.
∗ Revert all total order sales/count, and all specific counters to their state before the last order was placed.
∗ Should prevent further modification/cancellation of the now-cancelled order.
View Daily Sales Report:
∗ Calculate and display the total orders and their total revenue for all orders placed during the program's execution.
∗ Calculate and display the average order value. Handle the case where no orders have been placed.
View Pizza Sales Statistics:
∗ Display a detailed breakdown of the total number of times each pizza type and size has been ordered (e.g., "Margherita: -Small: 5, - Medium: 3, - Large: 2").
∗ Display a summary of topping and side sales.
Input Handling:
All string/char inputs (e.g., "Margherita", 'S', 'L', 'Y', 'N') are case-insensitive.
Invalid numerical or string inputs for menu options, pizza types, sizes, etc., should re- prompt the user until valid input is received.
Report Document (PDF, max 3 pages)
As you design, write and test your solution, you are to keep track of and report (between 2 and 3 pages) on the following:
Keep track of how much time you spend designing, coding and correcting errors, and how many errors you need to correct.
Keep a log of what proportion of your errors come from design errors and what proportion from coding/implementation errors.
Screenshots of the program running (including creating/removing projects, managing/viewing projects and tasks and viewing project task duration summary).
Object-Oriented Design Reflection:
Reflect on the current procedural implementation and how it could be refactored using object-oriented principles, and any potential benefits as a result of that.
Identify key "objects" that could be represented as classes.
Provide a high-level description of at least two classes you would create and the attributes (private variables) and methods they would contain using UML diagrams.
Working as a Pair (two students)
You may complete this assignment and the next as a pair if you wish (this is not compulsory). Note if you have special requirements that involve any adjustment to your program you must work as an individual. Students who wish to work in pairs will select their own partners and will need to send this information via an email to their course coordinator before they start working together. Each student in a pair will receive the same mark for the assignment, regardless of how the workload was distributed. However, we expect all team members to contribute to every part of the assignment. For example, you cannot have one team member solely handling one class implementation, while the other is working.
Use of Generative AI/LLMs
According to Student Conduct policies, all submitted work must be your own original work. This means that the use of Generative AI tools like ChatGPT or similar platforms is not permitted for writing or drafting any assessment, including both code and documentation.