Skip to content

alynealy/oop-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿช™ Coinqueror

Advanced Cryptocurrency Management Platform in C++

A comprehensive C++ application that simulates a cryptocurrency management platform with enterprise-grade features, demonstrating advanced OOP concepts and real-world blockchain functionality.

๐ŸŒŸ Overview

Coinqueror is a sophisticated cryptocurrency simulation platform that combines the functionality of major exchanges like Binance with enhanced features for portfolio management, blockchain tracking, and real-time auditing. Built with modern C++ principles, it showcases advanced object-oriented programming concepts while providing a robust digital asset ecosystem.

โœจ Key Features

๐Ÿ”— Digital Asset Management

  • Hierarchical Architecture: Sophisticated class hierarchy (DigitalAsset โ†’ Token/MarketEntity โ†’ CryptoCurrency/UtilityCoin/StableCoin)
  • Polymorphic Behavior: Dynamic method dispatch via virtual functions (displayInfo(), calculateMarketValue())
  • Diamond Inheritance Resolution: Clean implementation of multiple inheritance patterns

๐Ÿ’ฐ Wallet & Blockchain Integration

  • Dynamic Portfolio Management: Expandable wallet system with automatic resizing
  • Transaction Validation: Secure crypto transfers with comprehensive validation
  • Blockchain Tracking: Immutable transaction history between wallets

๐Ÿ“Š Real-time Audit System

  • Templated Logging: Generic AuditLog<T> supports multiple data types
  • Timestamp Tracking: Automated action logging with precise timestamps
  • Custom Formatters: Human-readable log output with configurable formats

๐Ÿ’พ Data Persistence

  • File I/O Operations: Seamless load/save functionality for all data types
  • Dynamic Memory Management: Efficient allocation and resizing for scalability
  • Multiple Data Sources: Support for cryptos.txt, wallets.txt, transactions.txt

๐Ÿ–ฅ๏ธ Interactive User Interface

  • Singleton Menu System: Clean CLI interface with 24+ operations
  • CRUD Operations: Complete Create, Read, Update, Delete functionality
  • Comparison Tools: Advanced asset comparison and analysis features

๐Ÿ—๏ธ Architecture Highlights

Class Hierarchy

DigitalAsset (Abstract Base)
โ”œโ”€โ”€ Token (Symbol Management)
โ”œโ”€โ”€ MarketEntity (Market Cap Tracking)
โ””โ”€โ”€ CryptoCurrency (Diamond Inheritance)
    โ”œโ”€โ”€ UtilityCoin (Specialized Use Cases)
    โ””โ”€โ”€ StableCoin (Asset-Backed Stability)

Core Components

Component Description Key Features
DigitalAsset Abstract base class for all crypto assets Pure virtual methods, polymorphic interface
CryptoCurrency Main crypto implementation Diamond inheritance resolution, market integration
Wallet Portfolio management system Dynamic expansion, owner metadata
Blockchain Transaction ledger Immutable history, validation system
AuditLog<T> Templated logging system Type-safe logging, file persistence

๐Ÿš€ Getting Started

Prerequisites

  • C++17 compatible compiler (GCC 7.0+, Clang 5.0+, MSVC 2017+)
  • Standard C++ library

Quick Start

# Clone the repository
git clone https://github.com/yourusername/coinqueror.git
cd coinqueror

# Compile with C++17 support
g++ -std=c++17 project.cpp -o coinqueror

# Run the application
./coinqueror

Optional Data Files

Place these files in your working directory to preload sample data:

cryptos.txt      # Sample cryptocurrency definitions
wallets.txt      # Pre-configured wallet data
transactions.txt # Historical transaction records

๐ŸŽฏ Advanced C++ Features Demonstrated

Object-Oriented Programming

  • โœ… Multiple Inheritance with diamond problem resolution
  • โœ… Virtual Functions and pure virtual methods
  • โœ… Polymorphism through base class pointers
  • โœ… Encapsulation with proper access control

Modern C++ Techniques

  • โœ… Operator Overloading (+, -, ++, [], etc.)
  • โœ… Template Programming with generic classes
  • โœ… Exception Handling with custom exception types
  • โœ… RAII Principles for resource management
  • โœ… Smart Pointers for memory safety

System Design Patterns

  • โœ… Singleton Pattern for menu management
  • โœ… Factory Pattern for object creation
  • โœ… Observer Pattern for audit logging

๐Ÿ’ก Usage Examples

Creating and Managing Cryptocurrencies

// Polymorphic asset creation
auto bitcoin = std::make_unique<CryptoCurrency>("Bitcoin", 45000.0, "BTC", 850000000000);
auto ethereum = std::make_unique<UtilityCoin>("Ethereum", 3200.0, "ETH", "Smart Contracts");

// Operator overloading in action
CryptoCurrency combined = *bitcoin + *ethereum;  // Combines market values
++wallet;  // Increases wallet capacity

Wallet Operations

Wallet userWallet("Alice", 10);
userWallet.addCryptocurrency(std::move(bitcoin));
userWallet.displayPortfolio();  // Polymorphic display

Blockchain Transactions

Transaction tx(wallet1, wallet2, bitcoin.get(), 0.5);
blockchain.addTransaction(tx);  // Validated and recorded

๐Ÿ“ Project Structure

coinqueror/
โ”œโ”€โ”€ project.cpp              # Main implementation file
โ”œโ”€โ”€ cryptos.txt              # Sample cryptocurrency data
โ”œโ”€โ”€ wallets.txt              # Sample wallet configurations
โ”œโ”€โ”€ transactions.txt         # Sample transaction history
โ”œโ”€โ”€ audit_general.log        # Generated audit log
โ”œโ”€โ”€ audit_stats.log          # Statistical audit data
โ””โ”€โ”€ README.md               # This file

๐Ÿ” Feature Demonstrations

1. Polymorphism in Action

Unified interface handling diverse asset types through base class pointers:

std::vector<std::unique_ptr<DigitalAsset>> assets;
// All assets can be managed uniformly despite different implementations

2. Diamond Inheritance Resolution

CryptoCurrency cleanly inherits from both Token and MarketEntity:

class CryptoCurrency : public Token, public MarketEntity {
    // Resolves potential ambiguity through virtual inheritance
};

3. Template Specialization

Generic audit logging supports multiple data types:

AuditLog<std::string> actionLog;  // For general actions
AuditLog<int> statsLog;           // For numerical statistics

4. Exception Safety

Comprehensive error handling throughout the application:

try {
    wallet.addCryptocurrency(invalidCrypto);
} catch (const std::invalid_argument& e) {
    std::cerr << "Validation failed: " << e.what() << std::endl;
}

๐ŸŽฎ Interactive Menu System

The application provides 24+ interactive options including:

  • ๐Ÿ”ง CRUD Operations: Create, modify, and delete assets
  • ๐Ÿ“ˆ Market Analysis: Compare cryptocurrencies and market trends
  • ๐Ÿ’ผ Portfolio Management: Manage multiple wallets and holdings
  • ๐Ÿ” Transaction History: View and analyze blockchain transactions
  • ๐Ÿ“‹ Audit Reports: Generate comprehensive system logs

๐Ÿ† Technical Achievements

  • Zero Memory Leaks: Proper RAII and smart pointer usage
  • Exception Safe: Comprehensive error handling throughout
  • Scalable Design: Dynamic memory management and resizing
  • Type Safety: Template-based generic programming
  • Clean Architecture: SOLID principles implementation

Built with โค๏ธ and modern C++

About

An project for cryptocurrencies and users management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages