Hi All.
Im in the process of writing a basic payroll program in Java. It is for some school work and I am really struggling with it. I have been working with it over the last 3 weeks and have not accomplished much. Below is what I have done so far. Part of the test requires a second contrusctor. I appreciate any help given, I can also send you the actual test document to further understand it if need be.
import javax.swing.*;
import java.util.Scanner;
public class EmployeePayroll {
public double hours, payrate, grosspay, netpay, taxrate;
String firstname, lastname, id;
public EmployeePayroll() {
firstname = "";
lastname = "";
id = "";
hours = 0;
payrate = 0;
grosspay = 0;
netpay = 0;
}
public EmployeePayroll(double _hours, double _payrate, double _grosspay, double _netpay) {
hours = _hours;
payrate = _payrate;
grosspay = _grosspay;
netpay = _netpay;
public double get_hours() {
double _hours;
return _hours;
}
public double get_payrate() {
double _payrate;
return _payrate;
}
public double get_grosspay() {
double _grosspay;
_grosspay = _hours * _payrate;
return _grosspay;
}
public double get_netpay() {
double _netpay;
_netpay = _grosspay - (_grosspay * taxrate);
return _netpay;
}
}
}