Skip to content

C++ restaurant point-of-sale system simulating cash register operations with transaction processing, tax calculations, payment handling, and daily sales tracking

Notifications You must be signed in to change notification settings

robertbiv/cpp-basic-inventory-system

Repository files navigation

C++ Basic Inventory System

A simple restaurant cash register system implemented in C++ that processes customer transactions, calculates taxes, handles payments, and tracks daily totals.

Description

This console application simulates a point-of-sale system for Lakeview Restaurant. It allows users to process multiple customer transactions, calculating meal prices with tax, handling payment amounts, and providing change. At the end of the session, it displays grand totals including the number of customers served and total receipts collected.

Features

  • Transaction Processing: Process multiple customer transactions in a single session
  • Tax Calculation: Automatic 8% tax calculation on meal prices
  • Payment Handling: Accepts customer payment and calculates change
  • Input Validation: Ensures valid meal prices (minimum $1) and sufficient payment amounts
  • Session Totals: Tracks and displays total customers served and total receipts
  • User-Friendly Interface: Clear prompts and formatted output for easy reading

Requirements

Compiler

  • C++ compiler with C++11 support or later
  • Examples: g++, clang++, MSVC (Visual Studio)

Platform

  • Windows (Visual Studio project included)
  • Linux/macOS (can compile with g++ or clang++)

Build Instructions

Using Visual Studio (Windows)

  1. Open homework4.vcxproj in Visual Studio
  2. Build the solution (F7 or Build → Build Solution)
  3. Run the application (F5 or Debug → Start Debugging)

Using g++ (Linux/macOS/Windows with MinGW)

g++ -o restaurant homework4.cpp
./restaurant

Using clang++ (Linux/macOS)

clang++ -o restaurant homework4.cpp
./restaurant

Usage

  1. Start the Program: Run the compiled executable
  2. Process Customers:
    • Enter Y or y to process a customer
    • Enter N or n to end the session
  3. Enter Meal Price: Input the price of the meal (must be $1 or more)
  4. View Transaction Details: The system displays:
    • Meal price
    • Tax amount (8%)
    • Total amount due
  5. Enter Payment: Provide the amount tendered (must be equal to or greater than total)
  6. Receive Change: The system calculates and displays the change
  7. End Session: Choose N when prompted to process another customer
  8. View Grand Totals: See the total number of customers and total receipts for the session

Example Session

*** Lakeview Restaurant ***

Do you want to process a customer ?
Enter N/n for No and Y/y for Yes: y
Enter the price of the meal: $15.50

Price of Meal:           $15.50
Tax:                     $1.24
Total Amount:            $16.74

Enter amount tendered:   $20.00

Amount Tendered:         $20.00
Total Amount:            $16.74
---------------------------------
Change:                  $3.26

Do you want to process a customer ?
Enter N/n for No and Y/y for Yes: n

Grand Totals:
Total Customers:         1
Total Receipts:          $16.74
*** Thank You ***

Code Structure

  • Main Loop: Controls program flow and allows multiple customer transactions
  • Input Validation: Ensures user inputs are valid (Y/N responses, valid prices, sufficient payment)
  • Calculation Functions: Computes tax and totals with 8% tax rate
  • Output Formatting: Uses iomanip for clean, aligned currency display

Project Information

  • Original Author: Robert Bennethum
  • Course: CMPSC 121
  • Assignment: Homework 4
  • Original Description: Make a simple cash register

Configuration

The tax rate is currently set to 8% and defined as a static constant:

static float TAXRATE = .08;

To modify the tax rate, change this value in homework4.cpp and recompile.

License

This project was created as an educational assignment. Please respect academic integrity policies if using this code for learning purposes.

About

C++ restaurant point-of-sale system simulating cash register operations with transaction processing, tax calculations, payment handling, and daily sales tracking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages