#include #include //for EXIT_SUCCESS and size_t #include //for the sqrt function #include "relativistic_rocket.h" using namespace std; int main() { const double a[] { //fraction of the speed of light 0.0, sqrt( 3.0) / 2.0, sqrt(15.0) / 4.0, sqrt(63.0) / 8.0, 1.0 }; const size_t n {size(a)}; for (int i {0}; i < n; ++i) { //the rocket's velocity, in meters per second const double velocity {a[i] * relativistic_rocket::c}; const relativistic_rocket r {1.0, velocity}; cout << scientific //turn on scientific notation << "velocity == " << r.v() << fixed //turn off scientific notation << ", length == " << r.length() << "\n"; } return EXIT_SUCCESS; }