#include const double dt=1.0; const double gravity=0.5; const double engine_strength=1.0; const double safe_velocity = -0.5; const char burn_key='b'; class ship_state { public: ship_state(double h, double v, double f); double height(); double velocity(); double fuel(); int landed(); ship_state& update(double rate); void print(ostream& os); private: double height_; double velocity_; double fuel_; }; //Class definitions ship_state::ship_state(double h, double v, double f) { height_ = h; velocity_ = v; fuel_ = f; } double ship_state::height() {return height_;} double ship_state::velocity(){return velocity_;} double ship_state::fuel() {return fuel_;} int ship_state::landed() { if (height_<=0) return 1; return 0; } void ship_state::print(ostream& os) { os<<"Velocity :"<=safe_velocity) cout<<"...good landing!\n"; else cout<<"...you crashed!\n"; } double get_burn_rate() { cout<<"Enter "<>ch; if (ch==burn_key) return 1.0; else return 0.0; } main() { cout << "Welcome to Lunar Lander. The object is to land the ship with a" << " final" << endl << "velocity greater than " << safe_velocity << endl << endl; ship_state s(50.0, 0.0, 20.0); lander_loop(s); }