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

develop a record-keeping system to manage the different types of insurance sales

ID: 3861045 • Letter: D

Question

develop a record-keeping system to manage the different types of insurance sales made by the various types of employees working at the company. Write a system that allows a user to input employee information and sales transactions and print sales information in various formats until the user terminates the session.

Description
There are three main types of insurance policies offered by the company:

Auto insurance policy

Policy information includes:
    - name of insured
    - make and model of automobile
    - VIN number (vehicle identification number)
    - amount of liability coverage in dollars
    - amount of collision coverage in dollars
Base sales commission is based on the formula:

commission = (liability + collision) * 30%


Home insurance policy

Policy information includes:
    - name of insured
    - house square footage
    - amount of dwelling coverage in dollars
    - amount of contents coverage in dollars
    - amount of liability coverage in dollars
Base sales commission is based on the formula:
commission = (liability * 30%) + ( (dwelling + contents) * 20% )

Life insurance policy

Policy information includes:
    - name of insured
    - age of insured
    - name of dependent
    - amount of term life coverage in dollars
Base sales commission is based on the following formula:
commission = term life * 20%

There are two main types of employees at the company:

Salesperson

Employee information includes:
    - name of employee
    - base salary in dollars
    - commission total in dollars
    - total salary in dollars
    - list of all sales made

Commission total is based on the following formula:
commission = commission total from all sales + ( commissions total from all sales * 5% )

Employee total salary is based on the following formula:
total salary = base salary + commission total

Manager

Employee information includes:
    - name of employee
    - base salary in dollars
    - commission total in dollars
    - total salary in dollars
    - list of all sales made
    - list of salespeople reporting to him/her

Commission total is based on the following formula:
commission =   commission total from all sales + ( commissions total from all sales * 30% ) +
                       ( commission total from all reporting salespeople * 5% )

Employee total salary is based on the following formula:
total salary = base salary + commission total

The company has asked for the record-keeping system to be able to print out sales information in various output formats including:

- List of employees only
- List of all sales only
- List of all sales made by all employees in tabular format
- List of all sales made by an individual employee
- List of all sales made by employees reporting to individual manager


Notes
1) Design and develop your C++ classes to accurately represent the data models and the tasks operating on the data models. Each class must have both a header file (.h) and a source file (.C). Design your classes with well-documented, sufficient design notes. Design notes will be collected and graded as part of the project grade.

2) Your program MUST make use of abstract classes, inheritance, polymorphism, and dynamic binding. You MUST document and diagram your class hierarchies used for this program as part of your design documents.

3) Your program MUST use the overloaded output stream operators.

4) You may assume that the company has a maximum of 10 employees with no more than 100 sales transactions.


Extra Credit
Use STL classes to allow your insurance system to store any number of employees and sales transactions.

Explanation / Answer

Project4.cpp

                                                         
#include "Project4.h"

char showMainMenu(void)
{
char c;
cout << endl << "            ----- Main Menu -----" << endl;
cout << " 1) Show All Employees" << endl;
cout << " 2) Show All Sales" << endl;
cout << " 3) Show Sales by Employees in Tabular Format" << endl;
cout << " 4) Show All Sales for One Employee" << endl;
cout << " 5) Show All Sales for Employees Reporting to One Manager" << endl;
cout << " 6) Add a New Employee" << endl;
cout << " 7) Add a New Policy" << endl;
cout << " 8) Exit" << endl;
cout << " Enter Selection: ";
cin >> c;
return c;
}

int main(void)
{
PolicyManager insurance;
char c = 1;
Employee *e;
insurance = PolicyManager();
while(c != 0)
{
  c = showMainMenu();
  switch(c)
  {
   case '1':
    insurance.showAllEmployees(EMPLOYEE_ALL);
   break;
   case '2':
    insurance.showAllSales();
   break;
   case '3':
    insurance.showTabularSales();
   break;
   case '4':
    e = insurance.selectEmployee(EMPLOYEE_ALL);
    if(e) insurance.showEmployeeSales(e);
   break;
   case '5':
    e = insurance.selectEmployee(EMPLOYEE_MANAGER);
    if(e) insurance.showManagerSales(e);
   break;
   case '6':
    insurance.employeeMenu();
   break;
   case '7':
    insurance.policyMenu();
   break;
   case '8':
    c = 0;
   break;
   default:
    cout << "Invalid selection" << endl;
   break;
  }
}
return 0;
}

