Question
Please do in Java :) Please edit my code :) package demo; //CLASS ADDRESS class CustomerInfo{ //VARIBALES String customerId; String customerName; long contactNumber; Address address;
Please do in Java :)
Please edit my code :)
package demo;
//CLASS ADDRESS class CustomerInfo{ //VARIBALES String customerId; String customerName; long contactNumber; Address address; //Constructor CustomerInfo(String customerId,String customerName, long contactNumber, Address address){ this.customerId=customerId; this.customerName=customerName; this.contactNumber=contactNumber; this.address=address; } //Getter and Setter Methods public String getCustomerId() { return customerId; }
public void setCustomerId(String customerId) { this.customerId = customerId; }
public String getCustomerName() { return customerName; }
public void setCustomerName(String customerName) { this.customerName = customerName; }
public long getContactNumber() { return contactNumber; }
public void setContactNumber(String city) { this.contactNumber = contactNumber; }
public int getAddress() { return address; }
public void setZipcode(Address address) { this.address = address; } } //Customer Class class OrderInfo{ private static int orderIdCounter = 100; int orderId; Customer customer; Food[] orderedFood; double totalPrice; String status; public Order() { orderIdCounter++; } public int getTotalNoOfOrders() { return orderId; } Order(int orderId, Customer customer, Food[] orderedFood, double totalPrice){ { this.orderId=orderID; this.customer=customer; this.orderedFood=orderedFood; this.totalPrice=totalPrice; this.status=status; } public int getOrderId(){ return orderId; } public void setOrderId)int orderId){ this.orderId; } public Customer customer() { return customer; } public void setCustomer(Customer customer) { this.customer; } public Food[] getOrderedFood() { return orderedFood; } public void setOrderedFood(Food[] orderedFood) { this.orderedFood; } public double getTotalPrice() { return totalPrice; } public void setTotalPrice(double totalPrice) { this.totalPrice; } public String getStatus() { return status; } public void getStatus(String status) { this.status; } class Food{}
public void displayOrderInfoDetails() {//DISPLAY ALL DETAILS ABOUT CUSTOMER System.out.println("OrderId: "+orderId); System.out.println("Customer: "+customer); System.out.println("Ordered Food: "+orderedFood ); System.out.println("Total Price is: " +totalPrice); System.out.println("Status: " + status); System.out.println("CustomerId: "+customerInfo.customerId + ", Customer Name: "+customerInfo.customerName+", Customer Contact Number: "+customerInfo.contactNumber+", Customer Address "+customerInfo.address); }
public double totalPrice(double totalPrice) { return totalPrice; }
} //Main Class public class CustomerAggregation { public static void main(String args[]) { Address a=new Address(100,"Jonny",8326677,"123 Fake St"); Order c=new Order(100,"Monika","Pizza",13, " , Ready to go!"); o.displayOrderInfo(); System.out.println("The total price is: $"+ c.totalPrice(20.0)); } }
Problem Statement You have already created the Customer and Order classes in the SwiftFood project. Modify the Customer and Order classes based on the class diagram given below Order _orderld Counterlint orderidint customer Customer orderedFoods Food totalPrice double P > One Orderderedfood Foodlotomer Customer Nerdesin Orderlin Overlorderint void getCustomer Customer Customer customer Customer:void eidered sods Food Orderfoods orderedFood Food get Tota Price duble Totaltractalprice doubles void get Sering stat Sering ved Customer * customerld: String custam String contact Number long maddele Address Customer Customerstomer String customer String contact Number long Audio Customer stomeriame String contadNumber long addin Adder Customing Customer customerlasting vod get customer String Customer lamelustame Name String ved getContactomber long contemberontaalumber longlived Address Address Adved deply Custerbetah vid potricidade deStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started