#include <stdio.h>
#define GA_OF_PA_NEED 267.0
int getSquareFootage(int squareFootage);
double calcestpaint(int squareFootage);
double printEstPaint(double gallonsOfPaint);
int main(void)
{
//Declaration
int squareFootage = 0;
double gallonsOfPaint = 0;
//Statements
getSquareFootage(squareFootage);
gallonsOfPaint = calcestpaint(squareFootage);
gallonsOfPaint = printEstPaint(gallonsOfPaint);
system("PAUSE");
return 0;
}
int getSquareFootage(int squareFootage)
{
printf("Enter the square footage of the surface: ");
scanf("%d", &squareFootage);
return squareFootage;
}
double calcestpaint( int squareFootage)
{
return (double) (squareFootage * GA_OF_PA_NEED);
}
double printEstPaint(double gallonsOfPaint)
{
printf("The estimate paint is: %lf\n",gallonsOfPaint);
return gallonsOfPaint;
}
私の出力がgallonsOfPaintを0.0と表示するのはなぜですか。エラーはなく、すべてが論理的に正しいようです。calc 関数の calculate ステートメントに問題があるようです。