Skip to content

About

πŸš€A collection of C++ exercises I did about OOP and Structured Programming

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

19 Commits

Folders and files

Repository files navigation

C++ Projects

A comprehensive collection of C++ programming exercises covering fundamental and advanced concepts including object-oriented programming, recursion, data structures, and algorithmic problem-solving.

πŸ“‹ Project Overview

This repository contains a series of well-documented programming exercises designed to strengthen problem-solving skills and C++ proficiency. Each exercise includes:

  • Clear problem descriptions
  • Example test cases
  • Expected outputs
  • Complete source code implementations

🎯 Exercises

# Exercise Topic Difficulty
1 Object-Oriented Programming & Inheritance Classes, Inheritance, Polymorphism Intermediate
2 Matrix Pattern Detection Arrays, Matrices, Logic Intermediate
3 Matrix Analysis Linear Algebra, Statistics Intermediate
4 String Processing String Manipulation, Edge Cases Intermediate
5 Continued Fractions Recursion, Floating-Point Math Advanced
6 Substring Extraction String Processing, Pattern Matching Beginner
7 Digit Collection & Sorting Character Processing, Sorting Beginner
8 Recursive Counting Recursion, Array Processing Intermediate
9 Matrix Transformation Matrix Operations, Conditional Logic Intermediate
10 Matrix Reshaping Array Manipulation, Dimensions Intermediate
11 Number Analysis Number Theory, Most Significant Digit Beginner
12 Recursive Digit Transformation Recursion, Number Manipulation Advanced

πŸ› οΈ Requirements

  • C++ Standard: C++11 or later
  • Build System: CMake 3.10+
  • Compiler: GCC 11+ or Clang 12+
  • OS: Linux/WSL, macOS, or Windows (with appropriate tools)

πŸ“¦ Installation & Setup

Prerequisites

Ensure you have the following installed:

# Ubuntu/Debian
sudo apt-get install build-essential cmake

# macOS (with Homebrew)
brew install cmake

# Windows (with MSVC or MinGW)
# Download from cmake.org and add to PATH

Clone the Repository

git clone https://github.com/todorx/VS-Code-Projects.git
cd VS-Code-Projects

πŸ”¨ Building the Project

Using CMake (Recommended)

# Create build directory
mkdir build
cd build

# Configure and build
cmake ..
make

# Or use the preset (if available)
cmake --preset default
cmake --build --preset default

Using VS Code with CMake Tools

  1. Open the project in VS Code
  2. Install the "CMake Tools" extension
  3. Select your preferred compiler kit
  4. Click "Build" in the status bar

πŸš€ Running Exercises

After building, you can run individual exercises:

# Run all exercises
./VS-Code-Projects

# Or compile and run a specific OOP exercise
cd "OOP Exercises/Exercise-5"
g++ -std=c++11 exercise.cpp -o exercise5
./exercise5

# Or compile and run a specific structured exercise
cd structured-programming-exercises/Exercise-5
g++ -std=c++11 5.cpp -o exercise5
./exercise5

πŸ“ Project Structure

