Have a question?
Message sent Close

CIS247C Object-Oriented Programming Please Enter your Annual Salary DeVry University

0
0 reviews
  • Description
  • Full Document
Blur-Preview

DeVry University

CIS247C Object-Oriented Programming Please Enter your Annual Salary DeVry University

input = GetInput(“Please enter your Annual Salary”);
annualSalry = stod(input);
salaryEmployee.setAnnualSalary(annualSalry);
//get and set health insurance
input = GetInput(“Please enter your Health Insurance Provider”);
salaryEmployee.benefit.setHealthInsurance(input);
//get and set life insurance
input = GetInput(“Please enter your Life Insurance”);
lifeIns = stod(input);
salaryEmployee.benefit.setLifeInsurance(lifeIns);
//get and set vacation
input = GetInput(“Please enter your Vacation Days”);
vacat = atoi(input.c_str());
salaryEmployee.benefit.setVacation(vacat);
//set Management Level to 3
salaryEmployee.setManagementLevel(3);
//display back info about salaried employee
cout << “Employee Information” << endl;
salaryEmployee.displayEmployee();
cout << “— Number of Employee Object Created —” << endl;
cout << “Number of employees: ” << Employee::getNumEmployees() << endl;
//declaring hourly employee object
Hourly hourlyEmployee;
DisplayDivider(“Employee 3”);
//cout << “Employee Information” << endl;
//get and set first name
firstNaime = GetInput(“Please enter your First Name”);
hourlyEmployee.setFirstName(firstNaime);
//get and set last name
lastNaime = GetInput(“Please enter your Last Name”);
hourlyEmployee.setLastName(lastNaime);
//get and set gender
input = GetInput(“Please enter your Gender”);
gendr = input.at(0);
hourlyEmployee.setGender(gendr);
//get and set dependents
input = GetInput(“Please enter your Dependents”);
depend = atoi(input.c_str());
hourlyEmployee.setDependents(depend);
//get and set annual salary
input = GetInput(“Please enter your Annual Salary”);
annualSalry = stod(input);
hourlyEmployee.setAnnualSalary(hourlyEmployee.getWage(),
hourlyEmployee.getHours());
//get and set health insurance
input = GetInput(“Please enter your Health Insurance Provider”);
hourlyEmployee.benefit.setHealthInsurance(input);
//get and set life insurance
input = GetInput(“Please enter your Life Insurance”);
lifeIns = stod(input);
hourlyEmployee.benefit.setLifeInsurance(lifeIns);
//get and set vacation
input = GetInput(“Please enter your Vacation Days”);
vacat = atoi(input.c_str());
hourlyEmployee.benefit.setVacation(vacat);
//set category of hourly employee
hourlyEmployee.setCategory(“Unknown”);
//set wage of hourly employee
hourlyEmployee.setWage(40);
//set hours of hourly employee
hourlyEmployee.setHours(50);
//display back info about salaried employee
cout << “Employee Information” << endl;
hourlyEmployee.displayEmployee();
cout << “— Number of Employee Object Created —” << endl;
cout << “Number of employees: ” << Employee::getNumEmployees() << endl;
TerminateApplication();
system(“pause”);
return 0;
}
employee.h
#pragma once
#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
#include “benefit.h”
class Employee {
private:
static int numEmployees;
protected:
string firstName;
string lastName;
char gender;
int dependents;
double annualSalary;
public:
Benefit benefit;
Employee();
Employee(string first, string last, char gen, int dep, Benefit ben);
~Employee();
double calculatePay();
void displayEmployee();
string getFirstName();
void setFirstName(string first);
string getLastName();
void setLastName(string last);
char getGender();
void setGender(char gen);
int getDependents();
void setDependents(int dep);
void setDependents(string dep);
double getAnnualSalary();
void setAnnualSalary(double salary);
void setAnnualSalary(string sal);
static int getNumEmployees();
};
//Function prototypes
void DisplayApplicationInformation();
void DisplayDivider(string);
string GetInput(string);
void TerminateApplication();

Preview

CIS247C Object-Oriented Programming Please Enter your Annual Salary DeVry University

NOTE: Please check the details before purchasing the document.

error: