Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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 Senior

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

2. What should an employer do when facing an OSHA inspection?

Answered: 1 week ago