/assignment

Primary LanguageJavaScript

Authors

Shopping Cart Discount Calculator Overview This simple Node.js script calculates discounts and fees for a shopping cart based on predefined rules. It prompts the user to input product quantities and whether each product should be gift-wrapped. After processing the inputs, it displays product details, discounts applied, and the final total.

How to Use Clone the repository:

bash
Copy code
git clone https://github.com/saurabh175/assignment
Navigate to the project directory:

bash
Copy code
cd assignment
Install dependencies:

bash
Copy code
npm install
Run the script:

bash
Copy code
node script.js
Follow the prompts to enter product quantities and gift-wrapping preferences.

Discount Rules
The script uses predefined discount rules, such as percentage discounts for total amounts or specific products. These rules can be customized in the options object within the script.

Example Output plaintext Copy code Product Details: ProductA: Quantity - 2, Total - $40 ProductB: Quantity - 3, Total - $120 ProductC: Quantity - 1, Total - $50

Subtotal: $210 Discount Applied: op1 - $10 Gift Wrap Fee: $6 Total: $206 Shipping Fee: $15