Question: You have decided to operate a small restaurant which only does online delivery,you have been given a task to construct a C program with user
You have decided to operate a small restaurant which only does online delivery,you have been given a task to construct a C program with user defined functions and numeric arrays to build a database of the customers. The constructed C program must be able to save FIVE(5) information of customers which are the (name,mobile phone number,gender,email address of customer and whether the person is a vegan or not).
#include
void main()
{
struct details
{
char name[20];
int mobile;
char gender[15];
char emailid[50];
char vagenornonveg[10];
};
struct details customer[50];
int n, i;
printf("Enter number of customers");
scanf("%d", &n);
fflush(stdin);
for (i = 0; i < n; i++)
{
fflush(stdin);
printf("Customer name: ");
scanf("%s", customer[i].name);
fflush(stdin);
printf("Mobile No. ");
scanf("%d", &customer[i].mobile);
fflush(stdin);
printf("Gender ");
scanf("%s", customer[i].gender);
fflush(stdin);
printf("Email id: ");
scanf("%s", customer[i].emailid);
fflush(stdin);
printf("Vegan/Non-Vegeterian: ");
scanf("%s", customer[i].vagenornonveg);
}
printf(" ***** RESTAURANT ***** ");
printf("--------------------------------------------------------- ");
printf("S.N.| NAME | MOBILE NO. |GENDER | EMAIL ID | VEGAN/NON-VEG ");
printf("------------------------------------------------------------------ ");
for (i = 0; i < n; i++)
printf("%-d %-s %-d %-s %-s %-s ", i + 1, customer[i].name, customer[i].mobile, customer[i].gender,
customer[i].emailid, customer[i].vagenornonveg);
printf("------------------------------------------------------------------ ");
}
note to expert: okay so basically that was the question for the assignment and that is my answer which is already correct,what I need to do now is I have to write a report about the methodology of how I got that specific coding and a flow chart to explain the specific coding. Can u please help me write the report I need it so bad
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
