A. Create a program that has a GUI and calculates earnings and tutoring time by doing the following:
1. Create a GUI that allows a user to enter the following into labeled textfields:
Ã¢â‚¬Â¢ Number of minutes for tutoring session (should be a positive decimal number)
Ã¢â‚¬Â¢ Earnings in dollars and cents received (should be positive decimal number)
a. GUI should be built using javax.swing components jButton, jLabel, jTextField, jTextArea, jFrame, and jPanel.
2. Implement functionality for each of the following application buttons:
Ã¢â‚¬Â¢ Ã¢â‚¬Å“QuitÃ¢â‚¬Â button: Should exit application
Ã¢â‚¬Â¢ Ã¢â‚¬Å“EnterÃ¢â‚¬Â button: Accepts entered number of minutes and earnings; as earnings information is entered, it is stored in a two-dimensional array
Ã¢â‚¬Â¢ Ã¢â‚¬Å“Run ReportÃ¢â‚¬Â button: Calculates total minutes of tutoring provided, average wages earned per hour, total earned to date, and determines if average wage per hour is below, average, or above minimum wage
Note: For an example, see the attached Ã¢â‚¬Å“Sample GUI.Ã¢â‚¬Â
3. Use a two-dimensional array to store the entered minutes tutored and earnings received information for each tutoring session, as illustrated in the attached Ã¢â‚¬Å“Two-Dimensional Array.Ã¢â‚¬Â
4. Implement the Ã¢â‚¬Å“Run ReportÃ¢â‚¬Â button to iterate through the two-dimensional array using a nested for-loop to display the earnings data to the jTextArea, as illustrated in the attached Ã¢â‚¬Å“Earnings Entered.Ã¢â‚¬Â
5. Implement the Ã¢â‚¬Å“Run ReportÃ¢â‚¬Â button to calculate the following:
Ã¢â‚¬Â¢ Total minutes tutoring provided (as a decimal number)
Ã¢â‚¬Â¢ Average wage per hour (in dollars and cents)
Ã¢â‚¬Â¢ Total earnings (in dollars and cents)
Ã¢â‚¬Â¢ Wage analysis, determined based on comparison of average per hour earnings and current minimum wage, using the following logic:
- if average wages per hour is < minimum wage, then below average
- if average wages per hour is = minimum wage AND = minimum wage × 2.00, then average
- if average wages per hour is > minimum wage × 2.00, then above average
6. Display resulting calculations in GUI text area in the required format, as illustrated in the attached Ã¢â‚¬Å“Calculations Display.Ã¢â‚¬Â
Note: All results from calculations should be viewable in the text area. Consider appending to the text area as you write out information.
7. Use exceptions to handle invalid user entries for the following situations:
Ã¢â‚¬Â¢ If minutes entered is less than or equal to zero, throw exception.
Ã¢â‚¬Â¢ Tutors should not tutor for longer than 4 hours per day. If minutes entered is greater than 60 × 4 = 240 minutes, throw exception.
Ã¢â‚¬Â¢ Tutors must be paid for their tutoring service. If earnings entered is not greater than or equal to zero, throw exception.
Note: The program should not terminate abruptly if any of these situations are encountered. The application should print a message Ã¢â‚¬Å“Invalid input.