Project4.h


#ifndef PROJECT4_H_
#define PROJECT4_H_

#include "PolicyManager.h"

char showMainMenu(void);

#endif

SalesPerson.cpp


#include "Salesperson.h"

Salesperson::Salesperson()
{
this->policyList.clear();
this->manager = 0;
return;
}

Salesperson::~Salesperson()
{
return;
}

// Calculate the total salary
void Salesperson::calcCommission(void)
{
//commission = commission total from all sales +
//      ( commissions total from all sales * 5% )
this->commissions = this->accumulateCommission() * 1.05;
this->calcTotalSalary();
return;
}

// Set the manager pointer
void Salesperson::setManager(Employee *manager)
{
this->manager = manager;
}

// Get the manager pointer
Employee *Salesperson::getManager(void)
{
return this->manager;
}

SalesPerson.h


#ifndef SALESPERSON_H_
#define SALESPERSON_H_

#include "Employee.h"

class Salesperson: public Employee
{
public:
  Salesperson();
  virtual ~Salesperson();
  virtual int isManager(void) { return 0; }; // return 0, not a manager
  virtual void calcCommission(void); // Calculate the total salary
  void setManager(Employee *manager); // Set the manager pointer
  Employee *getManager(void); // Get the manager pointer
private:
  // Update the manager's salary if this employee's commissions change
  Employee *manager;
};

#endif

PolicyManager.cpp


#include "PolicyManager.h"

PolicyManager::PolicyManager()
{
this->employees.clear();
this->policies.clear();
return;
}

PolicyManager::~PolicyManager()
{
unsigned int a;
// Go through all employees and policies and delete them
for(a = 0; a < this->employees.size(); a++) delete(this->employees.at(a));
for(a = 0; a < this->policies.size(); a++) delete(this->policies.at(a));
return;
}
unsigned int PolicyManager::showAllEmployees(int isType)
{
Employee *emp;
unsigned int e;
string s;
switch(isType)
{
  case EMPLOYEE_ALL:
   s = "Employees";
  break;
  case EMPLOYEE_MANAGER:
   s = "Managers";
  break;
  case EMPLOYEE_SALESPERSON:
   s = "Salespeople";
  break;
  default:
   s = "";
  break;
}
cout << endl << "          List of " << s << endl;
cout << "------------------------------------------------" << endl;
cout << "    ----        Name      | Total Salary   ----" << endl;
for(e = 0; e < this->employees.size(); e++)
{
  emp = this->employees.at(e);
  switch(isType)
  {
   case 0: // Print all
    cout << " " << e + 1 << ") " << *emp << endl;
   break;
   case 1: // Print if manager
    if(emp->isManager())
     cout << " " << e + 1 << ") " << *emp << endl;
   break;
   case 2: // Print if salesperson
    if(!emp->isManager())
     cout << " " << e + 1 << ") " << *emp << endl;
   break;
  }
}
return e;
}

// List of all sales only
void PolicyManager::showAllSales(void)
{
unsigned int p;
printPolicyHeader();
for(p = 0; p < this->policies.size(); p++)
{
  cout << " " << p + 1 << ") " << *this->policies.at(p) << endl;
}
return;
}

// List all sales by all employees in tabular
void PolicyManager::showTabularSales(void)
{
Employee *emp;
Policy *policy;
unsigned int e, p, n; // List indices
float f[3]; // Policy accumulators
cout << "                  Table of Commissions" << endl;
cout << "|       Employee       |   Auto   |   Home   |   Life   |" << endl;
cout << "---------------------------------------------------------" << endl;
for(e = 0; e < this->employees.size(); e++)
{
  emp = this->employees.at(e);
  cout << "| ";
  cout.width(20);
  cout << emp->getName();
  cout << " | ";
  for(n = 0; n < 3; n++) f[n] = 0.0;
  for(p = 0; p < emp->getNumPolicies(); p++)
  {
   policy = emp->getPolicy(p); // Returns 0 if invalid for some reason
   if(policy) // Check to make sure it's valid
   {
    switch(policy->getType())
    {
     case POLICY_AUTO:
      f[POLICY_AUTO] += policy->getCommission();
     break;
     case POLICY_HOME:
      f[POLICY_HOME] += policy->getCommission();
     break;
     case POLICY_LIFE:
      f[POLICY_LIFE] += policy->getCommission();
     break;
    }
   }
  }
  for(n = 0; n < 3; n++)
  {
   cout.width(8);
   cout << f[n];
   cout << " | ";
  }
  cout << endl;
}
return;
}

