#include using namespace std; #include "apvector.h" class Pump { public: Pump(); double GallonsSold() const; void ResetGallonsSold(); private: }; class Station { public: Station(int numPumps); double TotalSales() const; void ResetAll(); void CloseStation(ostream& logFile); private: double myBasePrice; apvector myPumps; }; Station::Station(int numPumps) : myPumps(numPumps) { } void Station::ResetAll() { int k; for(k=0; k < myPumps.length(); k++) { myPumps[k].ResetGallonsSold(); } } double Station::TotalSales() const { int k; double total = 0.0; for(k=0; k < 2; k++) { total += myPumps[k].GallonsSold() * (myBasePrice + 0.25); } for(k=2; k < myPumps.length(); k++) { total += myPumps[k].GallonsSold() * myBasePrice; } return total; } void Station::CloseStation(ostream& logFile) { logFile << TotalSales() << endl; ResetAll(); } Pump::Pump() { } void Pump::ResetGallonsSold() { } double Pump::GallonsSold() const { return 0.0; } int main() { Station s(5); s.CloseStation(cout); return 0; }