VS-Code-Projects/
β”œβ”€β”€ CMakeLists.txt              # Build configuration
β”œβ”€β”€ CMakePresets.json           # CMake build presets
β”œβ”€β”€ README.md                   # This file
β”œβ”€β”€ .gitignore                  # Git ignore rules
β”œβ”€β”€ OOP Exercises/              # Object-Oriented Programming exercises
β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ Exercise-1/             # OOP & Inheritance (Product/DiscountedProduct)
β”‚   β”‚   β”œβ”€β”€ main.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-2/             # Song & CD Management
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-3/             # Ingredient & Dish Composition
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-4/             # Passenger & Train Management
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-5/             # List & ListContainer
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-6/             # Automobile & RentACar
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-7/             # Stopwatch (Operator Overloading)
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-8/             # NBAPlayer & AllStarPlayer (Inheritance)
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-9/             # Chocolate Factory (Operator Overloading)
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-10/            # Stock Record & Client Portfolio
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-11/            # Song & CD (from Vezbi Courses)
β”‚   β”‚   β”œβ”€β”€ exercise.cpp
β”‚   β”‚   └── readme.md
β”‚   └── Exercise-12/            # Train Management (from Vezbi Courses)
β”‚       β”œβ”€β”€ exercise.cpp
β”‚       └── readme.md
β”œβ”€β”€ structured-programming-exercises/  # Procedural exercises
β”‚   β”œβ”€β”€ Exercise-2/             # Matrix Pattern Detection
β”‚   β”‚   β”œβ”€β”€ 2.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-3/             # Matrix Analysis
β”‚   β”‚   β”œβ”€β”€ 3.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-4/             # String Processing
β”‚   β”‚   β”œβ”€β”€ 4.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-5/             # Continued Fractions
β”‚   β”‚   β”œβ”€β”€ 5.cpp
β”‚   β”‚   β”œβ”€β”€ 5-1.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-6/             # Substring Extraction
β”‚   β”‚   β”œβ”€β”€ 6.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-7/             # Digit Collection
β”‚   β”‚   β”œβ”€β”€ 7.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-8/             # Recursive Counting
β”‚   β”‚   β”œβ”€β”€ 8.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-9/             # Matrix Transformation
β”‚   β”‚   β”œβ”€β”€ 9.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-10/            # Matrix Reshaping
β”‚   β”‚   β”œβ”€β”€ 10.cpp
β”‚   β”‚   └── readme.md
β”‚   β”œβ”€β”€ Exercise-11/            # Number Analysis
β”‚   β”‚   β”œβ”€β”€ 11.cpp
β”‚   β”‚   └── readme.md
β”‚   └── Exercise-12/            # Recursive Digit Transformation
β”‚       β”œβ”€β”€ 12.cpp
β”‚       └── readme.md
└── out/                        # Build output (ignored)

πŸŽ“ Learning Path

Beginner Track

Start with these exercises if you're new to C++:

  • Exercise 6: Basic string manipulation
  • Exercise 7: Character processing and sorting
  • Exercise 11: Number operations

Intermediate Track

Build on your fundamentals:

  • Exercise 1: OOP and inheritance concepts
  • Exercise 2: Matrix operations
  • Exercise 3: Data analysis
  • Exercise 4: String edge cases
  • Exercise 9: Complex matrix transformations

Advanced Track

Challenge yourself with:

  • Exercise 5: Recursive mathematical computations
  • Exercise 8: Advanced recursion patterns
  • Exercise 10: Complex array manipulation
  • Exercise 12: Recursive number theory

πŸ’‘ Key Concepts Covered

  • Object-Oriented Programming: Classes, inheritance, polymorphism, virtual methods
  • Recursion: Base cases, recursive calls, optimization
  • Data Structures: Arrays, matrices, strings
  • Algorithms: Sorting, pattern matching, mathematical computations
  • String Processing: Parsing, substring extraction, character manipulation
  • Matrix Operations: Transposition, transformation, analysis
  • Number Theory: Digit manipulation, mathematical properties

πŸ“ Each Exercise Includes

  • Problem Description: Clear statement of what needs to be implemented
  • Input/Output Specifications: Format and constraints
  • Example Test Cases: Multiple examples with expected outputs
  • Difficulty Rating: Beginner, Intermediate, or Advanced
  • Implementation: Complete, working C++ solution

πŸ” Code Quality

All code follows these principles:

  • Clean, readable naming conventions
  • Comprehensive comments where needed
  • Proper error handling
  • Efficient algorithms
  • Standard C++ practices

πŸ› Troubleshooting

Build Issues

# Clean previous builds
rm -rf build/

# Rebuild from scratch
mkdir build && cd build && cmake .. && make

Compiler Errors

  • Ensure C++11 or later: -std=c++11 -std=c++14 -std=c++17
  • Check CMakeLists.txt configuration
  • Verify all dependencies are installed

πŸ“š Resources

πŸ“„ License

This project is provided for educational purposes.

✨ Contributing

Feel free to:

  • Report issues or bugs
  • Suggest improvements
  • Submit optimized solutions
  • Add additional test cases

Last Updated: May 7, 2026

For questions or feedback, feel free to open an issue or reach out!

About

πŸš€A collection of C++ exercises I did about OOP and Structured Programming

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages