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 Studenth:
Define a struct named Student in a header file Studenth The Student struct should contain at least the following fields:
int id for the student's ID
char name for the student's name.
float gpa for the student's GPA.
Database Functions Databasecpp and Database.h:
Implement the following functions in Database.cpp and declare them in Database.h:
void addStudentStudent &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 displayStudentsconst Student students, int size Displays all students in the database.
void deleteStudentStudent &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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