// List all sales by one employee
// e is index to employee
void PolicyManager::showEmployeeSales(Employee *emp)
{
unsigned int n;
cout << endl;
cout << "Sales for Employee" << endl;
cout << "-------------------------------------------" << endl;
cout << "----       Name      | Total Salary   ----" << endl;
cout << *emp << endl;
printPolicyHeader();
for(n = 0; n < emp->getNumPolicies(); n++)
{
  cout << " " << n + 1 << ") " << *emp->getPolicy(n) << endl;
}
return;
}

// List all sales by employees of one manager
// e is index to employee, and employee must be a manager
void PolicyManager::showManagerSales(Employee *manager)
{
Employee *sales;
unsigned int s;
if(!manager->isManager())
{
  cout << "Selected employee is not a manager." << endl;
  return;
}
for(s = 0; s < manager->getNumSalesperson(); s++)
{
  sales = manager->getSalesperson(s);
  this->showEmployeeSales(sales);
  cout << endl;
}
return;
}

// Display menu, create, and append policy to vector
void PolicyManager::policyMenu(void)
{
char c = 0;
Policy *p = 0;
if(this->getNumberEmployees(EMPLOYEE_ALL) == 0)
{
  cout << "Cannot create a policy. Must create employee first." << endl;
  return;
}
while(c == 0)
{
  cout << "Add New Policy" << endl;
  cout << " 1) Auto Policy" << endl;
  cout << " 2) Home Policy" << endl;
  cout << " 3) Life Policy" << endl;
  cout << " Enter selection: ";
  cin >> c;
  switch(c)
  {
   case '1':
    p = new AutoPolicy();
   break;
   case '2':
    p = new HomePolicy();
   break;
   case '3':
    p = new LifePolicy();
   break;
   default:
    c = 0;
    cout << "Invalid selection" << endl;
   break;
  }
}
if(p)
{
  this->policies.push_back(p);
  p->inputPolicy();
  this->assignPolicy(p);
}
return;
}

// Display the employees and user selects one
// Display employees to assign the policy
void PolicyManager::assignPolicy(Policy *p)
{
Employee *emp;
Employee *manager;
cout << endl << "Assign Policy To Employee" << endl;
emp = this->selectEmployee(EMPLOYEE_ALL);
if(emp)
{
  emp->addPolicy(p); // Add policy to list inside salesperson
  emp->calcCommission(); // Update their commissions and salary
  if(!emp->isManager()) // If salesperson, then update manager's salary
  {
   manager = emp->getManager();
   manager->calcCommission();
  }
}
return;
}

// Display employees and select.
Employee *PolicyManager::selectEmployee(int isType)
{
unsigned int e = 0;
if(this->employees.size() == 0)
{
  cout << "There are no employees to select." << endl;
  return 0;
}
while(e == 0)
{
  if(!this->showAllEmployees(isType))
  {
   cout << "There are no employees of that kind to select." << endl;
   return 0;
  }
  cout << " Enter selection: ";
  cin >> e;
  if(e > this->employees.size())
  {
   e = 0;
   cout << "Invalid selection" << endl;
  }
}
return this->employees.at(e - 1);
}

// Display menu, create, append employee to vector
void PolicyManager::employeeMenu(void)
{
char c = 0;
Employee *e = 0;
while(c == 0)
{
  cout << "Add Employee" << endl;
  cout << " 1) Salesperson" << endl;
  cout << " 2) Manager" << endl;
  cout << " Enter selection: ";
  cin >> c;
  switch(c)
  {
   case '1':
    if(this->getNumberEmployees(EMPLOYEE_MANAGER) == 0)
    {
     cout << "Must create a manager before creating a salesperson" << endl;
    }
    else
    {
     e = new Salesperson();
    }
   break;
   case '2':
    e = new Manager();
   break;
   default:
    c = 0;
   break;
  }
}
if(e)
{
  this->employees.push_back(e);
  e->inputEmployee();
  e->calcCommission();
  if(!e->isManager()) this->assignManager((Salesperson *)e);
}
return;
}

