Can someone tell me what is wrong with my program? (below)
It builds without any errors, but any numbers that I input for cost and markup,
the retail just comes out as "00411168" no matter what numbers I input.
Help would be greatly appreciated!!!
Code:
#include <iostream>
#include <iomanip>
using namespace std;
double retail (double, double);
int main()
{
double cost;
double markup;
cout << "What is the item's wholesale cost? ";
cin >> cost;
cout << endl;
cout << "What is the markup percentage? ";
cin >> markup;
cout << endl;
retail (cost, markup);
cout << "The retail price of the item is " << retail << fixed << setprecision(2) << endl;
return (0);
}
double retail (double wholesaleCost, double markupPercentage)
{
return (wholesaleCost + (wholesaleCost * (markupPercentage/100)));
}