// Mr. Minich // round function demo program #include #include using namespace std; // ***************** function declaration statements ********************** int roundToWholeNum(double myNum); double computeSalesTax(double myBasePrice); void printFinalPrice(double myPrice); // ***************** constant declaration statements ********************** const double PA_TAX = 0.06; int main() { // ****************** variable declaration statements ***************** double num = 0; // price of item int roundedNum = 0; // rounded price of item double priceWithTax = 0.0; // price of item w/ tax included // ******************* user input ************************************* cout << "Enter price: "; cin >> num; // ******************** calculations ********************************** roundedNum = roundToWholeNum(num); priceWithTax = computeSalesTax(roundedNum) + roundedNum; // ******************** output display ******************************** printFinalPrice(priceWithTax); system("pause"); return 0; }// end of main // ************************ functions ************************************** int roundToWholeNum(double myNum) { return int (myNum + 0.5); }// end of roundToWholeNum double computeSalesTax(double myBasePrice) { return myBasePrice * PA_TAX; }// end of computeSalesTax void printFinalPrice(double myPrice) { cout << "Your price is $" << myPrice << endl; }// end of printFinalPRice