Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include Student.h using namespace std; int main() { Student* students = nullptr; Student obj; int numStudents = 0; bool done = false; while (!done)

#include #include "Student.h" using namespace std;

int main() { Student* students = nullptr; Student obj; int numStudents = 0;

bool done = false; while (!done) { std::cout > choice;

switch (choice) { case 1: obj.addStudent(students, numStudents); break; case 2: obj.searchForStudent(students, numStudents); break; case 3: obj.showListOfStudents(students, numStudents); break; case 4: done = true; break; default: cout

} }

delete[] students; return 0; }

________

#include #include "Student.h" #include

using namespace std;

Student::Student() { const int temp = 200; street = new char[temp]; city = new char[temp]; state = new char[temp]; studentName = new char[temp]; id = 0; }

Student::~Student() { delete[] street; delete[] city; delete[] state; delete[] studentName; }

void Student::addStudent(Student*& students, int& numStudents) { system("CLS"); Student* newStudents = new Student[numStudents + 1];

for (int i = 0; i

cout > newStudents[numStudents].studentName; cout > newStudents[numStudents].street; cout > newStudents[numStudents].city; cout > newStudents[numStudents].state; cout > newStudents[numStudents].id;

numStudents++; delete[] students; students = newStudents; }

void Student::searchForStudent(Student* students, int numStudents) { system("CLS"); std::cout > name;

for (int i = 0; i

std::cout

void Student::showListOfStudents(Student* students, int numStudents) { system("CLS"); cout

________ #include #include using namespace std;

const int temp = 200;

class Student {

private: char* street; char* city; char* state; char* studentName; long id;

public:

Student();

~Student(); void addStudent(Student*& students, int& numStudents); void searchForStudent(Student* students, int numStudents); void showListOfStudents(Student* students, int numStudents); };

image text in transcribed

My show student list keeps showing up like, would appreciate if someone could show me what I did wrong. c++

Sergio (154362) Menu: 1. Add student 2. Search for student 2. Search for student 4. Exit

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

Database And Expert Systems Applications Dexa 2022 Workshops 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 In Computer And Information Science 33

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Alfred Taudes ,Atif Mashkoor ,Johannes Sametinger ,Jorge Martinez-Gil ,Florian Sobieczky ,Lukas Fischer ,Rudolf Ramler ,Maqbool Khan ,Gerald Czech

1st Edition

3031143426, 978-3031143427

More Books

Students also viewed these Databases questions