(Solved) : Irogers 7 04 Pm Mycourses2mcgillca Market Place Assignment Write Several Classes Simulate Q31558553 . . .
Coding in Java using eclipse![IROGERS 7:04 PM mycourses2.mcgill.ca Market Place For this assignment you will write several classes to simulate an online Market place. Make sure to follow the instructions below very closely. Note that in addition to the required methods, you are free to add as many other private methods as you want (no other additional method is allowed) 10 points Write an abatract elass MarketProduct whikh has the following private feld: A String name The class mast also have the following public methods: A constructor that talkes a String as input indicating the name of prodact and uses it to initialize the corresponding attribute. . A final getName metbod to retrieve tbe name of this MarketProduct. . An abatract method getCost ) which takes no input and returns an int. This method should be abstract (thus, not implemented) because how to determine the cost depends on the type of product An abstract method equals() ㆌnch takes an Object as an input and returns a boolean. This method should be abstract as well, since depending on the type of peoduct different conditions shoald be met in order for two products to be considered equal. 25 points] All of the follomings must be subclasses of the MarketProduct Write a class Egg derived from the MarketProduct class. The Egg class has the following private fields: An int indicating the number of eggs -An int indicating the price per doaen of these egs. Note that the all the prioes (throughout the assignment) are indicated in cents. For instance, 450 represeuts the amount $A.30 The Egg class has also the Sollowing public methods A constructor that takes as impt a String with the name of the product, an int indicating the number required, and an int indicating the price of sach prodact by the doaen. The construetor uses the inputs to create a NarketProduct and initialize the corresponding fiekds. -A getCost) method that takes no input and returns the cost of the product in cents. The cost is compated base on the umber required and the cost per donm. For instance, 4 large brown egs at 380 cents/dozen cost 126 cents (the cost should be rounded down to the nearest cent). You may assume that cost of all MarketProducts fits within an int and therefore doesnt cause overflow An equals() method which takes as input an Object and return true if input uaatches this in type, name,cost and number of eggs. Otherwise the method returns false](https://media.cheggcdn.com/media%2F4b0%2F4b0a2f28-6c5e-4d04-8daf-0abc3639c687%2Fimage.png)



IROGERS 7:04 PM mycourses2.mcgill.ca Market Place For this assignment you will write several classes to simulate an online Market place. Make sure to follow the instructions below very closely. Note that in addition to the required methods, you are free to add as many other private methods as you want (no other additional method is allowed) 10 points Write an abatract elass MarketProduct whikh has the following private feld: A String name The class mast also have the following public methods: A constructor that talkes a String as input indicating the name of prodact and uses it to initialize the corresponding attribute. . A final getName metbod to retrieve tbe name of this MarketProduct. . An abatract method getCost ) which takes no input and returns an int. This method should be abstract (thus, not implemented) because how to determine the cost depends on the type of product An abstract method equals() ㆌnch takes an Object as an input and returns a boolean. This method should be abstract as well, since depending on the type of peoduct different conditions shoald be met in order for two products to be considered equal. 25 points] All of the follomings must be subclasses of the MarketProduct Write a class Egg derived from the MarketProduct class. The Egg class has the following private fields: An int indicating the number of eggs -An int indicating the price per doaen of these egs. Note that the all the prioes (throughout the assignment) are indicated in cents. For instance, 450 represeuts the amount $A.30 The Egg class has also the Sollowing public methods A constructor that takes as impt a String with the name of the product, an int indicating the number required, and an int indicating the price of sach prodact by the doaen. The construetor uses the inputs to create a NarketProduct and initialize the corresponding fiekds. -A getCost) method that takes no input and returns the cost of the product in cents. The cost is compated base on the umber required and the cost per donm. For instance, 4 large brown egs at 380 cents/dozen cost 126 cents (the cost should be rounded down to the nearest cent). You may assume that cost of all MarketProducts fits within an int and therefore doesn’t cause overflow An equals() method which takes as input an Object and return true if input uaatches this in type, name,cost and number of eggs. Otherwise the method returns false Show transcribed image text
Expert Answer
Answer to Irogers 7 04 Pm Mycourses2mcgillca Market Place Assignment Write Several Classes Simulate Q31558553 . . .
OR