#include <iostream>
#include <vector>

using namespace std;

class Square {

    private:
        int side {1};

    public:
        Square() = default;
        Square(int s) : side{s} {};
        int calcArea() {
            return side * side;
        }

};

int main() {

    // Initializing vector using C++11 standards
    vector<int> vec {4, 8, 15, 16, 23, 42};

    // Print value of vec at index 0
    cout << "Index 0 of \"vec\": " << vec[0] << endl;
    cout << "Index 0 of \"vec\": " << vec.at(0) << endl;

    // Range based for loop
    cout << "Printing elements of vector \"vec\"..." << endl;
    for (int num : vec) {
        cout << "Value: " << num << endl;
    }

    // Change all elements of vector
    cout << "Adding 100 to all elements of vector \"vec\"..." << endl;
    for (int &num : vec) {
        num = num + 100;
    }
    for (int num : vec) {
        cout << "Value: " << num << endl;
    }

    // Determine size of vector
    cout << "Determining size of vector \"vec\"..." << endl;
    cout << "Size of vector \"vec\": " << vec.size() << endl;

    // Add element to vector
    cout << "Adding \"99\" to vector \"vec\"..." << endl;
    vec.push_back(99);
    cout << "New size of vector \"vec\": " << vec.size() << endl;

    // Remove element to vector
    cout << "Removing last element from vector \"vec\"..." << endl;
    vec.pop_back();
    cout << "New size of vector \"vec\": " << vec.size() << endl;

    // Clear all elements from vector
    cout << "Clearing all elements from vector \"vec\"..." << endl;
    vec.clear();
    cout << "New size of vector \"vec\": " << vec.size() << endl;

    // Add element to vector (again)
    cout << "Adding \"99\" to vector \"vec\"..." << endl;
    vec.push_back(99);
    cout << "New size of vector \"vec\": " << vec.size() << endl;

    // Copy one vector into another
    vector<int> vec2 {vec};
    
    cout << "Printing elements of vector \"vec2\"..." << endl;
    for (int num : vec2) {
        cout << num << endl;
    }

    return 0;

}