Question: this is data structure help please the output should be like that data structure (java) language here is the test so i need the code
this is data structure help please
the output should be like that
data structure (java) language here is the test so i need the code of each class
Implement the following class diagram that models Order Management System. Customer Order Item -Dint -name String -No int Client Customer tems. Arraylist of em shipped boolean code int -price double Book Device HSBN String -title: String -Name String -Type: String 1- To class Order, add method total that returns total of all order's items prices. 2- Create a new class called Company that has array list of: customers, books, devices, orders, and add setter/getter for each one of them. Add the following methods : a) unShippedOrders(): it returns array list of all orders that are not shipped (shipped field is false) b) totalBookSales(): it returns total of book sales (money) in all orders. c) customerOrder(int): it receives a customer id, and returns array list of all his orders. d) moreBooks(): it returns an array of customers who bought books and devices but spent more money on books than on devices. e) highest(): it returns name of the customer who has the maximum sale! The output : Unshiped orders: ||| Total of book sale: 700.0 The orders of customer no Customers who spent money to buy books more than devices Nasaer ------ The best customer : Khaled import java.lang.reflect. Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class Test { public static void main(String[] args) { // to create an object of company Company C=new Company(); // to create an array list of device Device di-new Device (123, 2000, "Galaxy S7","Mobile"); Device d2-new Device (124, 1500, "Smart LED","TV"); Device d3-new Device (125,150,"watch xyz", "Watch"); ArrayListdevices=new ArrayList(); // to add the device objects to the array list Collections.addALL(devices, d1, d2,d3); // to set the devices of company C.setDevices (devices); Book b1-new Book (201, 150,"12345", "How to program"); Book 62-new Book (202,50,"55345","Qatar History"); Book b3 new Book (203,75,"245345","Computer ethics"); ArrayListbooks-new ArrayList(); Collections.addALL(books, b1,b2,63); Customer cl=new Customer (1,"Ahmed"); Customer c2=new Customer (2, "Sara"); Customer c3=new Customer (3, "Nasaer"); Customer c4=new Customer (4, "Khaled"); ArrayListcustomers=new ArrayList Collections.addAll(customers, c1, c2,c3, 4); NII C.setCustomers(customers); ArrayList- itemsi-new ArrayList ; Collections.addAll(items1, di,d2); ArrayList
- items2=new ArrayList(); Collections.addALL(items2, b1,b3); ArrayList
- items3=new ArrayList(); Collections.addALL(items3, d3, b1,b2); ArrayList
- items4=new ArrayList(); Collections.addALL(items4, d1, d2,3); ArrayList
- items5=new ArrayList(); Collections.addALL(items4, d2,2,b1,b2,63); Order oi-new Order (1,c1, items1,false); Order ozenew order (2,C2,1temsz, true) Order 03=new Order (3,c3, items 3, true); Order 04=new Order (4,c4, items4,false); Order 05=new Order (5,04, items5, true); ArrayList orders=new ArrayList(); Collections.addAll(orders,01,02,03,04,05); C.setOrders (orders); // to test unshiped method System.out.println("Unshiped orders:"); for (Order o:c.unShippedOrders() System.out.println(o.getNo(); System.out.println("------ ------------------"); // to test totalBookSale System.out.println("Total of book sale:"); System.out.println(c.totalBookSales()); System.out.println("- ----------------"); // to test customer order System.out.println("The orders of customer no 4"); for (Order o:c.customerOrders (4) System.out.println(o.getNo()); System.out.println("----------------------------"); //to test moreBook System.out.println("Customers who spent money to buy books more than devices"); for (Customer cust:c.moreBooks () System.out.println(cust.getName()); System.out.println("----- //to test highest method System.out.println("The best customer :"); System.out.println(c.highest())