I did put in the function prototype, but it said missing ..
can someone tell me the mistakes ?Code:#include<stdio.h> int fnDeterminePrice(int); float fnCalc(float , int); void fnPrintResult(float); void fnMenu(); int main() { int iCode, iQty; float fPrice, fPay; fnMenu(); printf("enter item code and quantity:"); scanf("%d %d", &iCode,&iQty); fPrice = fnDeterminePrice( iCode); fPay = fnCalc( fPrice , iQty); fnPrintResult(fPay); return 0; } void fnMenu() { printf("1:Nasi lemak , 2:mee, 3 : sushi "); } int fnDeterminePrice( int itemCode) { float fPricing; switch (itemCode) { case 1 : fPricing = 1.50; break; case 2 : fPricing = 2.00; break; case 3 : fPricing - 3.40; break; default : fPricing = 0.00; } return (fPricing); } float fnCalc( float fitemPrice , int iQuantity ) { float total; total = fitemPrice * iQuantity ; return ( total); } void fnPrintResult( float fPayment ) { printf("the price is %.3f " , fPayment); }
thank you



1Likes
LinkBack URL
About LinkBacks


