fix my codes!!! #include #include int main() { char name [10][100]; int fc = 0, current=0,addvegetables,Name,vegetables,remark; printf(" \n Welcome to my farm !!!!!!!!! \n"); int choice, i=0; int quantity; do{ printf("------------------------------------------\n\n"); printf("1. press to ADD vegetables\n"); printf("2. PRESS TO UPDATE vegetables \n"); printf("3. PRESS TO DISPLAY vegetables \n"); printf("4. Exit \n"); printf("------------------------------------------\n\n"); printf("Enter your choice:"); scanf("%d",&choice); switch(choice){ case 1: printf("\nAdd vegetables: "); scanf(" %s",& addvegetables); printf("Quantity: "); scanf("%d",&quantity); fc++; break; case 2: printf("\nSearch vegetables: "); scanf(" %s\n",&Name); for(i=0; i

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

please fix my codes!!!

#include <stdio.h>
#include<string.h>
int main()
{
char name [10][100];
int fc = 0, current=0,addvegetables,Name,vegetables,remark;
printf(" \n Welcome to my farm !!!!!!!!! \n");
int choice, i=0;
int quantity;
do{
printf("------------------------------------------\n\n");
printf("1. press to ADD vegetables\n");
printf("2. PRESS TO UPDATE vegetables \n");
printf("3. PRESS TO DISPLAY vegetables \n");
printf("4. Exit \n");
printf("------------------------------------------\n\n");
printf("Enter your choice:");
scanf("%d",&choice);

switch(choice){
case 1:
printf("\nAdd vegetables: ");
scanf(" %s",& addvegetables);
printf("Quantity: ");
scanf("%d",&quantity);
fc++;
break;
case 2:
printf("\nSearch vegetables: ");
scanf(" %s\n",&Name);
for(i=0; i<fc ; i++){
char Name[100];
if (strcmp(vegetables, Name) == 0){
printf("Current Quantity: %d",current);
printf("\nEnter Quantity: ");
scanf("%d",&quantity);
}
}
break;
case 3:
printf("\n\nVegatables\t Quantity\t Remarks \n ");
for(i=0; i<fc ; i++){
printf("%d %s \t%d ",(i+1),Name,quantity,remark);
if(quantity < 10){
printf("\t warning \n");
}else{
printf("\t ok \n");
}
}
break;
case 4:
default :
printf(" work hard play hard \n");
break;
}
}while(choice != 4);

}

sample output :

1.  press Add vegetables
2. press Update vegetables
3. press Display vegetables
4. Exit
Choice: 1

Add vegetables: lettuce
Quantity: 40

1.  press Add vegetables
2. press Update vegetables
3. press Display vegetables
4. Exit
Choice: 1

Add fruit: carrot
Quantity: 10

1.  press Add vegetables
2. press Update vegetables
3. press Display vegetables
4. Exit
Choice: 3

vegetables        Quantity            Remarks
1. lettuce          40                ok
2. carrot      10               ok

1.  press Add vegetables
2. press Update vegetables
3. press Display vegetables
4. Exit
Choice: 2

Search vegetables: lettuce
Current quantity: 40
Enter Quantity:  35

1.  Add vegetables
2. Update vegetables
3. Display vegetables
4. Exit
Choice: 3

vegetables            Quantity            Remark
1. lettuce          5                  bad
2. carrot      10               ok

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education