Question: Create a simple student database program in C + + that allows adding, displaying, and deleting student records using pointers, structs, and functions. The program

Create a simple student database program in C++ that allows adding, displaying, and deleting student records using pointers, structs, and functions. The program should be divided into multiple files for clear organization.
Requirements:
Struct Definition (Student.h):
Define a struct named Student in a header file (Student.h). The Student struct should contain at least the following fields:
int id - for the student's ID.
char name[100]- for the student's name.
float gpa - for the student's GPA.
Database Functions (Database.cpp and Database.h):
Implement the following functions in Database.cpp and declare them in Database.h:
void addStudent(Student* &students, int &size, Student newStudent)- Adds a new student to the array. This function should reallocate the students array to accommodate the new student.
void displayStudents(const Student* students, int size)- Displays all students in the database.
void deleteStudent(Student* &students, int &size, int id)- Deletes a student by ID. This function should reallocate the students array to remove the student without leaving a gap.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!