Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this database code in c++? db.h #ifndef DB_H_ #define DB_H_ #include #include bst.h using namespace std; class SNode : public Node {

Need help with this database code in c++?

db.h

#ifndef DB_H_ #define DB_H_ #include #include "bst.h"

using namespace std;

class SNode : public Node { private: string first; string last; unsigned int age; static unsigned int num_students; public: // Constructors and destructor SNode(); SNode(string f_, string l_, unsigned int a_); ~SNode();

// public interface void change_first(string f_); void change_last(string l_);

string get_first(); string get_last(); unsigned int get_age(); void print_info(ostream& to); }; #endif

db.cc

#include "db.h" // --------------------------------------------- // SNode class // Default constructor // TODO: Implement this // BASIC function header is provided for so that the code will compile // The actual function header may be different SNode::SNode() { }

// Constructor // TODO: Implement this // BASIC function header is provided for so that the code will compile // The actual function header may be different SNode::SNode(string f_, string l_, unsigned int a_) {

} // Destructor SNode::~SNode() { // TODO: Implement this }

unsigned int SNode::num_students = 0;

// Public interface void SNode::change_first(string f_) { // TODO: Implement this } void SNode::change_last(string l_) { // TODO: Implement this } string SNode::get_first() { // TODO: Implement this } string SNode::get_last() { // TODO: Implement this } unsigned int SNode::get_age() { // TODO: Implement this } // Print information about the student // do not change this void SNode::print_info(ostream& to) { to << "Student ID: " << this->get_key() << "\tFirst: " << this->first << "\tLast: " << this->last << "\tAge: " << this->age << endl; } // -------------------------

Input file :

Noel Cummings 83 Kian Avery 86 Eliana Knox 77 Paisley Peck 15 Michael Mcgrath 93 Makayla Dixon 35 Mara Singh 86 Aaliyah Arias 92 Hector Nicholson 49 Leo Holder 21 Dangelo Ball 62 Dario Kaufman 27 Brett Ho 90 Jamarcus Castro 59 Sheldon Burnett 63 Van Bautista 26 Gabriel Kelley 40 Kristin Walker 26 Stephany Figueroa 72 Carsen Mullen 36 Wendy Singh 11 Ava Carlson 68 Vaughn Boone 67 Grant Simpson 29 Urijah Oneal 82 Melissa Larson 30 Javier George 62 Roland Walters 23 Brooklyn Mcpherson 67 Cayden Mccarthy 35 Dixie Parrish 29 Jaslyn Hinton 2 Rory Hahn 22 Diamond Lawson 58 Jasper Franco 69 Kendal Wheeler 67 Odin Browning 93 Kenna Benson 56 Reese Walters 11 Thalia Tran 42 Chad Horton 29 Asher Cardenas 73 Angel Finley 21 Charlotte Gray 19 Delilah Hoover 84 Drew Mckenzie 37 Brandon Mahoney 98 Cristian Chandler 24 Leonel Briggs 15 Gracie Buchanan 70

Output file:

