Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simulation of city trading and river transport in C++, demonstrating OOP, resource management, and system design.

Notifications You must be signed in to change notification settings

azhar-fullstack/city-trading-simulation-cpp

Repository files navigation

City Trading Simulation (C++)

A simulation of city trading and river transport, implemented in C++. Demonstrates advanced OOP, resource management, and system design.

๐ŸŒ† Project Overview

This project simulates a network of cities connected by rivers, where boats transport products between cities. The system manages inventories, products, and trading logic, providing a rich simulation of economic and logistical challenges.

โœจ Features

  • City and River System: Model cities, rivers, and their connections
  • Boat Transport: Simulate boats moving products between cities
  • Inventory Management: Track products and quantities in each city
  • Product Trading: Buy, sell, and transport products
  • OOP Design: Modular code with classes for boats, cities, products, inventory, and river systems

๐Ÿ› ๏ธ Technologies Used

  • C++ (OOP, STL)
  • Modular design (multiple .cpp/.h files)
  • Console I/O

๐Ÿš€ Getting Started

Prerequisites

  • C++ compiler (g++, clang++, or MSVC)

Build Instructions

Using Makefile (recommended)

make

Or compile manually:

g++ -o riversystem main.cpp Boat.cpp City.cpp Inventory.cpp Product.cpp RiverSystem.cpp

Run the Simulation

./riversystem

Or on Windows:

riversystem.exe

๐ŸŽฎ Controls

  • Follow on-screen prompts to:
    • Add or remove products
    • Move boats between cities
    • View inventories
    • Trade products
  • Input choices as numbers or text when prompted.

๐Ÿ“ Project Structure

city-trading-simulation-cpp/
โ”œโ”€โ”€ Boat.cpp/.h # Boat class
โ”œโ”€โ”€ City.cpp/.h # City class
โ”œโ”€โ”€ Inventory.cpp/.h # Inventory management
โ”œโ”€โ”€ Product.cpp/.h # Product class
โ”œโ”€โ”€ RiverSystem.cpp/.h # River system and trading logic
โ”œโ”€โ”€ main.cpp # Main entry point
โ”œโ”€โ”€ riversystem.exe # Compiled executable (ignore in repo)
โ””โ”€โ”€ README.md # This file

๐Ÿง‘โ€๐Ÿ’ป Skills Demonstrated

  • C++ OOP (classes, encapsulation)
  • System and resource management
  • Simulation and modeling
  • Modular code organization
  • Interactive CLI design

๐Ÿ“„ License

This project is open source and available under the MIT License.


Author: Azhar Mehmood Language: C++ Category: Simulation, Algorithms, Resource Management

About

Simulation of city trading and river transport in C++, demonstrating OOP, resource management, and system design.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle ใซใ‚ˆใฃใฆๅค‰ๆ›ใ•ใ‚ŒใŸใƒšใƒผใ‚ธ (->ใ‚ชใƒชใ‚ธใƒŠใƒซ) /