Purchase Solution

Creating Classes and Inheretence usage

Not what you're looking for?

Ask Custom Question

Create an Employee class for a basic payroll program to compute the net pay salary of hourly based employees. Your program should also find the average net pay for a small company. To define the class, include the appropriate data members, member functions, and access modifiers. For simplicity, use a constant tax rate of 30% to compute the tax amount. Employees that work over 40 hours will receive overtime pay of one and a half of their hourly rate for overtime hours worked. The output should display the name of each employee, hours worked, hourly rate, overtime pay, regular (gross) pay, tax amount, and net pay. The average net pay of all employees should also be displayed.

Have the Employee Payroll program include hourly based and salary based employees. This phase uses an array of employee objects, inheritance for different classes of employees, and polymorphism for salary computation. The 52 week yearly salary as well as number of overtime hours worked by a salary based employee is given). For salary based employees, to find the regular (gross) pay for a week, divide the salary by 52. To compute the overtime pay for a salary based employee, first find the hourly rate by dividing the gross pay by 40, and then compute overtime pay. For every employee, overtime pay, tax amount, and net pay must also be computed. In addition, the program should find the minimum and maximum net pay of all employees as well as sort the employees based on their net pay (ascending order).

Expand the payroll program to combine two sorting techniques (Selection and Exchange sorts) for better efficiency in sorting the employee's net pay.

Ok, so what i have so far for the class is:

#include <iostream >
#include <fstream >

using namespace std;

class Employee {
public:
Employee(string name, double rate, double gross, double net, int hours); //Name, Pay Rate, Gross Pay, Net Pay, Hours worked

string getName();
double getrate();
double getgross();
double getnet();
int gethours();

private:
string name;
double rate;
int hours;
double gross;
double Net;
};

Employee::Employee(string name, double rate, double gross, double net, int hours){

}
string Employee::getName()
{
return name;
}
double Employee::getrate()
{
return rate;
}
double Employee::gethours()
{
return hours;
}
double Employee::getgross()
{
return ((rate * (hours - 40)) + ((hours - 40) * 1.5))
};

double Employee::getnet()
{
return (((rate * (hours - 40)) + ((hours - 40) * 1.5)) * .3)
};

void main(){

}

But i have no idea if the class portion is correct, much less how to incorporate it into an array (Employee[]?)

Help would be verily appreciated.

Attachments
Purchase this Solution

Solution Summary

The solution creates classes and inheritance usages.

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.