Question
Given the following UML diagram Product -PurhcaseDate: String - PurchasePrice: double _________________________ +Product(String inDate, double in Price): +SetDate(String inDate): void +GetFate(): String +SetPPrice(double inPrice): void
Given the following UML diagram Product -PurhcaseDate: String - PurchasePrice: double _________________________ +Product(String inDate, double in Price): +SetDate(String inDate): void +GetFate(): String +SetPPrice(double inPrice): void +GetPruchasePrice(): double +ComputeSellingPrice(): double
Food_product -weight: int -EndOfValidity: int ___________________ +Food_Product(String inPurchaseDate, int inPurhcasePrice, int inWeight, int inValidity) +SetWeight (int inWeight): void +GetWeight():L int +SetValidity(int in validity): void +GetValidity(): int +ComputeSellingPrice():double
Cloth_Product -size: int -brand: String ____________________________ +Cloth_Product (String inPurchaseDate, int inPurchasePrice, int inSize, String in Brand): +SetSize(in inSize): void +GetSize(): int +SetBrand(String inBrand): void +GetBrand(): String +CompueSellingPrice ():double
A: Implement the entire class Food_Product, considering the following: weight: is the weight of the product in grams. EndOfValidity is the number of remaining before the end of validity. The medthod SetWeight() throws illegalArtgumentException if it receives a negative value. The method SetValidity() throws illegalArgumentException if it receives a null or negative value ComputeSellingPrice() returns the selling price of the product that should be compted as follows: selling_Price = PurhcasePrice x2.5
B: Implement the entire Cloth_Product considering thr following: size: is the size of the cloth. it must be between 36 and 62 The medthod SetSize() throws illegalArgumentException if it receives a value out of the range [36 to 62] ComputeSellingPrice() returns the selling price of the prodcut that should be computed as follows: selling_Price PurchasePrice x 1.2
C-Implement the netire class product considering the following: - ComputeSellingPrice() is an abstract method
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