Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to format a GUI to go with a payroll program Create a GUI app which does

ID: 3647556 • Letter: I

Question

I need to format a GUI to go with a payroll program
Create a GUI app which does the following for a payrate program as described:

Now, create a GUI application that allows the user to click a button to submit a rate. After the user has made a valid entry, or after two invalid entries, make the button invisible.

Save the program as SecondChancePayRateGUI.es.


Hourly Pay Rate Program 2

Write a program that prompts a user for an hourly pay rate. The program should justify the following conditions:

If the user enters values less than $7.50 or greater than $49.99, prompt the user to enter the value again.
If the user enters an invalid value in the second attempt, display an appropriate error message.
If the user enters a valid value on either the first or second attempt, display the pay rate as well as the weekly rate, which is calculated as forty times the hourly rate.

Save the program as SecondChancePayRate.es.

Explanation / Answer

I am suppose to add an abstract method, e.g. enterData into the superclass Employee, and override it in each of its subclasses. To test, create an array of Employees. Loop through the array to enter data. Then loop through the array again to calculate and output their earnings. but i don't know how... here are the completed super class and subclasses so far. This is what I have so far, Java Code: 001 public class PayrollSystemTest 002 { 003 public static void main( String args[] ) 004 { 005 // create subclass objects 006 SalariedEmployee salariedEmployee = 007 new SalariedEmployee( "John", "Smith", "111-11-1111", 800.00 ); 008 HourlyEmployee hourlyEmployee = 009 new HourlyEmployee( "Karen", "Price", "222-22-2222", 16.75, 40 ); 010 CommissionEmployee commissionEmployee = 011 new CommissionEmployee("Sue", "Jones", "333-33-3333", 10000, .06 ); 012 BasePlusCommissionEmployee basePlusCommissionEmployee = 013 new BasePlusCommissionEmployee("Bob", "Lewis", "444-44-4444", 5000, .04, 300 ); 014 015 System.out.println( "Employees processed individually: " ); 016 017 System.out.printf( "%s %s: $%,.2f ", 018 salariedEmployee, "earned", salariedEmployee.earnings() ); 019 System.out.printf( "%s %s: $%,.2f ", 020 hourlyEmployee, "earned", hourlyEmployee.earnings() ); 021 System.out.printf( "%s %s: $%,.2f ", 022 commissionEmployee, "earned", commissionEmployee.earnings() ); 023 System.out.printf( "%s %s: $%,.2f ", 024 basePlusCommissionEmployee, 025 "earned", basePlusCommissionEmployee.earnings() ); 026 027 // create four-element Employee array 028 Employee employees[] = new Employee[ 4 ]; 029 030 // initialize array with Employees 031 employees[ 0 ] = salariedEmployee; 032 employees[ 1 ] = hourlyEmployee; 033 employees[ 2 ] = commissionEmployee; 034 employees[ 3 ] = basePlusCommissionEmployee; 035 036 System.out.println( "Employees processed polymorphically: " ); 037 038 // generically process each element in array employees 039 for ( Employee currentEmployee : employees ) 040 { 041 System.out.println( currentEmployee ); // invokes toString 042 043 // determine whether element is a BasePlusCommissionEmployee 044 if ( currentEmployee instanceof BasePlusCommissionEmployee ) 045 { 046 // downcast Employee reference to 047 // BasePlusCommissionEmployee reference 048 BasePlusCommissionEmployee employee = 049 ( BasePlusCommissionEmployee ) currentEmployee; 050 051 double oldBaseSalary = employee.getBaseSalary(); 052 employee.setBaseSalary( 1.10 * oldBaseSalary ); 053 System.out.printf( 054 "new base salary with 10%% increase is: $%,.2f ", 055 employee.getBaseSalary() ); 056 } // end if 057 058 System.out.printf( 059 "earned $%,.2f ", currentEmployee.earnings() ); 060 } // end for 061 062 // get type name of each object in employees array 063 for ( int j = 0; j = 0.0 ) && ( hoursWorked