You are required to propose FOUR functions to develop a complete student record management system. The function are insert, delete, search, update. In addition, you need to use sorted array to complete the system development. Write a program by extending the code from the lab. Think and implement 4 more functions in the program (compulsory function is sorting and searching) Your must build on top of the following code. //FileName: Student.cpp //This program illustrates attributes of class Student using simple data structure #include class Student { private: struct Data { char Name[25]; char Course[30]; int Result; } stdata; public: void SetData(); void GetData(); };//class Student void Student::SetData() { cout <<”Enter student name:”; cin>> stdata.Name; cout<< “Enter student course: “; cin>> stdata.Course; cout<< “Enter student result:”; cin>> stdata.Result; };//method SetData void Student::GetData() { cout<< “\n Student name:” < #include “Student.cpp” int main() { const int size =5; int i; //create a new instance of student in array Student studentinmyclass[size]; for(int=0; i
You are required to propose FOUR functions to develop a complete student
record management system. The function are insert, delete, search, update.
In addition, you need to use sorted array to complete the system development.
- Write a
program by extending the code from the lab. - Think and implement 4 more functions in the program (compulsory function is sorting and
searching) - Your must build on top of the following code.
//FileName: Student.cpp
//This program illustrates attributes of class Student using simple data structure
#include <iostream.h>
class Student {
private:
struct Data {
char Name[25];
char Course[30];
int Result;
} stdata;
public:
void SetData();
void GetData();
};//class Student
void Student::SetData()
{
cout <<”Enter student name:”;
cin>> stdata.Name;
cout<< “Enter student course: “;
cin>> stdata.Course;
cout<< “Enter student result:”;
cin>> stdata.Result;
};//method SetData
void Student::GetData()
{
cout<< “\n Student name:” <<stdata.Name;
cout<< “\n”;
cout<< “\nStudent course:” << stdata.Course;
cout<<”\n”;
cout<<”\nStudent result:” << stdata.Result;
cout<<”\n”;
};// method GetData
//Filename: StudentD.cpp
//This program serves as a driver(main)for class Student with simple data structure. It instantiates
the class Student and call methods from class Student
#include “Student.cpp”
int main()
{
//Create a new instance of student
Student student1;
//invoke methods
student1.SetData();
student1.getData();
return 0;
};
/FileName: StudentL.cpp
//The is program shows for loop example. It instantiates the class Student using struct for its data
and call methods from class Student
#include<iostream.h>
#include “Student.cpp”
int main() {
const int size =5;
int i;
//create a new instance of student in array
Student studentinmyclass[size];
for(int=0; i<size; i++) {
//invoke method
studentinmyclass[i].SetData();
};
cout<< “\nThe students in my class are “<< “\n”;
for(I =0;i<size; i++){
studentinmyclass[i]GetData();
};
return 0;
}
Step by step
Solved in 3 steps