Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Following code to be written in C You are required to create a student managemen

ID: 3618087 • Letter: F

Question

Following code to be written in C

You are
required to create a student management system that will allow youto
store and update student records. Each student record shouldconsist of
an id, a name (first name and last name), date of
birth,address,telephone number and the program being pursued.

Assume
10 records will be stored.

1. Create and populate an
array of records. Store records into file.

2. Allow user
to update a record. Note, the user should only manipulate thedata
structure. All changes to the data structure should then be usedto
overwrite the file.

3. Allow user to search for a record
from the data structure.

4. Print all records from the
structure.
N.B.Student should Create Appropriatefunctions to solve the problem.

what needs to be done:-
edit the C programming so that itcan save its INPUTS so that the records will be saved in a fileexample ( studentrecords.txt ) so that it can be accessed later..sowhen the program closes and start up back, there will be the samerecords from the files, entered previously ......
____________________________________________________________________________
#include<stdio.h>
#include<conio.h>
struct SMS
   {int id;
   char first[15];
   char last[15];
   char dob[11];
   char phone[15];
   char program[20];
}stu[10];
int create(struct SMS[],int);
int search(struct SMS[],int );
void update(struct SMS[],int);
void print(struct SMS[],int);
void printstudent(struct SMS[],int,int);
int menu();
int main()
{int choice,n=0,m;
for(;;)
{
choice=menu();
switch (choice)
   {case 1: n=create(stu,n);break;
     case 2:update(stu,n);break;
    case 3: m=search(stu,n);
           if(m>=n)
              printf("student not in data base ");
           else
              printstudent(stu,n,m);
           break;
    case 4: print(stu,n);break;
    case 5: return 0;
}
}
getch();
return 0;
}
int menu()
{int choice;
printf("What would you like to do to the database? ");
printf("1. create 2. update 3. search 4. print 5. Quit Enterchoice: ");
scanf("%d",&choice);
while(choice<1||choice>5)
    {printf("Invalid entry ");
     printf("What would you like to do to thedatabase? ");
     printf("1. create 2. update 3.search 4. print 5. Quit Enter choice: ");
     scanf("%d",&choice);
     }
return choice;
}
int create(struct SMS stu[],int n)
{int i=n;
printf("Enter id(<0 when done): ");
scanf("%d",&stu[i].id);
while(stu[i].id>0)
{printf("Enter last name: ");
scanf("%s",&stu[i].last);
printf("Enter first name: ");
scanf("%s",&stu[i].first);
printf("Enter date of birth (mm/dd/yyyy): ");
scanf("%s",&stu[i].dob);
printf("Enter phone number ((xxx)-xxx-xxxx): ");
scanf("%s",&stu[i].phone);
printf("Enter program of study: ");
scanf("%s",&stu[i].program);
i++;
printf("Enter id(<0 when done): ");
scanf("%d",&stu[i].id);
}
return i;
}
void update(struct SMS stu[],int n)
{int i;

}
int search(struct SMS stu[],int n)
{int i,m;
printf("Enter id to search: ");
scanf("%d",&m);
for(i=0;i<n;i++)
    if(m==stu[i].id)
         return i;
return i;
}
void print(struct SMS stu[],int n)
{int i;
printf("id first last    dob phone program ofstudy ");
for(i=0;i<n;i++)
printf("%d %s %s %s %s %s ",stu[i].id,stu[i].first,stu[i].last,stu[i].dob,
        stu[i].phone,stu[i].program);
}
void printstudent(struct SMS stu[],int n,int i)
{
printf("id first last    dob phone program ofstudy ");
printf("%d %s %s %s %s %s ",stu[i].id,stu[i].first,stu[i].last,stu[i].dob,
        stu[i].phone,stu[i].program);
}



Explanation / Answer

x.Xlor="red">pleaserate - thanks #include #include struct SMS    {int id;    char first[15];    char last[15];    char dob[11];    char phone[15];    char program[20]; }stu[10]; int create(struct SMS[],int); int search(struct SMS[],int ); void update(struct SMS[],int); void save(struct SMS[],int); void print(struct SMS[],int); void printstudent(struct SMS[],int,int); int menu(); int main() {int choice,n=0,m; for(;;) { choice=menu(); switch (choice)    {case 1: n=create(stu,n);break;      case 2:update(stu,n);break;     case 3: m=search(stu,n);             if(m>=n)                printf("student not in data base ");             else                printstudent(stu,n,m);             break;     case 4: print(stu,n);break;     case 5: save(stu,n);           return 0; } } getch(); return 0; } int menu() {int choice; printf(" *~*~*~*WeLcome To Dwayne Brown's And Mohit Belani'sProgram*~*~*~* "); printf("What would you like to do to the database? "); printf("1. Create 2. Update 3. Search 4. Print 5. Quit Enterchoice: "); scanf("%d",&choice); while(choice5)     {printf("Invalid entry ");      printf("What would you like to do to the database? ");      printf("1. create 2. update 3. search 4. print 5. Quit Enterchoice: ");      scanf("%d",&choice);      } return choice; } void save(struct SMS stu[],int n) {FILE *out; out = fopen("studentrecords.txt","w"); int i; for(i=0;i0)     {     printf("Enter last name: ");     scanf("%s",&stu[i].last);     printf("Enter first name: ");     scanf("%s",&stu[i].first);     printf("Enter date of birth (mm/dd/yyyy): ");     scanf("%s",&stu[i].dob);     printf("Enter phone number ((xxx)-xxx-xxxx): ");     scanf("%s",&stu[i].phone);     printf("Enter program of study: ");     scanf("%s",&stu[i].program);     i++;     printf(" Record of Student Saved. ");     printf(" You May Continue to Enter a another student record or exitwith (