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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started