Question
Consider a table in which each row stores the information of a student: a unique Id, Name, Address, and Status. Assume Status takes one of
Consider a table in which each row stores the information of a student: a unique Id, Name, Address, and Status. Assume Status takes one of the four values: Freshman, Sophomore, Junior or Senior. Define and implement a C++ class Student with the following methods: 1) Constructor Student() which creates an empty student table. 2) Constructor Student(int id, string name, string address, string status) which creates a student table that contains one single student of the given information. 3) int count() returns the total number of students in the table. 4) void print() which prints out the whole table on the screen. 5) void select(int id) which prints out all the information for the given student of ID id. 6) Student selectFreshman() which returns a table of all the freshman students. 7) bool insert(int id, string name, string address, string status) which inserts a new student into the table. It returns true if the insert is performed successfully, and false otherwise. 8) bool delete(int id) which deletes an existing student with ID id. It returns true if the delete is performed successfully, and false otherwise. 9) bool update(int id, string name, string address, string status) which updates the information (name, address, status) for an existing student with Id id. It returns true if the update is performed successfully, and false otherwise. 10) Student sortById() which returns the sorted table of Student by Id in the ascending order. Write another class Test to test the above methods. You can use the following table to test your program, although another table will be used in grading.
Id 111111111 222222222 333333333 444444444 Name John Mary Arthur Phil Address 123 Success 456 Main St 789 Long lake 012 Duke Status Freshman Sophomore Junior SeniorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started