Skip to content

A console-based product catalogue and discount calculation system that simulates an e-commerce checkout process. Features multiple discount strategies (flat, bulk, tiered) with automatic best-discount selection, gift wrapping options, and detailed billing summary. Perfect for learning business logic implementation and pricing algorithms.

Notifications You must be signed in to change notification settings

AthulSabu2002/cart_simulation_program

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ Product Catalogue & Discount Calculation Program

This program simulates a basic checkout system with a product catalogue and a set of discount rules. It prompts the user for product quantities and gift wrapping options, then calculates the total cost with the most beneficial discount applied.


πŸ“¦ Product Catalogue

Product Price
Product A $20
Product B $40
Product C $50

🎁 Discount Rules

Only one discount can be applied per purchase β€” the one that offers the maximum savings.

  1. flat_10_discount
    β†’ Applies a flat $10 discount if the cart total exceeds $200.

  2. bulk_5_discount
    β†’ Applies a 5% discount on a product’s total if more than 10 units of that product are purchased.

  3. bulk_10_discount
    β†’ Applies a 10% discount on the entire cart if total quantity across all products exceeds 20 units.

  4. tiered_50_discount
    β†’ Applies a 50% discount on units beyond 15 of any product if total quantity exceeds 30 units.

    • First 15 units are charged at full price.
    • Remaining units (above 15) of that product get a 50% discount.

πŸ’‘ How It Works

  1. User inputs:

    • Quantity for each product.
    • Whether each product is gift-wrapped.
  2. Output displayed:

    • Each product’s name, quantity, and total cost.
    • Cart subtotal.
    • Best applicable discount name and discount amount.
    • Final total payable after discount.

About

A console-based product catalogue and discount calculation system that simulates an e-commerce checkout process. Features multiple discount strategies (flat, bulk, tiered) with automatic best-discount selection, gift wrapping options, and detailed billing summary. Perfect for learning business logic implementation and pricing algorithms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages