【发布时间】:2014-02-26 00:54:50
【问题描述】:
void displayCost();
double computeArea();
double roundCost();
int main()
{
return 0;
}
void displayCost(string name, int size)
{
double area = computeArea(size);
cout << "Since a " << size << "-inch pizza covers" << area << "square inches, "
<< name << ", then a 12 cents per square inch, the cost will be" << 12*area
<< " - which rounds to" << roundCost();
}
double computeArea(int size)
{
double radius = size/2;
double area = pi*radius*radius;
return area;
}
double roundCost(double price)
{
double roundedCost = ceil(price*100)/100;
return roundedCost;
}
它发生在double area = computeArea(size); 的线上。我不明白为什么它说我没有传递参数,而我显然是。
【问题讨论】:
-
你声明它没有参数:
double computeArea();
标签: c++ visual-c++ compiler-errors