Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MAKE A UML CLASS DIAGRAMS FOR THE FOLLOWING JAVA CODE!!! and describe the 3 functions the system will implement. This description should include any arguments,
MAKE A UML CLASS DIAGRAMS FOR THE FOLLOWING JAVA CODE!!! and describe the 3 functions the system will implement. This description should include any arguments, returns, or fields needed in order to make this functionality work:
PRODUCT:
BOOK:
CD:
DVD:
MEMBER:
PREMIUM MEMBER:
STORE:
public class Product \{ private int count; private int productID; public Product(int pID, int noofProduct) \{ public void setcount (int count) \{ public int getProductID () \{ this.productID=pID; this. count = noofProduct; return productID; p public int getcount () \{ peturn count; this.productid = productid; public class Book extends Product \{ private String ISBN; public Book (int pID, String bISBN, int noofProduct) { ) super (pID, noofProduct); this.ISBN = bISBN; public String getISBN () \{ return ISBN; f public void setISBN (String iSBN) \{ ISBN = iSBN; public class CD extends Product public CD (int pID, int noofProduct) super (pID, noofProduct) ; f \} public class DVD extends Product public DVD (int pID, int noofProduct) \{ super (pID, noofProduct); // TODO Auto-generated constructor stub ? return lastName; \} public void setLastName (String lastName) \{ this. lastName = lastName; 3 public double getMoneySpent() \{ return moneyspent; \} public void setMoneySpent (double moneySpent) f this.moneySpent = moneySpent; 3 } this.feePaidonTime = feePaidonTime; \} b System. out.println( : "Plese enter book isbn number"); bISBN =SC next (); book = new Book (pID, bISBN, noofProduct); Inventory.add ( : book); belse if (isBook. equalsIgnoreCase ( anotherstring: "M" ) ) cd = new CD (pID, noofProduct); inventory.add ( : cd); f dvd = new DVD (pID, noofProduct); inventory.add ( : dvd); System. out.println( ": "Press Y if you want to add another item in inventory"); char ch =Scnext() charAt ( inder: 0); if (ch I=Y ' II ch I=Y) break; b 3 private static void DistributeItem() f // TODO Auto-generated method stub System. out.println( : "Enter product id to issue"): int pID =sc nextInt () ; int pCount: String premium = null, paymentMethod = null; double fee =0; PremiumMember member; if (findProduct (pID)) f System. out.println( w: "Enter number of item you want"); pCount =SC nextInt () ; if (CheckInventory(pID, pCount)) \{ System. out.println( ;: "Plese enter Member ID"); int id =ScnextInt() : System. out.println( i: "Plese enter Member first Name"): String fName = sc.next (); System. out.println( ;: "Plese enter Member last Name"); String lName = sc.next (): System. out.println( ar: "Press Y\Y if you member is Premium"); member = new PremiumMember (id, fName, 1Name ); if (premium. equalsIgnoreCase( anotherstring: "Y")) \{ System. out.println( m: "Enter monthly fee and payment method"); member.setFeeMonthly (feeMonthiy: fee); member.setPaymentMethod (paymentMethod); \} members.add ( e: member); 1 belse \{ System. out.println( : "Item not found"); \} f private static boolean CheckInventory(int pID, int pCount) \{ String check; System. out.println(a: "Do you want to distribute more items press Y"); check = sc.next () ; if (! check. equalsIgnoreCase (anotherstring : "Y") ) f break; 3 \} \} b
Step 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