Question: **Please Write different methods ** Do not write entire code in main. ** incorporate GUI components of JTextField, JTextArea and JButton with the following requirements.

**Please Write different methods ** Do not write entire code in main. **

incorporate GUI components of JTextField, JTextArea and JButton with the following requirements. The application should calculate the cost of the meal order based on an adult meal and child meal. The user will input a four digit identification code for the school, the number of adult meals and child meals each in separate text fields. (You will have 3 text fields). After the interface is displayed and the user has completed the entry for the purchase, display the School ID, the the number of adult meals and the number of child meals. The charge is calculated using adult meal costing $7.00 and child meal costing $3.50. Accumulate the total charge for all of the meals and the number of meals sold and display each of these last 2 items in individual labels. Interface Layout and Input Include the fictitious name of charity as a label at the top of your frame, displaying the charity name in a larger font than the rest of the fields in the interface. Include the following labeled text fields for user input: School-identification code (a four-digit code) Mealsone text field for adult meal and another text field for child meal Include a button to trigger the calculations and display the results. Also allow for the last text field to trigger the calculations and display. Include a text area for displaying the results of the current order. Include individual labels for both the total accumulated meal charges for all orders and the total number of meals processed for all orders. Include a label at the bottom of the interface containing your name as the developer. Processing After the user has input the School ID code, the number of adult meals and the number of child meals and calculate the cost of the order based on $7.00 for adult meal and $3.50 for the child meal. Accumulate the total (adult and child) meals charges for all orders entered and the number of meals (adult and child meals) processed. (Note: Assume for each user processing is only one order) You must use constants for the adult meal of 7.00 and the child meal of 3.50. Output Display the School ID, the adult and child meal formatted to include a dollar sign and 2 decimal place. Sample Data below and the meal charge in the text area. Display the total shipping charges for all packages and the number of packages processed in individual labels . School Code Wa78 Adult Meal 3 Child Meal 2 Total Cost $28.00 Other Requirements You must ensure that you do not code your entire application in the main method. Use a constructor to build the user interface and the actionPerformed method of the ActionListener interface to respond to the users entry and do the calculations needed. You may break the task into more methods than described above, if you prefer. Also, try to use the setSize method of the JFrame to position your fields so that the interface is readable (labels next to the matching text fields, etc. Use constants for the width and height of the frame. Remember that you can also help to determine the size of your components when you declare them. Extra spaces in a label or button could help to line up items for a better interface look. Sample Data Calculation Test Data (Input) Check Figures (Answer) School ID Meals Meal Charge Wa78 3 Adult. 2 Child . $28.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!