Code:
#include <stdio.h>
int main()
{
int Orange;
int Apple;
int Pear;
int Budget;
char ItemChosen;
printf("Please enter the price of oranges :");
scanf_s("%d", &Orange);
printf("Please enter the price of Apples :");
scanf_s("%d", &Apple);
printf("Please enter the price of Pears :");
scanf_s("%d", &Pear);
printf("**************************************\n");
printf("Hello and welcome to my fruit shop\n");
printf("Please enter your budget : ");
scanf_s("%d", &Budget);
printf("**************************************\n");
printf("Shop Menu : \n");
printf("Item: Price:\n");
printf("O: %d\n", Orange);
printf("A: %d\n", Apple);
printf("P: %d\n", Pear);
printf("**************************************\n");
printf("Please type what item of fruit you would like to purchase : ");
scanf_s(" %c", &ItemChosen, 1);
// I am not sure how to get the integer from the fruit the customer selects
if ( <= Budget)
{
printf("Your purchase has been successful\n");
printf("Purchase details\n");
printf("---------------------------------\n");
printf("Item selected : %c\n", ItemChosen);
printf("item price : %d", );
}
else if ( > Budget);
{
printf("Error Your budget has insignificant funds\n");
printf("Thanks for shopping with us!");
}
return 0;
if there is any other faults in the code please make me aware