Skip to content

The shopping cart app allows users to add, remove, and view items in the cart, which helps reinforce the understanding of classes, objects, methods, and encapsulation.

Notifications You must be signed in to change notification settings

Mplusabiodun/shopping-cart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The shopping cart app allows users to add, remove, and view items in the cart, which helps reinforce the

understanding of classes, objects, methods, and encapsulation.

This project teaches how to define classes and use them. Creating class instances and implementing methods for data

manipulation. It also cover concepts like the ternary operator, the spread operator, the this keyword, and more.

The key concepts you would encounter include:

#Class Structure: Defining a class ShoppingCart that can hold items, handle actions like adding and removing

products, and calculate totals.

#Attributes/Properties: The cart may have properties like items, totalPrice, or quantity to track what has been

added and the corresponding values.

#Methods: Implementing functions such as:

addItem(item): To add an item to the cart.

removeItem(item): To remove an item.

viewCart(): To display the items in the cart.

calculateTotal(): To compute the total cost of items in the cart.

Encapsulation: Using private variables or methods to protect the integrity of the cart's data.

About

The shopping cart app allows users to add, remove, and view items in the cart, which helps reinforce the understanding of classes, objects, methods, and encapsulation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published