// Mr. Minich
// CMPSC 101
// Ch. 3 Demo Program #6
// October 17, 2001
// Purpose - to illustrate a rounding function
#include <iostream>
using namespace std;
int round(double incomingNum);
int main()
{
double discs = 0.0; // number of disks inputed by user
double price = 0.0; // total price
int roundedPrice = 0; // rounded price
cout << "Enter quantity of compact discs ($15.99 ea): ";
cin >> discs;
price = discs * 15.99 * 1.06; // computing cost including sales tax
roundedPrice = round(price);
cout << "The total rounded cost including sales tax is $" << roundedPrice << endl;
return 0;
}// end of main
int round(double incomingNum)
{
int roundedNum = 0; // rounded number
roundedNum = int (incomingNum + 0.5);
return roundedNum;
}// end of round