← Back to Home

C++ Project: Shape Classes & Object Comparisons

Project Overview

This C++ project demonstrates fundamental principles of Object-Oriented Programming (OOP) using custom geometric entities. The application configures explicit data models for tracking spatial boundaries, properties, names, and color profiles across complex primitive instances, utilizing overloaded comparison operations to evaluate relative dimensional bounds.

Object-Oriented Implementations

The application codebase implements concrete class representations to evaluate relational bounds parameters:

Core C++ Class Architectures

Below are structural class prototypes handling data tracking interfaces across shape fields:

C++ Header: Shape Definitions Sample
// Abstract representation tracking attribute fields and spatial metadata
class Rectangle {
private:
    std::string name;
    double length;
    double width;
    std::string color;

public:
    Rectangle(std::string n, double l, double w, std::string c)
        : name(n), length(l), width(w), color(c) {}

    // Operator checking dimensional bounds size relations
    bool operator<(const Rectangle& other) const {
        return (this->length * this->width) < (other.length * other.width);
    }
};

Compilation Stream Execution Output

The terminal matrix window below shows the direct console logs emitted when building, initializing, and compiling the comparison routines across the shape entity definitions:

Name: SEVERUS SNAPE Length: 0 Width: 0 Color: GREEN r2 is bigger Name: REMUS LUPIN Radius: 0 Color: RED c2 is bigger Program ended with exit code: 0

Assignment 4 System Specs