Jes*_*nez 0 c++ compiler-errors visual-c++
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;
}
Run Code Online (Sandbox Code Playgroud)
它发生在线上double area = computeArea(size);.我不明白为什么它说我没有在我清楚的时候通过论证.
double computeArea();
double area = computeArea(size);
double computeArea(int size) {
Run Code Online (Sandbox Code Playgroud)
您需要修复原型(第一个)以匹配实际功能:
double computeArea(int);
Run Code Online (Sandbox Code Playgroud)
当然,同样适用于其他原型.
| 归档时间: |
|
| 查看次数: |
839 次 |
| 最近记录: |