Student ID: 0 First: Noel Last: Cummings Age: 83 Student ID: 1 First: Kian Last: Avery Age: 86 Student ID: 2 First: Eliana Last: Knox Age: 77 Student ID: 3 First: Paisley Last: Peck Age: 15 Student ID: 4 First: Michael Last: Mcgrath Age: 93 Student ID: 5 First: Makayla Last: Dixon Age: 35 Student ID: 6 First: Mara Last: Singh Age: 86 Student ID: 7 First: Aaliyah Last: Arias Age: 92 Student ID: 8 First: Hector Last: Nicholson Age: 49 Student ID: 9 First: Leo Last: Holder Age: 21 Student ID: 10 First: Dangelo Last: Ball Age: 62 Student ID: 11 First: Dario Last: Kaufman Age: 27 Student ID: 12 First: Brett Last: Ho Age: 90 Student ID: 13 First: Jamarcus Last: Castro Age: 59 Student ID: 14 First: Sheldon Last: Burnett Age: 63 Student ID: 15 First: Van Last: Bautista Age: 26 Student ID: 16 First: Gabriel Last: Kelley Age: 40 Student ID: 17 First: Kristin Last: Walker Age: 26 Student ID: 18 First: Stephany Last: Figueroa Age: 72 Student ID: 19 First: Carsen Last: Mullen Age: 36 Student ID: 20 First: Wendy Last: Singh Age: 11 Student ID: 21 First: Ava Last: Carlson Age: 68 Student ID: 22 First: Vaughn Last: Boone Age: 67 Student ID: 23 First: Grant Last: Simpson Age: 29 Student ID: 24 First: Urijah Last: Oneal Age: 82 Student ID: 25 First: Melissa Last: Larson Age: 30 Student ID: 26 First: Javier Last: George Age: 62 Student ID: 27 First: Roland Last: Walters Age: 23 Student ID: 28 First: Brooklyn Last: Mcpherson Age: 67 Student ID: 29 First: Cayden Last: Mccarthy Age: 35 Student ID: 30 First: Dixie Last: Parrish Age: 29 Student ID: 31 First: Jaslyn Last: Hinton Age: 2 Student ID: 32 First: Rory Last: Hahn Age: 22 Student ID: 33 First: Diamond Last: Lawson Age: 58 Student ID: 34 First: Jasper Last: Franco Age: 69 Student ID: 35 First: Kendal Last: Wheeler Age: 67 Student ID: 36 First: Odin Last: Browning Age: 93 Student ID: 37 First: Kenna Last: Benson Age: 56 Student ID: 38 First: Reese Last: Walters Age: 11 Student ID: 39 First: Thalia Last: Tran Age: 42 Student ID: 40 First: Chad Last: Horton Age: 29 Student ID: 41 First: Asher Last: Cardenas Age: 73 Student ID: 42 First: Angel Last: Finley Age: 21 Student ID: 43 First: Charlotte Last: Gray Age: 19 Student ID: 44 First: Delilah Last: Hoover Age: 84 Student ID: 45 First: Drew Last: Mckenzie Age: 37 Student ID: 46 First: Brandon Last: Mahoney Age: 98 Student ID: 47 First: Cristian Last: Chandler Age: 24 Student ID: 48 First: Leonel Last: Briggs Age: 15 Student ID: 49 First: Gracie Last: Buchanan Age: 70 ------------------------------------------------- First student ever: Student ID: 0 First: Noel Last: Cummings Age: 83 Last student to join: Student ID: 49 First: Gracie Last: Buchanan Age: 70 Information on student: 36 Student ID: 36 First: Odin Last: Browning Age: 93 Removing student...student successfully removed ------------------------------------------------- Student ID: 0 First: Noel Last: Cummings Age: 83 Student ID: 1 First: Kian Last: Avery Age: 86 Student ID: 2 First: Eliana Last: Knox Age: 77 Student ID: 3 First: Paisley Last: Peck Age: 15 Student ID: 4 First: Michael Last: Mcgrath Age: 93 Student ID: 5 First: Makayla Last: Dixon Age: 35 Student ID: 6 First: Mara Last: Singh Age: 86 Student ID: 7 First: Aaliyah Last: Arias Age: 92 Student ID: 8 First: Hector Last: Nicholson Age: 49 Student ID: 9 First: Leo Last: Holder Age: 21 Student ID: 10 First: Dangelo Last: Ball Age: 62 Student ID: 11 First: Dario Last: Kaufman Age: 27 Student ID: 12 First: Brett Last: Ho Age: 90 Student ID: 13 First: Jamarcus Last: Castro Age: 59 Student ID: 14 First: Sheldon Last: Burnett Age: 63 Student ID: 15 First: Van Last: Bautista Age: 26 Student ID: 16 First: Gabriel Last: Kelley Age: 40 Student ID: 17 First: Kristin Last: Walker Age: 26 Student ID: 18 First: Stephany Last: Figueroa Age: 72 Student ID: 19 First: Carsen Last: Mullen Age: 36 Student ID: 20 First: Wendy Last: Singh Age: 11 Student ID: 21 First: Ava Last: Carlson Age: 68 Student ID: 22 First: Vaughn Last: Boone Age: 67 Student ID: 23 First: Grant Last: Simpson Age: 29 Student ID: 24 First: Urijah Last: Oneal Age: 82 Student ID: 25 First: Melissa Last: Larson Age: 30 Student ID: 26 First: Javier Last: George Age: 62 Student ID: 27 First: Roland Last: Walters Age: 23 Student ID: 28 First: Brooklyn Last: Mcpherson Age: 67 Student ID: 29 First: Cayden Last: Mccarthy Age: 35 Student ID: 30 First: Dixie Last: Parrish Age: 29 Student ID: 31 First: Jaslyn Last: Hinton Age: 2 Student ID: 32 First: Rory Last: Hahn Age: 22 Student ID: 33 First: Diamond Last: Lawson Age: 58 Student ID: 34 First: Jasper Last: Franco Age: 69 Student ID: 35 First: Kendal Last: Wheeler Age: 67 Student ID: 37 First: Kenna Last: Benson Age: 56 Student ID: 38 First: Reese Last: Walters Age: 11 Student ID: 39 First: Thalia Last: Tran Age: 42 Student ID: 40 First: Chad Last: Horton Age: 29 Student ID: 41 First: Asher Last: Cardenas Age: 73 Student ID: 42 First: Angel Last: Finley Age: 21 Student ID: 43 First: Charlotte Last: Gray Age: 19 Student ID: 44 First: Delilah Last: Hoover Age: 84 Student ID: 45 First: Drew Last: Mckenzie Age: 37 Student ID: 46 First: Brandon Last: Mahoney Age: 98 Student ID: 47 First: Cristian Last: Chandler Age: 24 Student ID: 48 First: Leonel Last: Briggs Age: 15 Student ID: 49 First: Gracie Last: Buchanan Age: 70 -------------------------------------------------

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

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions

Question

What is a job specification?

Answered: 1 week ago

Question

6. Vanguard

Answered: 1 week ago