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

Write a C# GUI application that accepts employee data to include employee name,

ID: 3645543 • Letter: W

Question

Write a C# GUI application that accepts employee data to include employee name, number, pay rate, and number of hours worked. Pay is to be computed as follows: Hours over 40 receive time-and-a-half pay. Store the employee name, number, and the total amount of pay (prior to deductions) in a text file. Close the file and then, in the same application, retrieve the stored values and display the employee name and the formatted total pay. Form1 should have the following Labels and text boxes for name, employee number, pay rate and hours worked. Should have store and retreive data buttons, and a list box for displaying the info.
STEP 1: Enter Employee Data then click the

Explanation / Answer

public class payrollSystem test { 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
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote