Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please visual software for th following program: Please; Provide an output pleas

ID: 3763259 • Letter: P

Question

Please visual software for th following program: Please; Provide an output please and please help Write the program A sales company wants to have a program to keep track of their employees' pays per each quarter. There are two types of employees: Managers and SalesReps. Note that a manager has a fixed monthly income of $3,500 but a sales representative has a base salary of $2,000 plus a 5% commission rate of the sales amount. Come up with class declarations in which one class is an abstract class, and other classes are derived from the abstract class. The classes will be used for a polymorphic application. The derived classes should have at least two public member functions. Submit the following items: -Abstract class declaration. -first derived class declaration. -second derived class declaration - main( ) that contains declarations of objects and use objects to call their member functions.

Explanation / Answer

#include <iostream>
using namespace std;
class Employee       //Base class.
{
protected:
string firstName;
string lastName;
public:
virtual void showDetails() = 0;       //Virtual class.
virtual void getName(string, string);   //Virtual class.
};
void Employee::getName(string f, string l)   //Virtual function definition.
{
firstName = f;
lastName = l;
}
class Managers : public Employee   //Derived class.
{
static const double salary = 3500;
public:
void showDetails()   //Defining virtual function.
{
cout<<"Name: "<<firstName<<" "<<lastName<<endl;
cout<<"Salary: "<<salary;
}
  
};

class SalesRep : public Employee   //Derived class.
{
static const double basePay = 2000;
static const double commissionRate = 0.05;
double salesAmount;
double totalPay;
public:
void showDetails()       //Defining virtual function.
{
cout<<"Name: "<<firstName<<" "<<lastName<<endl;
cout<<"BasePay: "<<basePay<<endl;
cout<<"Sales Amount: "<<salesAmount<<endl;
cout<<"TotalSalary: "<<totalPay<<endl;
}
void getSalesAmount(double slAmt)
{
salesAmount = slAmt;
}
void calcTotalPay()
{
totalPay = basePay + salesAmount * commissionRate;
}
};

int main()
{
Managers m1;
SalesRep s1;
m1.getName("Mark", "Luther");
s1.getName("Chelsie", "Florence");
s1.getSalesAmount(20000);
s1.calcTotalPay();
s1.showDetails();
cout<<endl;
m1.showDetails();
cout<<endl;
}