程序出错了?!
#include <iostream>using namespace std;
void get(double& price, int& turnover);
double cost(double price, int turnover);
void show_output(double price, int turnover, double cost);
const int THRESHORD = 7;
const int low = 0.05;
const int high = 0.10;
int main()
{
double cost1, price;
int turnover;
get(price, turnover);
cost1 = cost(price, turnover);
show_output(price, turnover, cost1);
return 0;
}
void get(double& price, int& turnover)
{
cout << "Please enter price and turnover:" << endl;
cin >> price >> turnover;
return;
}
double cost(double price, int turnover)
{
if (turnover <= THRESHORD)
return(price + price * low);
else
return(price + price * high);
return;
}
void show_output(double price, int turnover, double cost)
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout << "The cost for price " << price << endl
<< "and turnover " << turnover << endl
<< "is:" << cost << endl;
return;
}