Question: can u give atleast relavent java code Implement a java program to purchase the dinner items in a hotel for the following scenario. Create a

 can u give atleast relavent java code Implement a java program

can u give atleast relavent java code

Implement a java program to purchase the dinner items in a hotel for the following scenario. Create a class called "Free" with data member "Icecream" of int type to count the number of complimentary ice cream and another data member called "Milkshake" of int type to count the number of complimentary milkshakes. Create a subclass "Food" from class "Free" with data member "type" of integer array to count the each purchased food type. Create another class called "Buyer" which includes the data members "id", "name", "address", "amount", and object of Food. Create a GUI with the following Swing components: A List box to display the name of the food items along with the prize (Ex: Chapati 50).Text field for each type of food item to enter the quantity. Three text fields to receive the customer id, name, address. Two buttons with the caption "Purchase" and "Report". Two text areas for viewing the current purchased details and purchased history (i.e. so far purchased items, so far complimentary items, so far purchased amounts) When user clicks the Purchase" button create a Buyer object and initialize the data member as follows "id", "name", "address": through text fields. "amount": total amount spent for purchasing(i.e., (selected Food price quantity)) "Food object": type array, Icecream and Milkshake are initialized as follows: type array The type array should be initialised for the entered quantity of the selected Food items Icecream and Milkshake If purchased amount > Rs 1000 and Rs1500 and Rs2000 then offer a single item of Ice cream and single item of the Milkshake (i.e. increment Icecream by one & increment Milkshake by one ). When user clicks the Purchase" button create a Buyer Object as well as displays the buyer details (id,name, address), current purchased items, compliment details, purchased amount in the first text area, and adds the Buyer object into the array list. If the Buyer is already available in the array list then update amount, type array, Icecream, Milkshake. (i.e. by adding the current values with already stored values in the array list). When user clicks the "Report" button, need to show the Buyer details so far maintained. Exception: While pressing the Purchase button, If the quantity is not entered for the selected items, throw the user defined exception with the message "Enter quantity for selected items" If the quantity is entered without selecting an item, throw the user defined exception with the message "Select an item first "If id, name, address are not entered in the given text fields, throw the user defined exception with the message "Enter customer details". These messages have to be displayed in first text area. While pressing "Report" button, If buyer id is not entered in the corresponding text field then throw user defined exception with message "Enter buyer id" and this message has to be displayed in second text area. Implement a java program to purchase the dinner items in a hotel for the following scenario. Create a class called "Free" with data member "Icecream" of int type to count the number of complimentary ice cream and another data member called "Milkshake" of int type to count the number of complimentary milkshakes. Create a subclass "Food" from class "Free" with data member "type" of integer array to count the each purchased food type. Create another class called "Buyer" which includes the data members "id", "name", "address", "amount", and object of Food. Create a GUI with the following Swing components: A List box to display the name of the food items along with the prize (Ex: Chapati 50).Text field for each type of food item to enter the quantity. Three text fields to receive the customer id, name, address. Two buttons with the caption "Purchase" and "Report". Two text areas for viewing the current purchased details and purchased history (i.e. so far purchased items, so far complimentary items, so far purchased amounts) When user clicks the Purchase" button create a Buyer object and initialize the data member as follows "id", "name", "address": through text fields. "amount": total amount spent for purchasing(i.e., (selected Food price quantity)) "Food object": type array, Icecream and Milkshake are initialized as follows: type array The type array should be initialised for the entered quantity of the selected Food items Icecream and Milkshake If purchased amount > Rs 1000 and Rs1500 and Rs2000 then offer a single item of Ice cream and single item of the Milkshake (i.e. increment Icecream by one & increment Milkshake by one ). When user clicks the Purchase" button create a Buyer Object as well as displays the buyer details (id,name, address), current purchased items, compliment details, purchased amount in the first text area, and adds the Buyer object into the array list. If the Buyer is already available in the array list then update amount, type array, Icecream, Milkshake. (i.e. by adding the current values with already stored values in the array list). When user clicks the "Report" button, need to show the Buyer details so far maintained. Exception: While pressing the Purchase button, If the quantity is not entered for the selected items, throw the user defined exception with the message "Enter quantity for selected items" If the quantity is entered without selecting an item, throw the user defined exception with the message "Select an item first "If id, name, address are not entered in the given text fields, throw the user defined exception with the message "Enter customer details". These messages have to be displayed in first text area. While pressing "Report" button, If buyer id is not entered in the corresponding text field then throw user defined exception with message "Enter buyer id" and this message has to be displayed in second text area

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!