// Display managers to assign employees
// Employee must be a Salesperson object before calling this function
void PolicyManager::assignManager(Salesperson *e)
{
Employee *manager;
manager = this->selectEmployee(EMPLOYEE_MANAGER);
if(manager)
{
  manager->addSalesperson(e);
  e->setManager(manager);
}
return;
}

// Return the number of employees in vector depending on isType parameter.
// If isType == EMPLOYEE_ALL, return total number of employees.
// If isType == EMPLOYEE_MANAGER, return number of managers.
// If isType == EMPLOYEE_SALESPERSON, return number of salespeople.
int PolicyManager::getNumberEmployees(int isType)
{
Employee *emp;
int e, s, c = 0;
s = this->employees.size();
if(isType == EMPLOYEE_ALL) return s;
for(e = 0; e < s; e++)
{
  emp = this->employees.at(e);
  switch(isType)
  {
   case EMPLOYEE_MANAGER:
    if(emp->isManager()) c++;
   break;
   case EMPLOYEE_SALESPERSON:
    if(!emp->isManager()) c++;
   break;
  }
}
return c;
}

// Print the header in the list of policies
void PolicyManager::printPolicyHeader(void)
{
cout << endl << "          List of Policies" << endl;
cout << "--------------------------------------------------";
cout << "---------------------" << endl;
cout << "          Name of Insured |           Commission |";
cout << "     Type of Policy" << endl;
return;
}

PolicyManager.h

Policy.h


#ifndef POLICY_H_
#define POLICY_H_
#include <iostream>
using namespace std;

#define POLICY_AUTO  0
#define POLICY_HOME  1
#define POLICY_LIFE  2

class Policy
{
public:
  Policy();
  virtual void inputPolicy(void);
  friend ostream &operator<<(ostream &s, const Policy &p);
  float getCommission(void); // Return the commission amount
  int getType(void); //Return the type of the policy
protected:
  virtual void calculateCommission(void);
  void inputNameOfInsured(void);
  string nameOfInsured;
  float commission;
  int policyType;
};

#endif

Policy.cpp


#include "Policy.h"

Policy::Policy()
{
this->nameOfInsured = "";
this->commission = 0.0;
return;
}

void Policy::inputNameOfInsured(void)
{
cout << "Enter name of insured: ";
cin >> this->nameOfInsured;
return;
}

void Policy::calculateCommission(void)
{
return;
}

void Policy::inputPolicy(void)
{
return;
}

// Return the commission amount
float Policy::getCommission(void)
{
return this->commission;
}

ostream &operator<<(ostream &s, const Policy &p)
{
s.width(20);
s << p.nameOfInsured;
s << " | ";
s.width(20);
s << p.commission;
s << " | ";
s.width(20);
switch(p.policyType)
{
  case POLICY_AUTO:
   s << "AUTO POLICY";
  break;
  case POLICY_HOME:
   s << "HOME POLICY";
  break;
  case POLICY_LIFE:
   s << "LIFE POLICY";
  break;
}
return s;
}

//Return the type of the policy
int Policy::getType(void)
{
return this->policyType;
}

Manager.cpp


#include "Manager.h"

Manager::Manager()
{
this->salespersonList.clear();
}

Manager::~Manager()
{
return;
}

// Add a Salesperson to the salespersonList
void Manager::addSalesperson(Salesperson *p)
{
this->salespersonList.push_back(p);
return;
}

// Calculate the total salary
void Manager::calcCommission(void)
{
unsigned int e;
// commission =   commission total from all sales + ( commissions total from all sales * 30% ) +
//                        ( commission total from all reporting salespeople * 5% )
this->commissions = this->accumulateCommission() * 1.3;
this->calcTotalSalary();
for(e = 0; e < this->salespersonList.size(); e++)
{
  this->totalSalary += this->salespersonList.at(e)->getCommissions() * 0.05;
}
return;
}

// Return the number of salespeople reporting to this manager
unsigned int Manager::getNumSalesperson(void)
{
return this->salespersonList.size();
}

// Return the pointer to sales person in the salespersonList
Employee *Manager::getSalesperson(unsigned int p)
{
return this->salespersonList.at(p);
}

Manager.h


#ifndef MANAGER_H_
#define MANAGER_H_

#include "Employee.h"
#include "Salesperson.h"

