Question: c++ This code is to look at employees former and present you can add, fire, grade etc employees who work for you. Create a code

c++

This code is to look at employees former and present you can add, fire, grade etc employees who work for you.

Create a code that will give the user the option to do the following:

1.)Add a Employee 2.)Fire a Employee 3.)Grade a Employee 4.)View all Employes who still work for the company and also employees who have left. 5.)View all current Employees 6.)View all fired Employees

*use string_views when you are able 2*

( Employees is graded between 0 or 5.)

In this code You will need an implementation of the Dbase class(shown below). Try and Implement the code below into this Employee program.

Dbase.cpp code//////

using namespace std;

namespace Work{

Student& DBase::addStudent(const string& firstName,

const string& lastName)

{

Student theStudent{ firstName, lastName };

theStudent.setStudentNumber(m_nextStudentNumber++);

theStudent.Enroll();

m_Students.push_back(theStudent);

return m_Students.back();

}

Student& DBase::getStudent(int StudentNumber)

{

for (auto& Student : m_Students) {

if (Student.getStudentNumber() == StudentNumber) {

return Student;

}

}

throw logic_error{ "No Student found." };

}

Student& DBase::getStudent(const string& firstName, const string& lastName)

{

for (auto& Student : m_Students) {

if (Student.getFirstName() == firstName &&

Student.getLastName() == lastName) {

return Student;

}

}

throw logic_error{ "No Student found." };

}

void DBase::displayAll() const

{

for (const auto& Student : m_Students) {

Student.display();

}

}

void DBase::displayCurrent() const

{

for (const auto& Student : m_Students) {

if (Student.isEnrolled()) {

Student.display();

}

}

}

void DBase::displayFormer() const

{

for (const auto& Student : m_Students) {

if (!Student.isEnrolled()) {

Student.display();

}

}

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!