Question: can someone help me with the sdm for this #include #include #define KITCHEN_TAX 26.00//kitchen tax #define BATH_TAX 37.50//bathroom tax #define OROOM_TAX 19.00//any other room tax
can someone help me with the sdm for this
#include
double kitchenTax(double height, double width) { double txAmount = 0.0; double area = height * width; txAmount = area * KITCHEN_TAX; if (area >= LUXROOM) txAmount += LUX_TAX; return txAmount; }
double oRoomTx(double height, double width) { double txAmount = 0.0; double area = height * width; txAmount = area * OROOM_TAX; if (height >= LWALL) txAmount += (height - LWALL) * LWALL_TAX; if (width >= LWALL) txAmount += (width - LWALL) * LWALL_TAX; if (area >= LUXROOM) txAmount += LUX_TAX; return txAmount; }
double bathTx(double height, double width) { double txAmount = 0.0; double area = height * width; txAmount += (height - LWALL) * LWALL_TAX; if (width >= LONGWALL) txAmount += (width - LWALL) * LWALL_TAX; if (area >= LUXROOM) txAmount += LUX_TAX; txAmount = area * BATH_TAX; if (height >= LWALL) return txAmount; }
using namespace std; int main() { double txAmount = 0.0; double totFt = 0; double height, width; cout << "Enter the height and width of kitchen separated by a space (feet): "; cin >> height >> width; totFt += height * width; txAmount += kitchenTx(height, width);
cout << "Enter the height and width of living room separated by a space (feet): "; cin >> height >> width; totFt += height * width; txAmount += oRoomTx(height, width);
cout << "Enter the height and width of bathroom separated by a space (feet): "; cin >> height >> width; totFt += height * width; txAmount += bathTax(height, width);
cout << "Enter the height and width of bedroom separated by a space (feet): "; cin >> height >> width; totFt += height * width; txAmount += oRoomTx(height, width);
cout << "Enter the height and width of office separated by a space (feet): "; cin >> height >> width; totFt += height * width; txAmount += oRoomTx(height, width);
if (txAmount > MAX_TAX) txAmount = MAX_TAX; cout << "Total square footage: " << totFt << endl; cout << "Total tax due: " << txAmount << endl;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