class Manager: public Employee
{
public:
  Manager();
  virtual ~Manager();
  virtual int isManager(void) { return -1; }; // return -1, is a manager
  void addSalesperson(Salesperson *p); // Add a Salesperson to salespersonList
  virtual void calcCommission(void); // Calculate the total salary
  virtual unsigned int getNumSalesperson(void);
  virtual Employee *getSalesperson(unsigned int p);
private:
    // The salespersonList contains pointers to the employees that are assigned
  // to work under this manager, and is assigned by the user.
  // The actual salesperson object is in another vector maintained by the PolicyManager.
    vector<Salesperson *> salespersonList; // list of all salespeople
};

#endif

LifePolicy.cpp


#include "LifePolicy.h"

LifePolicy::LifePolicy():Policy()
{
this->age = 0;
this->nameOfDependent = "";
this->termLife = 0.0;
this->policyType = POLICY_LIFE;
return;
}

void LifePolicy::calculateCommission(void)
{
// Base sales commission is based on the following formula:
// commission = term life * 20%
this->commission = this->termLife * 0.2;
return;
}

ostream &operator<<(ostream &s, const LifePolicy &p)
{
s << p.nameOfInsured << " ";
s << p.age << " ";
s << p.nameOfDependent << " ";
s << p.termLife;
return s;
}

void LifePolicy::inputPolicy(void)
{
// name is input from the parent Policy class
this->inputNameOfInsured();

cout << "Enter age: ";
cin >> this->age;

cout << "Enter name of dependent: ";
cin >> this->nameOfDependent;

cout << "Enter amount of term life: ";
cin >> this->termLife;

// Now calculate the commission amount stored in the Policy parent class.
this->calculateCommission();
return;
}

LifePolicy.h


#ifndef LIFEPOLICY_H_
#define LIFEPOLICY_H_

#include "Policy.h"

class LifePolicy: public Policy
{
public:
  LifePolicy();
  void inputPolicy(void); // User enters all data and commission is calc'd
  friend ostream &operator<<(ostream &s, const LifePolicy &p);
protected:
  void calculateCommission(void);
private:
    int age;
    string nameOfDependent;
    float termLife;
};

#endif

HomePolicy.cpp


#include "HomePolicy.h"

HomePolicy::HomePolicy():Policy()
{
this->sqFootage = 0.0;
this->dwelling = 0.0;
this->contents = 0.0;
this->liability = 0.0;
this->policyType = POLICY_HOME;
return;
}

void HomePolicy::calculateCommission(void)
{
// Base sales commission is based on the formula:
// commission = (liability * 30%) + ( (dwelling + contents) * 20% )
this->commission = (this->liability * 0.3) + (( this->dwelling +
   this->contents) * 0.2);
return;
}

ostream &operator<<(ostream &s, const HomePolicy &p)
{
s << p.nameOfInsured << " ";
s << p.sqFootage << " ";
s << p.dwelling << " ";
s << p.contents << " ";
s << p.liability;
return s;
}

void HomePolicy::inputPolicy(void)
{
// name is input from the parent Policy class
this->inputNameOfInsured();

cout << "Enter square footage: ";
cin >> this->sqFootage;

cout << "Enter dwelling: ";
cin >> this->dwelling;

cout << "Enter contents: ";
cin >> this->contents;

cout << "Enter liability: ";
cin >> this->liability;

// Now calculate the commission amount stored in the Policy parent class.
this->calculateCommission();
return;
}

HomePolicy.h


#ifndef HOMEPOLICY_H_
#define HOMEPOLICY_H_

#include "Policy.h"

class HomePolicy: public Policy
{
public:
  HomePolicy();
  void inputPolicy(void); // User enters all data and commission is calc'd
  friend ostream &operator<<(ostream &s, const HomePolicy &p);
protected:
  void calculateCommission(void);
private:
  float sqFootage;
  float dwelling;
  float contents;
  float liability;
};

#endif

Employee.cpp


#include "Employee.h"

Employee::Employee()
{
this->name = "";
this->baseSalary = 0.0;
this->commissions = 0.0;
this->totalSalary = 0.0;
return;
}

Employee::~Employee()
{
return;
}

void Employee::inputEmployee(void)
{
cout << "Enter name: ";
cin >> this->name;

cout << "Enter base salary: ";
cin >> this->baseSalary;

return;
}

// return the name of the employee
string Employee::getName(void)
{
return this->name;
}

ostream &operator<<(ostream &s, const Employee &e)
{
s.width(20);
s << e.name;
s << " | " << e.totalSalary;
return s;
}

