// This program calculates retail price when whole sale price and estimated days in the store are variables. #include using namespace std; void input(double& whole_sale, int& day); double calculate(double& whole_sale, int& day); void output(double& whole_sale, int& day, double& price); int main() { double whole_sale = 0; double price; int day = 0; input(whole_sale,day); price = calculate(whole_sale, day); output(whole_sale, day, price); return 0; } void input(double& whole_sale, int& day) { double ws; int d; cout << "What is the whole sale price of the item?" << endl; cin >> ws; cout << "How many days will the item be in the store?" << endl; cin >> d; whole_sale = ws; day = d; return; } double calculate(double& whole_sale, int& day) { double price; if (day <= 7) { price = (whole_sale * .05) + whole_sale; return(price); } else { price = (whole_sale *.1) + whole_sale; return(price); } } void output(double& whole_sale, int& day, double& price) { cout << "The whole sale cost of the item is $" << whole_sale << endl; cout << "The days spent in the store is " << day << endl; cout << "So the retail price will be $" << price << endl; return; }