Question: In JAVA in an object oriented program, When making an address is this the correct way on making one with (double, double, string, string). If
In JAVA in an object oriented program, When making an address is this the correct way on making one with (double, double, string, string). If not please give me advice or comment on how may I make this address properly
My Program: myPayCheck = new PayCheck(89.90, 15.89, "unknown", "unknown");
and here is my method
public PayCheck(double inHourlyRate, double inHoursWorked, String inLastName, String inFirstName) { hourlyRate = inHourlyRate; hoursWorked = inHoursWorked; grossPay = hourlyRate * hoursWorked;
lastName = inLastName; firstName = inFirstName; federalTaxAmount = FEDERAL_TAX_RATE * grossPay; stateTaxAmount = STATE_TAX_RATE * grossPay; FICAAmount = FICA_RATE * grossPay; netPay = grossPay - (federalTaxAmount + stateTaxAmount + FICAAmount);
}
I'm trying to have the output ask for lastName, however the program is not allowing me to do so except the first two double or the last string(firstName).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
