Skip to content

jillianrosile/shopping_cart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shopping_cart

Coding practice problem implementing a shopping cart

The Problem

You’ve been hired by the corner grocery store to implement a shopping cart. This corner store is kind of limited in their merchandise.

Apples

  • $0.99 each
  • 2 for $1.50
  • 10 for $4.25

Pears

  • $1.50 each
  • Buy one get one half off

Oranges

  • $0.35 each
  • 4 for $1.00

Example cart:

cart = Cart.new
cart.add(Apple)
cart.add(Apple)
cart.add(Pear)
cart.add(Pear)
cart.add(Orange)
cart.add(Orange)
cart.add(Orange)
cart.add(Orange)
cart.total  
# => $4.75

About

Coding practice problem implementing a shopping cart

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages