Design, implement, test, and debug an application to compute an employee’s weekly pay. If the employee works more than 40 hours a week, the employee earns 1.5 times the basic hourly pay for any time worked over 40 hours. The program should allow the user to input the employee’s name, the number of hours worked, and the hourly rate.

• The application should include a Calculate button that, when pressed, computes and displays the total pay in a label or text field.
• The program should allow the user to enter information for any number of employees in this manner.
• Include an Exit button to end the execution of the application.
• The program should allow the user to select the employee’s department from a menu. This can be a standard menu, radio buttons, or a JComboBox. Create your own list to populate the menu: Marketing, IT, Accounting, and so forth.
• Include at least five departments.
• Validate the employee’s hourly wage and hours worked according to the following rules:

o The hourly wage must be at least $6 per hour and cannot be more than $150 per hour. It must be numeric.
o The hours worked must be a numeric value greater than or equal to 0 and cannot be greater than 60.

• Create a JTextArea, JTable, or other form of a table to your application and use that to list the following for every employee:

o Name
o Department
o Weekly salary

• Add each employee to the list after you have computed that employee’s salary.

What have you done so far and what is your question?

To design, implement, test, and debug an application to compute an employee's weekly pay, you can follow these steps:

1. Design the user interface:
- Create a JFrame or JPanel to hold the components.
- Add labels, text fields, buttons, and a table to display the employee information.

2. Implement the user interface:
- Use appropriate Swing components such as JLabel, JTextField, JButton, JTable, etc.
- Set up event listeners for button actions.

3. Test the application:
- Ensure that all components are properly displayed.
- Test all user interactions, such as entering employee information and clicking buttons.
- Verify that the calculations and validations are working correctly.

4. Implement the logic for calculating the employee's weekly pay:
- When the Calculate button is pressed, retrieve the entered values (name, hours worked, hourly rate).
- Validate the inputs according to the specified rules.
- If the inputs are valid, calculate the weekly pay:
- If the hours worked are greater than 40, calculate the overtime pay as 1.5 times the hourly rate multiplied by the number of overtime hours.
- Calculate the regular pay as the hourly rate multiplied by the hours worked (capped at 40 hours).
- Calculate the total pay as the sum of the regular pay and overtime pay.
- Display the total pay in the appropriate field or label.

5. Implement the functionality for selecting the employee's department:
- Create a menu (JComboBox, radio buttons, or a menu bar) to allow the user to select the department.
- Define a list of department options (e.g., Marketing, IT, Accounting).
- Retrieve the selected department and associate it with the employee.

6. Create a JTextArea, JTable, or other form of a table to display the employee information:
- After calculating the employee's salary, create a new row in the table to display the employee's name, department, and weekly salary.
- Update the table with each new employee added.

7. Add an Exit button to end the execution of the application:
- Set up an event listener for the Exit button.
- When the Exit button is pressed, terminate the program.

By following these steps, you should be able to design, implement, test, and debug an application to compute an employee's weekly pay with the specified requirements.