Have a question?
Message sent Close

CIS247C Object-Oriented Programming Please Enter your Health Insurance Provider DeVry Universit

0
0 reviews
  • Description
  • Full Document
Blur-Preview

DeVry Universit

CIS247C Object-Oriented Programming Please Enter your Health Insurance Provider DeVry Universit

//get and set dependents
input = GetInput(“Please enter your Dependents”);
employeeList1->setDependents(input);
//get and set annual salary
input = GetInput(“Please enter your Annual Salary”);
employeeList1->setAnnualSalary(input);
//get and set health insurance
input = GetInput(“Please enter your Health Insurance Provider”);
bene.setHealthInsurance(input);
//get and set life insurance
input = GetInput(“Please enter your Life Insurance”);
lifeIns = stod(input);
bene.setLifeInsurance(lifeIns);
//get and set vacation
input = GetInput(“Please enter your Vacation Days”);
vacat = atoi(input.c_str());
bene.setVacation(vacat);
employeeList1->setBenefit(bene)
//display back info about employee 1
cout << “Employee Information” << endl;
employeeList1->displayEmployee();
cout << “— Number of Employee Object Created —” << endl;
cout << “Number of employees: ” << Employee::getNumEmployees() << endl;
//declaration of second object: the salaried employee
Employee *employeeList2 = new Hourly(50, 40, “full time”);
DisplayDivider(“Employee 2”);
//cout << “Employee Information” << endl;
//get and set first name
firstNaime = GetInput(“Please enter your First Name”);
employeeList2->setFirstName(firstNaime);
//get and set last name
lastNaime = GetInput(“Please enter your Last Name”);
employeeList2->setLastName(lastNaime);
//get and set gender
input = GetInput(“Please enter your Gender”);
gendr = input.at(0);
employeeList2->setGender(gendr);
//get and set dependents
input = GetInput(“Please enter your Dependents”);
employeeList2->setDependents(input);
//get and set health insurance
input = GetInput(“Please enter your Health Insurance Provider”);
bene.setHealthInsurance(input);
//get and set life insurance
input = GetInput(“Please enter your Life Insurance”);
lifeIns = stod(input);
bene.setLifeInsurance(lifeIns);
//get and set vacation
input = GetInput(“Please enter your Vacation Days”);
vacat = atoi(input.c_str());
bene.setVacation(vacat);
//set Management Level to 3
employeeList2->setBenefit(bene);
//display back info about salaried employee
cout << “Employee Information” << endl;
employeeList2->displayEmployee();
cout << “— Number of Employee Object Created —” << endl;
cout << “Number of employees: ” << Employee::getNumEmployees() << endl;
//deletion of pointers
delete employeeList1;
delete employeeList2;
TerminateApplication();
system(“pause”);
return 0;
}
employee.h
#pragma once
#include<iostream>
#include<string>
#include<iomanip>
#include “benefit.h”
using namespace std;
class Employee {
protected:
string firstName;
string lastName;
char gender;
int dependents;
double annualSalary;
Benefit benefit;
private:
static int numEmployees;
public:
Employee();
Employee(string first, string last, char gen, int dep, double salary, Benefit
ben);
Employee(string first, string last, char gen, int dep, double salary, string
healthIns, double lifeIns, int vacation);
~Employee();
virtual double calculatePay() = 0;
virtual void displayEmployee() = 0;
static int getNumEmployees();
string getFirstName();
void setFirstName(string);
string getLastName();
void setLastName(string);
char getGender();
void setGender(char);
int getDependents();
void setDependents(int);
void setDependents(string);
double getAnnualSalary();
void setAnnualSalary(double);
void setAnnualSalary(string);
void setBenefit(Benefit);
Benefit getBenefit();
};
//Function prototypes
void DisplayApplicationInformation();
void DisplayDivider(string);
string GetInput(string);
void TerminateApplication();

Preview

CIS247C Object-Oriented Programming Please Enter your Health Insurance Provider DeVry Universit

NOTE: Please check the details before purchasing the document.

error: