Code:
#include <stdio.h>
// Forgot to include conio.h
// Don't remove parameter names from the prototypes.
float getTaxAmount(float, float);
float addTaxAmount(float, float);
// Don't use implicit main
main()
{
float fPurchaseAmount;
float fDelMar = .0725f;
printf("\nEnter Purchase Amount: $ ");
scanf("%f", &fPurchaseAmount);
printf("\nThe Tax Amount for Del Mar is $%.2f\n", getTaxAmount( fPurchaseAmount, fDelMar) );
// Missing argument list for getTaxAmount.
printf("\nThe Total Amount With Tax for Del Mar is $%.2f", addTaxAmount( getTaxAmount, fPurchaseAmount) );
// Avoid using, and if you do, include conio.h
getch ();
}
float getTaxAmount( float operand1, float operand2)
{
return operand1 * operand2;
}
float addTaxAmount( float operand1, float operand2)
{
return operand1 + operand2;
}
A few problems, comments included in red color.
About implicit main: http://cpwiki.sourceforge.net/Implicit_main
Float pointer numbers are double by default, unless you add f to the end, and since you are using a float datatype, then you should add f to the end.
And you must understand that to call a function, you must add ( and ), and within those, you pass the arguments to the function. Otherwise, you take the address of the function, which is not what you want.
And it's usually considered bad practice to remove the names from the parameters in the function prototypes:
Code:
void foo(int); // Bad
void foo (int x); // Good
OK, so this isn't the best name for the parameter there, but it's just an example.