Hello I am confused about this C++ program. I need to create a payroll C++ program following these steps.




Note: Could you plz go through this code and let me
know if u need any changes in this.Thank You
_________________
// Payroll.h
#ifndef PAYROLL_H
#define PAYROLL_H
class Payroll
{
public:
Payroll();
// Function declarations
float getNoOfHours();
void setNoOfHours(float noOfHours);
float getPayrate();
void setPayrate(float payrate);
float getRegularPay();
float getOverTimePay();
void calGrossPay();
private:
// Declaring variables
float noOfHours;
float payrate;
float regularpay;
float overtimepay;
};
#endif
______________________
// Payroll.cpp
#include <iostream>
using namespace std;
#include "Payroll.h"
Payroll::Payroll()
{
}
float Payroll::getNoOfHours()
{
return noOfHours;
}
void Payroll::setNoOfHours(float noOfHours)
{
this->noOfHours = noOfHours;
}
float Payroll::getPayrate()
{
return payrate;
}
void Payroll::setPayrate(float payrate)
{
this->payrate = payrate;
}
void Payroll::calGrossPay()
{
if(noOfHours<=40)
{
this->regularpay=noOfHours*payrate;
this->overtimepay=0.0;
}
else if(noOfHours>40)
{
this->regularpay=40*payrate;
this->overtimepay=(noOfHours-40)*payrate*1.5;
}
}
float Payroll::getRegularPay()
{
return regularpay;
}
float Payroll::getOverTimePay()
{
return overtimepay;
}
__________________________
// main.cpp
#include <iostream>
#include <iomanip>
using namespace std;
#include "Payroll.h"
int main(int argc, char **argv)
{
//setting the precision to two decimal
places
std::cout << std::setprecision(2) <<
std::fixed;
double hours,payrate=0.0;
Payroll p;
cout<<"hello"<<endl;
while(true)
{
cout<<"\nEnter hours"<<endl;
cin>>hours;
if(hours<0)
{
break;
}
p.setNoOfHours(hours);
cout<<"Enter rate"<<endl;
cin>>payrate;
p.setPayrate(payrate);
p.calGrossPay();
cout<<"Hours = "<<p.getNoOfHours()<<", rate =
"<<p.getPayrate()<<endl;
cout<<"Regular Pay = "<<p.getRegularPay()<<",
overtime pay = "<<p.getOverTimePay()<<", total pay =
"<<p.getRegularPay()+p.getOverTimePay()<<endl;
}
return 0;
}
_________________________
Output:

_______________Could you plz rate me well.Thank You
Hello I am confused about this C++ program. I need to create a payroll C++ program...
Requesting help with the following C Program: DESIGN and IMPLEMENT a menu driven program that uses the following menu and can perform all menu items: Enter a payroll record for one person Display all paycheck stubs Display total gross payroll from all pay records. Quit program The program will reuse the DATE struct from the previous assignment. You should also copy in the functions relating to a DATE. The program will create a PAYRECORD struct with the following fields: typedef struct...
Within c++ Create a simple Employee class with name, department, and title. Create an hourlyEmployee class (which inherits from the 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, constructors, and access modifiers. For simplicity, use a constant tax rate of 30% to compute the tax amount. Employees...
The following needs to be in C programming ! Outcomes: Demonstrate the ability to design a menu driven program. Demonstrate the ability to reuse previous code to create a new assignment. Demonstrate the ability to use appropriate program logic. Program Specifications: DESIGN and IMPLEMENT a menu driven program that uses the following menu and can perform all menu items: Enter a payroll record for one person Display all paycheck stubs Display total gross payroll from all pay records. Quit program...
Create a dual-alternative selection structure using Python: A company ABC asked you to design a simple payroll program that calculates and employee's weekly gross pay, including any overtime wages. If employees work over 40 hours in a week, they will get 1.5 times of their regular hourly rate for all hours over 40. Your program asks the user to input hours worked for a week, regular hourly rate, and then display the weekly gross pay Output sample Enter weekly hours...
Exercise 1 A program was created that outputs the following unto the console: Hello! What is your name: Hello, Jane Doe! Using this program, we can help you determine you pay for the week! Please enter the hours you worked this week: 20 Next, please enter your rate of pay: 10 Calculating… you will make $ 200 by the end of the week! Here is the code for that program (you should have written a close variant of this last...
Design a program(Creating a RAPTOR flowchart) that will read a file of employee records containing employee number, employee name, hourly pay rate, regular hours worked and overtime hours worked. The company pays its employees weekly, according to the following rules: regular pay = regular hours worked × hourly rate of pay overtime pay = overtime hours worked × hourly rate of pay × 1.5 total pay = regular pay + overtime pay Your program is to read the input data...
Java Programming Reading from a Text File
Write a Java program that will use an object of the Scanner class to read employee payroll data from a text file The Text file payroll.dat has the following: 100 Washington Marx Jung Darwin George 40 200 300 400 Kar Car Charles 50 22.532 15 30 The order of the data and its types stored in the file are as follows: Data EmployeelD Last name FirstName HoursWorked double HourlyRate Data Tvpe String String...
Questions:(to be answered within the video) Write a C++ program with the following specifications: 1. Create a class and name it Payslip. This class should have the following attributes or properties: name,pay grade, basic salary, overtime hours, overtime pay, gross pay, net pay and withholding tax. 2. Define the accessors and mutators of the Payslip class based on its attributes or properties. This class should also have the following methods: determinePayGradeAndTaxRate and computePay. 3. Create another class and name it Employee. This...
Visual C# C# Visual Studio 2017 You are to create a class object called “Employee” which included eight private variables - firstN - lastN - idNum -wage: holds how much the person makes per hour -weekHrsWkd: holds how many total hours the person worked each week. - regHrsAmt: initialize to a fixed amount of 40 using constructor. - regPay - otPay After going over the regular hours, the employee gets 1.5x the wage for each additional hour worked. Methods: -...
THIS IS WHAT I HAVE I NEED TO FIX IT SO:
hours_worked should not be inputed separately.
Get the hours as 40 40 40 40 or 40, 40, 40, 40 whichever
separator suits you.
How do I do this?
How would you change what I have in to it getting into that kind
of input.
Thank you!
class Employee:
again = 'y'
def __init__(self):
self.__rate = 7.25
self.__totalhour = 0
self.__regularpay = 0
self.__overtimepay = 0
self.__totalpay = 0
self.__tax...