SmartExpert

(118)

$30/per page/Negotiable

About SmartExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,English,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 6 Weeks Ago, 2 Days Ago
Questions Answered: 7559
Tutorials Posted: 7341

Education

  • BS,MBA, PHD
    Adelphi University/Devry
    Apr-2000 - Mar-2005

Experience

  • HOD ,Professor
    Adelphi University
    Sep-2007 - Apr-2017

Category > Computer Science Posted 11 Jul 2017 My Price 12.00

C++ Programming Payroll system with data file employee

The program has been expanded many times and I think that's why my code is having issues.......Here are the directions that have been expanded.

- Compute gross pay for each employee by interactively entering hours worked and hourly rate.

- Compute net pay for each employee by applying a fixed tax rate of 10%. You must enter each employee's id. (Enter only last four digits of SSN at this time.)

- Expand your Payroll Program so that it interactively repeats for as many employees as the user specifies:

- Expand your Payroll program so that it repeats for as many employees are in the input file. Data typed and saved under employee.in

- In this phase of the payroll system, we are going to include the appropriate tax rate (variable) rather than a fixed tax rate of 10% (constant). The program will also compute the overtime pay.

- Assign different tax rates based on the following gross pay:

If gross pay is more $1000, the tax rate is 30%

If the gross pay is more than $800.00 and less than or equal to $1000.00, then the tax rate is 20%.

If the gross pay is more than $500.00 and less than $800.00, then the tax rate is 10%

If gross pay is more than or equal to 0 and less than or equal to 500 tax rate is 0.

The tax rate will also vary based on marital status. Add 5% to the tax rate of a single person and subtract 5% if head of household.

- Declare marital status as a character: S=Single M=Married H=Head of Household

- Program should accept either upper case or lower case letters for marital status (e.g. accept M or m).

- Compute the overtime pay according to the following formula:

Any hours over 40 are considered time and a half (overtime).

You may want to find overtime hours (e.g. hoursworked – 40) and overtime pay (e.g. overtimehours*hourlyrate * 1.5).

- Display company title and a header that labels the output in a tabular form. Input the first name and last name of an employee.

char firstname[100][10], lastname[100][15];

or you may use

#include

using namespace std;

string firstname[100], lastname[100];

int hw[100],empid[100];

Hint: You may want to use the following I/O manipulators.

#include , setw(15), setprecision(2) setiosflags(ios::fixed|ios::showpoint|ios::left)

- Take advantage of arrays by breaking programs into separate units. Each unit should have a separate loop. (Do not use functions.)

Read all data into arrays

Compute all the overtimepays

Compute all the grosspays

Compute all the taxratesCompute all the netpays

Display all the arrays

- Include separate functions to read in the data, compute the gross pay, tax rate, net pay, and overtime pay for all employees, and display.

- 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.

- Expand the Employee Payroll program to 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).

Here is my code from DEV C++,

I keep getting this error message when I compile.....

83   34 [Error] qualified-id in declaration before '(' token

244   1 [Error] expected '}' at end of input

244   1 [Error] expected '}' at end of input

I'm not sure what to do to fix it.

#include
#include
#include

using namespace std;

