Skip to content

NathanTempest/farmers-market

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Farmers Market OOP Implementation

A JavaScript Object-Oriented Programming implementation of a Farmers Market system demonstrating core OOP concepts.

Features

  • Market management with multiple stands
  • Farmer assignments with specialties
  • Produce inventory with different types and pricing
  • Search functionality across market stands
  • Buy/sell transactions with inventory updates

Project Structure

src/
├── index.js                 # Entry point
├── demo/demo.js            # Demo functionality
├── models/
│   ├── FarmersMarket.js    # Main market class
│   ├── Stand.js            # Stand management
│   ├── Farmer.js           # Farmer entity
│   ├── ProduceItem.js      # Produce with quantities
│   └── produce/            # Produce types (Apple, Banana, etc.)
└── utils/constants.js      # Project constants

How to Run

npm install
npm start

Sample Output

Boston Farmer's Market at Newbury Street
3 stands, 3 with farmers
5 different types of produce
Total market value: $1909.00

Paul Revere at Stand block 1:
Stand value: $1127.00
  - Apple has a quantity of 100 piece
  - Banana has a quantity of 200 dozen
  - Tomato has a quantity of 230 lb

Key Classes

  • FarmersMarket: Main container managing stands and operations
  • Stand: Individual vendor stands with inventory
  • Farmer: Market vendors with specialties
  • ProduceItem: Produce with quantities and pricing
  • Produce: Base class for all produce types

OOP Concepts Demonstrated

  • Inheritance (Produce base class)
  • Encapsulation (private state management)
  • Composition (Market → Stands → Produce)
  • Error handling and validation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors