Skip to content

Comprehensive deli application that allows users to order items on a menu and customize items and orders.

Notifications You must be signed in to change notification settings

sekwanaa/Sekwanaas-Deli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DELI-cious App

Welcome to the Sekwanaas-Deli repository! This project is a comprehensive Java-based application designed to manage a delicatessen's orders efficiently

Features

Order Processing

  • Create Orders: Generate new orders by selecting whether users want a Sandwich, Drinks, or Chips..
    • When ordering sandwiches, users can customize their sandwich based on size, bread type, which toppings they want, and the types of cheese or sauces on their sandwich.
    • When ordering drinks, users can choose the size of the drink that they would like and also choose the flavor/brand of the drink.
    • When ordering chip, users can choose which chip they would like to add.
  • Update Orders: Modify existing orders to reflect changes in customer requests.

Object-Oriented Programming (OOP) Principles

Encapsulation

  • Classes and Objects: The application is structured into various classes representing different entities like Product, Order, and Customer. Each class encapsulates its attributes and methods, promoting modularity and reusability.
  • Access Modifiers: Use of private and public access modifiers to protect the integrity of the data and expose only necessary methods.

Inheritance

  • Base and Derived Classes: The application utilizes inheritance where common functionalities are defined in base classes and specific behaviors are implemented in derived classes.

Polymorphism

  • Method Overriding: The application allows method overriding to enable specific implementations in derived classes, enhancing flexibility and scalability.

Abstraction

  • Abstract Classes and Interfaces: Abstract classes and interfaces are used to define the blueprint of the application, allowing different parts of the application to interact through well-defined interfaces.

A Look Into the Application

Project Flow Chart

Project_FlowChart

File Directory / Home Screen

image

Home Screen Class

image

Ordering Screen

image

Sandwich Creation Screen

image

Scanner Manager Class

The goal of this class is to allow the scanner to be used throughout the entire application without having to have a static scanner or have a scanner that is having to be passed through different methods. This class is able to get String, ints, or even doubles and handle any errors or wrong inputs without throwing exceptions.

image

Running Through the Application

Home Screen

image

Adding custom sandwich

image

image

image

Adding drinks

image

image

Adding chip

image

Order being printed and saved to receipts folder

image

Interesting Piece of Code

I chose this piece of code because the Inputs class allows for me to be able to use the scanner anywhere in my application without having to pass a scanner through any methods. It's also really interesting because it handles all the incorrect inputs as well.

import java.util.Scanner;

public class Inputs {
    private static Scanner scanner;

    private Inputs() {
    }

    //Methods
    // Method to open the Scanner
    public static void openScanner() {
        scanner = new Scanner(System.in);
    }

    // Method to close the Scanner
    public static void closeScanner() {
        if (scanner != null) {
            scanner.close();
            scanner = null;
        }
    }

    // Helper method to make sure scanner is open when calling a method
    private static void ensureScannerIsOpen() {
        if (scanner == null) {
            openScanner();
        }
    }

    public static String getString() {
        ensureScannerIsOpen();
        return scanner.nextLine();
    }

    public static int getInt() {
        ensureScannerIsOpen();
        while (!scanner.hasNextInt()) {
            System.out.println("That's not a valid number... Please enter an integer:");
            scanner.next(); // Discard invalid input
        }
        int input = scanner.nextInt();
        scanner.nextLine(); //eat CRLF
        return input;
    }

    public static void awaitInput() {
        ensureScannerIsOpen();
        System.out.print("\nPress ENTER to continue...");
        scanner.nextLine();
    }
}

Error Handling

Not having added the required customizations

If you haven't added the required sandwich customizations, you will not be allowed to finalize your sandwich.

image

Editing an item that doesn't exist

You are not able to edit items if they are not currently in your order.

image

image

Other Miscellaneous Errors

image

image

About

Comprehensive deli application that allows users to order items on a menu and customize items and orders.

Topics

Resources

Stars

Watchers

Forks

Languages