Peachy Keen
2012-10-17 07:57:00 UTC
thanks!
#include
using namespace std;
double comp (double bk1_par, double bk2_par, double bk3_par);
int main()
{
double bk1, bk2, bk3, max;
cout << "Please input the price for the first book:";
cin >> bk1;
cout << "Please input the price for the second book:";
cin >> bk2;
cout << "Please input the price for the third book:";
cin >> bk3;
max = comp(bk1, bk2, bk3);
cout << "The highest price is " << max << endl;
return 0;
}
double comp( double bk1_par, double bk2_par, double bk3_par)
{
double bk1_par, bk2_par, bk3_par;
if ((bk1_par > bk2_par) && (bk1_par > bk3_par))
return bk1_par;
else if ((bk2_par > bk1_par) && (bk2_par > bk3_par))
return bk2_par;
else if ((bk3_par > bk1_par) && (bk3_par > bk2_par))
return bk3_par;
}