#include<iostream>
using namespace std;
// Pre-condition: Positive dollar-and-cents amount entered
// Post-condition: Return 15% tip
float findTip(float amoutDue);
int main()
{
float amountDue;
// Print exactly two places after the decimal point
// for money (as in earlier labs)
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
// Get money amount from user
cout << "How much is due? ";
cin >> amountDue;
// Compute and report tip
cout << "The tip is " << findTip(amountDue)
<< endl;
return 0;
}
// Compute tip
float findTip(float amountDue)
{
return amountDue*.15;
}