a hint for you:
the following will work fine:
Code:
double calcint(double amount, double rate)
{
return amount * rate * 1;
}
int main () {
//...
calcint (amount, rate);
//...
return 0;
}
the next code won't compile because the compiler doesn't know what calcint is:
its declaration appears after the program calls it in main.
Code:
int main () {
//...
calcint (amount, rate);
//...
return 0;
}
double calcint(double amount, double rate)
{
return amount * rate * 1;
}
a function prototype tells the compiler that calcint exists: it lets you implement your calcint anywhere:
<solution removed>