#include #include #include //Five classes derived from class tax: #include "income.h" #include "capital_gains.h" #include "regressive.h" #include "progressive.h" #include "property.h" using namespace std; int main() { const income federal; //Construct five objects. const capital_gains rich; const regressive oklahoma; const progressive newyork; const property yonkers; const tax *const a[] { //Put their addresses into an array of pointers. &federal, &rich, &oklahoma, &newyork, &yonkers }; //Do not use scientific notation. //Output money with 2 digits to the right of the decimal point. cout << fixed << setprecision(2); for (auto p: a) { //People like to see words left-justified, //numbers right-justified. cout << left << setw(13) << p->get_name() << " " << right << setw(10) << p->amount(100.00) << "\n"; } return EXIT_SUCCESS; }