// class 5 demo rounding function #include using namespace std; // #include "best_buy_functions.h" // this could be used // to include the functions // in a file named // best_buy_functions.h int roundToWholeNum(double myNum); double computeSalesTax(double myBasePrice); void printFinalPrice(double myPrice); const double PA_TAX = 0.06; int main() { double num = 0; int roundedNum = 0; double priceWithTax = 0.0; cout << "Enter price: "; cin >> num; roundedNum = roundToWholeNum(num); // call statement priceWithTax = computeSalesTax(roundedNum) + roundedNum; printFinalPrice(priceWithTax); return 0; }// end of main int roundToWholeNum(double myNum) { int correctAnswer = 0; correctAnswer = int (myNum + 0.5); return correctAnswer; } double computeSalesTax(double myBasePrice) { return (myBasePrice * PA_TAX); } void printFinalPrice(double myPrice) { cout << "Your price is $" << myPrice << endl; return; }