I am receiving this error
markup.c: In function ‘GetPrice’:
markup.c:16:23: error: ‘markup’ undeclared (first use in this function)
markup.c:16:23: note: each undeclared identifier is reported only once for each function it appears in
markup.c:17:1: error: ‘output’ undeclared (first use in this function)
here is my codes
// File: markup.c
#include<stdio.h>
// define the value for constant MARKUP
#define MARKUP 0.1
float GetPrice(float finalvalue)
{
finalvalue=finalvalue-markup*100;
output=finalvalue;
return (float)output;
}
int main()
{
// declare variables
char proceed;
float markupvalue;
float value;
float finalvalue;
float markup=0.1;
// ask user if they want to use markup calculator
printf("Would you like to markup an item? y/n:");
scanf("%c", &proceed);
// if yes, proceed to next step
if(proceed == 'y')
{
// ask user what item they want to markup
printf("please enter item value you would like to markup:");
scanf("%f", &value);
// print current of an item
printf("The value you entered is: %c%.2f\n",'$',value);
// display current markup rate
printf("The current markup rate is %.1f%c.\n",markup*100,'%');
finalvalue=(value-markup*100);
// final price of an item
printf("The price for your item after markup is: %c%.2f\n",'$',(float)GetPrice(finalvalue));
}else
// display this message if user don't want to use markup calculator
printf("If you didn't want to markup an item you can leave. \n\n");
// display end message
printf("Thank you for using Markup Calculator. \n");
return 0;
}