Question: need it in java language and the output must be as shown down Implement the following class diagram that models Order Management System. Item Customer

need it in java language and the output must be as shown down  need it in java language and the output must be as
shown down Implement the following class diagram that models Order Management System.
Item Customer -Dint -name String Order -Noint Client: Customer Items: Arraylist of
item -shipped boolean -Codeint -price double Book Device ISBN String e String
-Name String -type String 1- To class Order, add method total that

Implement the following class diagram that models Order Management System. Item Customer -Dint -name String Order -Noint Client: Customer Items: Arraylist of item -shipped boolean -Codeint -price double Book Device ISBN String e 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 list 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 Grading: Implementing all classes according to the class diagram Method total in Q1 Method unShippedOrders ( Q2-a Method totalBookSales0 Q2-b Method customerOrder(int) Q2-c Method moreBooks(): Q2-d Method highesto:Q2-e Total 0.5 0.5 0.5 0.5 This is the test for HW#1, the output should be same as the one below 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(); 1/ 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,di, d2,03); // to set the devices of company C.setDevices (devices); Book b1=new Book (201, 150,"12345","How to program"); Book b2=new Book (282,50,"55345", "Qatar History"); Book b3-new Book (283,75,"245345","Computer ethics"); ArrayListbooks=new ArrayList(); Collections.addALL(books, b1,b2, b3); Customer ci-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, c4); c.setCustomers(customers); ArrayList itemsi-new ArrayList(); Collections.addALL(items, di,d2); ArrayList items 2-new ArrayList(); Collections.addALL(items 2, b1,b3); ArrayList 1tems3=new ArrayList(); Collections.addALL(items 3,d3, b1,b2); ArrayList items4=new ArrayList(); Collections.addALL(items, di, d2d3); ArrayList items 5-new ArrayList(); Collections.addALL(items4,d2,d2, b1,b2,3); Order 01=new Order (1,ci, items1,false); order 02=new order (2,cz, Itenisz, true); Order 03=new Order (3,c3, items 3, true); Order 04=new Order (4,04, 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.customer orders (4) System.out.println(o.getNo()); System.out.println("-- ----------"); //to test moreBook System.out.println("Customers who spent money to buy books more than devicesy; 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()); The output : Unshiped orders: Total of book sale: 700.0 The orders of customer no 4 Customers who spent money to buy books more than devices Nasaer The best customer : Khaled

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!