// class declaration class Pump { private: float amtInTank; float price; public: Pump(float = 500.0, float = 1.00); // constructor void values(void); void request(float); }; // class implementation Pump::Pump(float start, float todaysPrice) { amtInTank = start; price = todaysPrice; } void Pump::values(void) { cout << "The gas tank has " << amtInTank << " gallons of gas." << endl; cout << "The price per gallon of gas is $" << setiosflags(ios::showpoint) << setprecision(2) << price << endl; } void Pump::request(float pumpAmt) { float pumped; if (amtInTank >= pumpAmt) pumped = pumpAmt; else pumped = amtInTank; amtInTank -= pumped; cout << pumpAmt << " gallons were requested " << endl; cout << pumped << " gallons were pumped" << endl; cout << amtInTank << " gallons remain in the tank" << endl; cout << "The total price is $" << setiosflags(ios::showpoint) << setprecision(2) << (pumped * price) << endl; }