Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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 Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

Why would unions target health care workers?

Answered: 1 week ago

Question

How many multiples of 4 are there between 10 and 250?

Answered: 1 week ago

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago