// ---
// jupyter:
//   jupytext:
//     text_representation:
//       extension: .cpp
//       format_name: light
//       format_version: '1.5'
//       jupytext_version: 1.14.4
//   kernelspec:
//     display_name: C++17
//     language: C++17
//     name: xeus-cling-cpp17
// ---

// + graffitiCellId="id_z8u95or" graffitiConfig={"executeCellViaGraffiti": "nbiehqu_3qgmd50"}
#include <assert.h>

// TODO: Define PI

// TODO: Define ParticleModel

    // TODO: Define the Move() function for ParticleModel

// TODO: Inherit BicycleModel from ParticleModel

    // TODO: Define the move() function for BicycleModel

// TODO: Pass the tests
int main()
{
    // Test function overriding
    BicycleModel bicycle;
    ParticleModel &particle = bicycle;
    BicycleModel bicycle2;
    particle.Move(10, PI / 9);
    bicycle2.Move(10, PI / 9);
    assert(particle.x == bicycle.x);
    assert(particle.y == bicycle.y);
    assert(particle.theta == bicycle.theta);
}

// + [markdown] graffitiCellId="id_nbiehqu"
// <span class="graffiti-highlight graffiti-id_nbiehqu-id_3qgmd50"><i></i><button>Compile & Execute</button></span>&nbsp;
// <span class="graffiti-highlight graffiti-id_2wll1y1-id_q8gey7m"><i></i><button>Explain</button></span>

// + [markdown] graffitiCellId="id_h177dz1" graffitiConfig={"rows": 12, "terminalId": "id_l2ubfti", "type": "terminal"}
// <i>Loading terminal (id_h177dz1), please wait...</i>

StarcoderdataJupyterScriptsDedupFiltered