ryanshatch / Budget-Buddy

The program will calculate the total cost of the items and display a summary of the purchase, including individual item costs and the total cost.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shopping Cart

By: Ryan Hatch

How to RunUsageCode StructureExampleLicense


How to Run

  1. Make sure you have Java installed on your system.
  2. Open a command prompt or terminal.
  3. Compile the `ShoppingCart.java` file using the following command:
  4. javac ShoppingCart.java
  5. Run the program using the following command:
  6. java ShoppingCart

Usage

  1. The program will prompt you to enter details for Item 1.
  2. Enter the item name, price, and quantity as requested.
  3. The program will then prompt you to enter details for Item 2.
  4. Enter the item name, price, and quantity for Item 2.
  5. The program will calculate the total cost of the items and display a summary of the purchase, including individual item costs and the total cost.

Code Structure

  • ShoppingCart.java: This file contains the main method and handles the user input and calculations for the shopping cart.
  • ItemToPurchase.java: This file defines the ItemToPurchase class, which represents an item in the shopping cart. It provides methods to set and get the item's name, price, and quantity, as well as a method to print the item's purchase details.

Example


Item 1:
Enter the item name: apple
Enter the item price: 1.48
Enter the item quantity: 12

Item 2:
Enter the item name: pears
Enter the item price: 1.89
Enter the item quantity: 9

TOTAL COST:
apple 12 @ $1.48 = $17.76
pears 9 @ $1.89 = $17.01

    
Total: $34.77
  

License

This software is the property of the copyright holder and is protected by copyright laws. All rights are reserved.

The copyright holder grants no implied or express license for the use, copying, modification, distribution, or reproduction of this software, in whole or in part, without the prior written permission of the copyright holder.

Any unauthorized use, copying, modification, distribution, or reproduction of this software, in whole or in part, is strictly prohibited and constitutes a violation of copyright law. Such unauthorized use may result in civil and/or criminal penalties, including but not limited to legal action and monetary damages.

To obtain permission for any use, copying, modification, distribution, or reproduction of this software, please contact the copyright holder at the following address:

ryanshatch@gmail.com


By using this software, you acknowledge that you have read and understood the terms of this license and agree to comply with all applicable copyright laws. Failure to abide by the terms of this license may subject you to legal consequences.

About

The program will calculate the total cost of the items and display a summary of the purchase, including individual item costs and the total cost.


Languages

Language:Java 100.0%