Skip to content

AtibaAnwar/shopping_cart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopping Cart System

This is a simple command-line shopping cart system implemented in Java that demonstartes the usage of Singletone class. A Singleton class [ShoppingCart] is a class that allows only one instance of itself to be created and provides a global point of access to that instance. This is achieved by making the constructor private, so that no other instances of the class can be created, and providing a static method[STATIC fACTORY METHOD] that returns the single instance of the class. It allows users to add products to the cart, remove products from the cart, and view the contents of the cart.

Features

  • Add Product: Users can add products to the cart by providing the name and price of the product.
  • Remove Product: Users can remove products from the cart by providing the name of the product.
  • View Cart: Users can view the contents of the cart, including the names and prices of the products.

Usage

You can choose to add products, remove products, view the cart, or exit the program.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages