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

write a Student information program. Your program should be able to add new stud

ID: 3559615 • Letter: W

Question

write a Student information program. Your program should be able to add new students to its
database, also it should be able to search for students using the first name last name pairs or Student IDs provided as
input by user and you need to have an option of printing all the information on the screen. To do so you should
create a structure named studentInfo. It must contain, firstName, lastName, ID, address, phoneNumber, birthDate,
startDate, endDate, gpa, creditHours and courseList. courseList should be a structure list type itself, having
courseName, creditHours and score array of size 20 and listLength variable inside. Also you can have a structure for
storing dates (birthDate, startDate, endDate) or you can have them as simple strings.
You program needs to perform following tasks using functions and present the following menu choices to the user:
1. Add a new record to Studen Information System
2. Search for a particular record based on name of the student
3. Search for a particular record based on student ID
4. Display the all the student information stored in system
5. Quit the program
You need to add two student information inline your code, so you don

Explanation / Answer

#include <stdio.h>
#include <ctype.h>

struct Student
{
int ID;
char LastName[32];
char FirstName[32];
int DateOfBirth; // This could be of the form YYYYMMDD. For example someone born on December 21st, 1990 would have a value of 19901221
char Address[32];
char TelephoneNumber[11]; // a 10-digit string
char ProgramPursued[32];
};


char GetUserOption()
{
char option = 'I'; // 'I' for Invalid

while(option == 'I')
{
// Print the menu items
printf(" ");
printf("Choose one of the following options: [u]pdate [P]rint [S]earch [E]xit ");
scanf("%c", &option);

switch(toupper(option))
{
case 'U':
case 'P':
case 'S':
case 'E':
break;
default:
option = 'I';
break;
}
}

return option;
}


// students must hold 10 students
void LoadStudents(Student students[])
{
// TODO: load students from file
}


// students must hold 10 students
void SaveStudents(Student students[])
{
// TODO: save students to file
}


int main()
{
Student students[10];
int looping = 1;

// Load the students from the file
LoadStudents(students);

// Loop until exit
while(looping)
{
char option = GetUserOption();
switch(option)
{
case 'U':
// TODO: Let the user update a record
break;

case 'P':
// TODO: Print the students to the screen
break;

case 'S':
// TODO: Let the user search for a student
break;

case 'E':
looping = 0; // exit the loop
break;
}
}

// Save the students to the file
SaveStudents(students);

return 0;