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...
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...
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...
Create the Python code for a program adhering to the following specifications. Write an Employee class that keeps data attributes for the following pieces of information: - Employee Name (a string) - Employee Number (a string) Make sure to create all the accessor, mutator, and __str__ methods for the object. Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: - Shift number (an integer,...
I am working in c++. My program requires me to use a header file that is provided. I must use this header file and create 5 methods: 2 constructors, 2 accessors and this operation* on a 4x4 matrix. Matrix has 16 floating point values that must be entered by user. The Two operator functions: i*t; and t+i, multiply identity (i) matrix by user input value matrix and second function add identity (i) plus user input matrix transform. These two operations...
Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any...
In C++ Please please help.. Assignment 5 - Payroll Version 1.0 In this assignment you must create and use a struct to hold the general employee information for one employee. Ideally, you should use an array of structs to hold the employee information for all employees. If you choose to declare a separate struct for each employee, I will not deduct any points. However, I strongly recommend that you use an array of structs. Be sure to read through Chapter...