You have been assigned to create an application with a graphical user interface (GUI) for an Auto Care Center company. After few meetings with the customer (the auto care company), a set of functional requirements have been developed. These requirements are described in Section 2. Your task is three fold:
Please follow example Brandis Bagel House project fully explained in your textbook. I want you to create individual classes that EXTENDS JPanel class, for the Customer, Customer Information, Week Specials, and Other Services. Then add those panels into your main JFrame.
The deliverable program shall have the Graphical User Interface as seen in Figure 2.1. Please pay attention in all details such as:
(Your grade will also be based on how close your program looks like the GUI shown in Figure 2.1, so work hard to get it as close as you can) See image.
For the Customer, if this is a new customer, apply 10% discount on the final invoice value. For old customers, apply 5%.
For the Week Specials, for each service checked, the service total cost will be increase by a certain value, as specified in the Table 1.
Table 1 Service type versus Service Cost
Item Number Service Type Service Cost
1 Brakes $30.30
2 Tire Rotation $20.20
3 Fluid Check $10.10
4 Car Wash $5.05
5 Annual Emission Inspection $40.40
For the Other Services, the following sub-requirements are specified.
The Drop-down box shall be disabled when its associate Check box has not been checked. For example, if the Tire Replacement check box has not been selected, then the drop-down box for selecting the tire type shall be disabled.
As the Tire Replacement check box has been selected, its associate drop-down box shall be immediately enabled for tire selection.
The same functionality specified in Functional Requirement 4.1 shall be implemented for the Oil Change.
The prices shown on Table 2 shall be used for the Other Services when service has been selected.
Table 2 Service type versus Service Cost
Item Number Service Type Service Cost
1 Regular Tires $250.25
2 Premium Tires $350.35
3 Regular Oil $15.15
4 Synthetic Oil $27.27
For the Service Cost, for any entry that impacts on the total service cost, e.g., any entry in the customer, week specials, and other services, the value of the invoice shall be automatically and immediately updated. The cost value shall include the 6% local tax.
If the Reset button is pressed, all inputs of this GUI shall be cleared out. The only exception is for the Customer group: the New Customer shall be selected as the default entry.
If the Print Invoice button is pressed, a new window (frame) shall be displayed (Please pay attention, I do not want a JOptionPane here!!!). The layout of this window has been left to our discretion, i.e., there is no specific format, but the functionality described in the next sub-requirements shall be implemented.
This window shall show a summary of the customer order containing:
This window shall have two buttons located at its bottom portion: Print and Cancel buttons.
The Print button shall write the shown invoice into the following text file: fileName.txt. The fileName shall be the customer name with underscores between the words composing his/her name.
Example: If the customer name is John Brasko Smith , the output text file shall be john_brasko_smith.txt.
After writing the file, a JOptionPane shall be used to confirm that the invoice has been printed. After the user provides acknowledge of it (by pressing the OK button of this JOptionPane dialog box), the window described in Functional Requirement 7 shall be closed and the GUI shall be the only window open on the screen.
The Cancel button closes this window and the GUI shall be the only window open on the screen.