Skip to content

YearUp-PluralSight-Backend/DELIcious-Sandwich-Shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sandwich Shop Ordering System

Capstone Two Project

Description

The Sandwich Shop Ordering System is a Java-based application designed to help users customize, order, and track their sandwich purchases in a simple and intuitive manner. This project uses object-oriented principles and design patterns to handle different sandwich components like bread, meat, cheese, vegetables, sauces, and beverages. The system allows customers to easily create custom sandwiches or select from preset options, add side items like chips and drinks, and process orders with detailed receipts.

Features:

  • Sandwich Customization: Users can choose from various types of bread, meats, cheeses, vegetables, and sauces to create a personalized sandwich.
  • Preset Sandwiches: Users can also select preset sandwich combinations from the menu.
  • Order Processing: The application calculates the total cost and calories of the order.
  • Receipt Generation: After checkout, a detailed receipt is generated and saved as JSON and Text file.
  • User-Friendly Interface: A console-based UI that interacts with users, displaying relevant information and guiding them through the ordering process.

Design Patterns Implementation

Singleton

Command Pattern

Builder Pattern

Screenshots

Main Menu

Home Screen
home screen
Order Screen
order screen

Order summary

order summary

Receipt

Home Screen
text format receipt
json format receipt

Interesting Piece of Code

***One interesting aspect of this project is the **dynamic receipt generation** that handles various sandwich components and formats them neatly into a readable string output. The following code snippet formats the sandwich ingredients, including bread, meats, cheeses, and additional ingredients, into a table-like structure with proper alignment:***
private static void appendIngredientDetails(StringBuilder stringBuilder, String prefix, String name, double price, double calories) {
  stringBuilder.append("║  ").append(prefix)
          .append(String.format("%-20s", name)) 
          .append(String.format("%.2f", price)) 
          .append("\t\t").append(String.format("%.1f", calories)) 
          .append("\n");
}

This method allows us to maintain consistent formatting when displaying the sandwich order details in a user-friendly manner.

UML Diagrams

Below is a screenshot of the UML class diagram used to structure the application’s classes and their relationships:

UML Class Diagram

UML Class Diagram

the class is a diagram that shows the relationship between objects in a system. It describes the structure of the system by showing the system's classes, attributes, operations, and the relationships among the classes.

Class Diagram

UML Use Case Diagram

A use case diagram is a graphical representation of the interactions between the system and the actors that use the system. It shows the relationship between the actors and the use cases within the system.

UML Use Case Diagram

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

DELIcious-Sandwich-Shop. |. capstone 2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published