Question: Please do in java(edit my code) Provide code and screenshot Order a orderldCounter: int orderld: int orderedFoods: Food[] totalPrice: double status: String Order) Order(ordered Foods:
![a orderldCounter: int orderld: int orderedFoods: Food[] totalPrice: double status: String Order)](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f32dbe0bdc8_98966f32dbdaf474.jpg)
![getOrderedFoods(): Food[] setOrderedFoods(ordered Foods: Food[]); void getTotalPrice: double setTotalPrice(totalPrice: double): void getStatus():](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f32dbf4b350_99066f32dbec701d.jpg)


Order a orderldCounter: int orderld: int orderedFoods: Food[] totalPrice: double status: String Order) Order(ordered Foods: Food(1) getTotalNo OfOrders(); int getOrderldo: int set Orderld(orderld: int): void getOrderedFoods(): Food[] setOrderedFoods(ordered Foods: Food[]); void getTotalPrice: double setTotalPrice(totalPrice: double): void getStatus(): String setStatus(status: String): void calculateTotalPrice(paymentMode: String): double ce variable apropriate with the alue passed to the constructor Method Description Order(String ordered Foods) Initialize the ordered Foods instance variable appropriately with the value passed to the constructor Generate the orderia using orderidCounter The value of orderid should start from 101 and should be incremented by for the subsequent values initialize the orderidcounter in static block petTotalNoofordero Return the 10tal number of orders placed malement the appropriate etter and setter methods methods and instance rablts have been already implemented in the prenous exercises BillStatic... staurantO.. package demo; "Travelinfo... "Orderinform... 23 33 public class Order InformationWithStatics { //static variable private static int counter; //instance variables private int orderIdCounter; private int orderId; private Food[] ordered Foods :| private double totalPrice; private String status I 5 Winitialize counter to 1 in the static block static { counter = 1; } 8 9 . 1- 22 23 24 25 26 27 328 constructor public Order InformationWithStatics(String paymentMode) { this.orderId = orderId; this orderedFoods - orderedFoods: this.totalPrice = totalPrice; this.status = status; w generate the bill Id by incrementing counter and appending it to 1980 orderIdCounter = "900" # String, volueOf countert+); } //getters and setters public String getOrderId() { return orderId; } public void setOrderId(String orderId) { this.orderId = orderId; } 3. 1 2 2 public String getorderedFoods() { return orderedFoods; } I 15. public void setorderedFoods (String orderedFoods) { this.orderedFoods = orderedFoods; } public String getTotalPrice() { return totalprice: } 52 public void setTotalPrice(String Totalprice) { this, totalPrice = totalprice; return totalStatus } public void setStatus (String Status) { this.status = Status; } 1 2 3 54 55 66 67 68 69 70 public int getCounter() { return counter; } 21 1 72 73 74 75 76 13377 public static void main(String[] args) { Order InformationWithStatics orderedFood1 = new Order InformationWithStatics Order Informationwithstatics orderedFood2 new Order InformationWithStatics Order InformationWithStatics[] orders = {orderedFoodi, orderedFood2); for (Order Informationwithstatics orderedFood : onders) { System.out.println("Ordered Food for Customer"); System.out.println("Order Id: + ordecs .getOrderId); System.out.println("Ordered Food: + orders.getOrderedFoods); System.out.println("Total Price: + ordecs.getTotalPrice); System.out.println("Status: " + ardecs.getStatus()); System.out.println(); 278 279 2380 81 System.out.println(); } LITU > } >
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