int main() {
   int employeeid;
   int hoursworked;
   int numberofemployees;
   float hourlyrate, grosspay, taxamount, netpay;
   float const TAXRATE = 0.30;
   while(numberofemployees>0);{
   cout<<"ENTER NUMBER OF EMPLOYEES:";
   cin>>numberofemployees;
   cout<<"ENTER THE EMPLOYEE ID:";
   cin>>employeeid;
   cout<<"ENTER THE HOURS WORKED:";
   cin>>hoursworked;
   cout<<"ENTER THE HOURLY RATE:";
   cin>>hourlyrate;
   grosspay = hoursworked * hourlyrate;
   taxamount = grosspay * TAXRATE;
   netpay = grosspay - taxamount;  
   cout<<"EMPLOYEE ID IS "<    cout<<"THE HOURS WORKED ARE "<    cout<<"THE HOURLY RATE IS "<    cout<<"THE GROSSPAY IS   "<    cout<<"THE TAXAMOUNT IS   "<    cout<<"THE NETPAY IS   "<    numberofemployees = numberofemployees+1;
   system("pause");
}//WHILE  
   {
   double TAXRATE, grosspay, hoursworked, hourlyrate, overtimehours, overtimepay, totalpay;
   char marital;
   cout<    cout<<"Enter the marital status (S/s=Single, M/m=Married, H/h=Head of Household):";
   cin>>marital;
   if(marital=='S'||marital=='s') TAXRATE+=0.05;
   if(marital=='H'||marital=='h') TAXRATE-=0.05;
   cout<<"Enter number of hoursworked:";
   cin>>hoursworked;
   if(hoursworked>40){
       overtimehours=(hoursworked-40);
       hoursworked=40;
   }
   {
   overtimepay-overtimehours*hourlyrate*1.5;
   grosspay=hoursworked*hourlyrate+overtimepay;
   if(grosspay>1000)TAXRATE=.3;
   else if(grosspay>800)TAXRATE=.2;
   else if(grosspay>500)TAXRATE=.1;
   else if(grosspay>=0)TAXRATE=0;
   cout<<"Overtimepay:"<    cout<<"Grosspay:"<    cout<<"Tax Deducted:"<    cout<<"Netpay:"<    }
   main();
       int counter = 0;
       int i;
       int firstname;
       int lastname;
       cout<<"ENTER EMPOYEE ID, FIRST NAME,LAST NAME, HOURS WORKED, HOURLY RATE ctrl z to end"<   
   class payroll{
       ifstream fin;
       char employeeid[12];
       char firstname[20];
       char lastname[20];
       int hoursworked, overtime;
       double
       hourlyrate, overtimepay, overtimepaycalc, taxrate, regpay, grosspay, taxamount, netpay;
       void calculategrosspay();
       void calculatetaxamount();
       void calculatenetpay();
       void printheading();
       void printdata();
  
};
   main();
   void payroll:: calculategrosspay(){
       if (hoursworked>40)
       grosspay = hoursworked * hourlyrate;
      
       {
           overtime = hoursworked - 40;
           regpay = 40 * hourlyrate;
           overtimepaycalc = hourlyrate * 1.5;
           overtimepay = overtime * overtimepaycalc;
           grosspay = overtimepay + regpay;
       }
       else
       {
           overtime = 0;
           regpay = 4- * hourlyrate;
           overtimepaycalc = hourlyrate * 1.5;
           overtimepay = overtime * overtimepaycalc;
           grosspay = overtimepay + regpay;
       }

   void payroll::calculatetaxamount(){
       if(grosspay >=0) taxrate= .30;
       taxamount = grosspay * taxrate; }
      
   void payroll::calculatenetpay(){
       netpay = grosspay * taxrate; }
      
   void payroll:: printheading(){
   cout<

class employeeSalary : public payroll{
   public: double calculatedGrossPay() {
       double regPay =(salary/52);
       hourlyRate = (regPay/40);
       double overtimePay, overtimeHours;
       double grossPay;
       if (hours >40) {overtimeHours = (hours -40);
       overtimepay = (overtimeHours * hourlyRate);
       grossPay = (regPAy + overtimePay);
       }
       else if (hours <=40) {overtimeHours = 0; overtimePay = 0; grossPay = regPay;
}
return grossPay;
   }
};

class employeeHourly : public payroll{
   public: double calculateGrossPay(){
       double regPay = (40* hourlyRate);
       double grossPay;
       if (hourly > 40){overtimeHours = (hours - 40);
       overtimePay = (overtimeHours * hourlyRate * 1.5);
       grossPay = (regPay + overtimePay);
       }
       else { overtimeHours = 0; overtimePay = 0; grossPay = regPay;
   }
   return grossPay;
   }//Payroll class
};
void printHeader(){
   count<<"PAYROLL PROGRAM RESULTS"< }
int main(void){//nedd to declare varibles
cout<<"Enter # of employees you want to procees:";
int totalEmployeeCount;
cin>>totalEmployeeCount;
payroll * employee[100];
for (int employeeCounter =0; employeeCounter < totalEmployeeCount; employeeCounter++)
{//try this on for size

cout<<"Is employee" <    int stat=1;
   cin>>stat;
   if(stat == 1){ cout<<"Instantiating an HOURLY employee object inherited from base class payroll..."<   
   string firstName, LastName;
   cout<<"ENTER employee's ID:"; cin>>employeeID;
   cout<<"ENTER employee's first name: ";cin>>firstName;
   cout<<"ENTER employee's last name: "; cin>>lastName;
   cout<<"ENTER employee's hourly wage: "; cin>>rate;
   cout<<"ENTER employee's hours for this week: "; cin>>hours;
  
   employee[employeeCounter] = new employeeHourly();
   employee[employeeCounter]->seVariables(employeeID, firstname, lastname, stat, rate, hours);
  
   }
   else {cout<<"Instantiating a Salary employee an object inherited from base class payroll..."<   
   }  
}for (int i=0; i    cout calculateTaxAmount()<    cout for (int i=0; i }

return 0;

}//MAIN  

Answers

(118)
Status NEW Posted 11 Jul 2017 08:07 PM My Price 12.00

C++----------- Pr-----------ogr-----------amm-----------ing----------- Pa-----------yro-----------ll -----------sys-----------tem----------- wi-----------th -----------dat-----------a f-----------ile-----------  -----------emp-----------loy-----------ee-----------

Attachments

1499824085-Q3Q4.zip
file 1499824091-Answer Answer.docx preview (4974 words )
A-----------nsw-----------er ----------- Em-----------plo-----------yee-----------.h#-----------ifn-----------def----------- __-----------EMP-----------LOY-----------EE_-----------H__----------- #-----------def-----------ine----------- __-----------EMP-----------LOY-----------EE_-----------H__----------- #-----------inc-----------lud-----------e &-----------amp-----------;lt-----------;st-----------rin-----------g&a-----------mp;-----------gt;----------- n-----------ame-----------spa-----------ce -----------Rec-----------ord-----------s -----------{ ----------- ----------- ----------- c-----------las-----------s E-----------mpl-----------oye-----------e ----------- ----------- ----------- {----------- ----------- ----------- ----------- pu-----------bli-----------c: ----------- ----------- ----------- ----------- ----------- ----------- v-----------irt-----------ual----------- vo-----------id -----------set-----------_id-----------(lo-----------ng)-----------; ----------- ----------- ----------- ----------- ----------- ----------- vi-----------rtu-----------al -----------lon-----------g g-----------et_-----------id(-----------); ----------- ----------- ----------- ----------- ----------- ----------- v-----------irt-----------ual----------- vo-----------id -----------set-----------_fi-----------rst-----------_na-----------me(-----------std-----------::s-----------tri-----------ng -----------in_-----------fir-----------st_-----------nam-----------e);----------- ----------- ----------- ----------- ----------- ----------- -----------vir-----------tua-----------l s-----------td:-----------:st-----------rin-----------g g-----------et_-----------fir-----------st_-----------nam-----------e()-----------; ----------- ----------- ----------- ----------- ----------- ----------- vi-----------rtu-----------al -----------voi-----------d s-----------et_-----------las-----------t_n-----------ame-----------(st-----------d::-----------str-----------ing----------- in-----------_la-----------st_-----------nam-----------e);-----------
Not Rated(0)