// Calculate total salary only after the commissions and base salary are known.
void Employee::calcTotalSalary(void)
{
this->totalSalary = this->baseSalary + this->commissions;
return;
}

// Accumulate the commissions from all sales
float Employee::accumulateCommission(void)
{
unsigned int p;
float s = 0.0;
for(p = 0; p < this->policyList.size(); p++)
{
  s += this->policyList.at(p)->getCommission();
}
return s;
}

// Add a policy to the policyList
void Employee::addPolicy(Policy *p)
{
this->policyList.push_back(p);
return;
}

// Calc commission, depends on employee
void Employee::calcCommission(void)
{
return;
}

// Return the number of policies
unsigned int Employee::getNumPolicies(void)
{
return this->policyList.size();
}

// Return pointer to policy at p
Policy *Employee::getPolicy(unsigned int p)
{
if(p >= this->policyList.size()) return 0;
return this->policyList.at(p);
}

// Return commissions of this employee
float Employee::getCommissions(void)
{
return this->commissions;
}

Employee.h

#ifndef EMPLOYEE_H_
#define EMPLOYEE_H_
#include <iostream>
#include <vector>
#include "Policy.h"

using namespace std;

class Salesperson;

class Employee
{
public:
  Employee();
  virtual ~Employee();
  void inputEmployee(void); // Input the employee data
  string getName(void); // return the name of the employee
  friend ostream &operator<<(ostream &s, const Employee &e);
  virtual void addSalesperson(Salesperson *p) {}; // Add a salesperson to list
  virtual int isManager(void) { return 0; }; // return 0, not a manager
  virtual void calcCommission(void); // Calc commission, depends on employee
  float accumulateCommission(void); // Accumulate commissions from all sales
  void addPolicy(Policy *p); // Add a policy to the policyList
  unsigned int getNumPolicies(void); // Return the number of policies
  Policy *getPolicy(unsigned int p); // Return pointer to policy at p
  float getCommissions(void); // Return commissions of this employee
  virtual Employee *getManager(void) { return 0; }; // Get pointer to manager
  virtual void setManager(Employee *) {}; // Set pointer to manager (link)
  virtual unsigned int getNumSalesperson(void) { return 0; };
  virtual Employee *getSalesperson(unsigned int p) { return 0; };
protected:
  void calcTotalSalary(void); // Calculate total salary
  string name;
  float baseSalary;
  float commissions;
  float totalSalary;
    // The policyList contains pointers to the policy and is assigned by
    // the user. The actual policy object is in another vector maintained
    // by the PolicyManager.
    vector<Policy *> policyList; // list of all sales made
};

#endif

AutoPolicy.cpp

#include "AutoPolicy.h"

AutoPolicy::AutoPolicy():Policy()
{
this->make = "";
this->model = "";
this->VIN = "";
this->liability = 0.0;
this->collision = 0.0;
this->policyType = POLICY_AUTO;
return;
}

void AutoPolicy::calculateCommission(void)
{
// Base sales commission is based on the formula:
// commission = (liability + collision) * 30%
this->commission = (this->liability + this->collision) * 0.3;
return;
}

ostream &operator<<(ostream &s, const AutoPolicy &p)
{
s << p.nameOfInsured << " ";
s << p.make << " ";
s << p.model << " ";
s << p.VIN << " ";
s << p.liability << " ";
s << p.collision;
return s;
}

void AutoPolicy::inputPolicy(void)
{
// name is input from the parent Policy class
this->inputNameOfInsured();

cout << "Enter make: ";
cin >> this->make;

cout << "Enter model: ";
cin >> this->model;

cout << "Enter VIN: ";
cin >> this->VIN;

cout << "Enter liability: ";
cin >> this->liability;

cout << "Enter collision: ";
cin >> this->collision;

// Now calculate the commission amount stored in the Policy parent class.
this->calculateCommission();
return;
}

AutoPolicy.h


#ifndef AUTOPOLICY_H_
#define AUTOPOLICY_H_

#include "Policy.h"

class AutoPolicy: public Policy
{
public:
  AutoPolicy();
  void inputPolicy(void); // User enters all data and commission is calc'd
  friend ostream &operator<<(ostream &s, const AutoPolicy &p);
protected:
  void calculateCommission(void);
private:
  string make;
  string model;
  string VIN;
  float liability;
  float collision;
};

#endif