void displayCost();
double computeArea();
double roundCost();
int main()
{}
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);的行上。我不明白爲什麼當我清楚地表示我沒有通過爭論時。編譯錯誤:函數不帶1個參數
您聲明爲不帶參數:'double computeArea();' –