Question: QUESTION 2 60 MARKS Required: Given the following THREE (3) classes (found on the Edstem platform) - IceCream, Milkshake, and Waffle: a) Log into

QUESTION 2 60 MARKS Required: Given the following THREE (3) classes (found on the Edstem platform) - IceCream, Milkshake, and Waffle: a) Log into the learning platform edstem.org; navigate to: Assessments > Final Exam Question 2 > Consumable.java. Create an abstract superclass, Consumable, and modify the provided classes to work with your abstract superclass. Create a no-arg constructor, a parameterised constructor, and a toString () method for each class. Use as many concepts and principles learned in this course as possible. [SUBMIT ON EDSTEM] (20 marks) b) Justify your class design. Discuss the reasoning behind your design decisions for each of the FOUR (4) classes. [max 500 words] (10 marks) c) Do you think an abstract class or an interface would be more appropriate in this scenario? Justify your answer, making detailed reference to the code provided/written to reinforce your argument. [max 500 words] (10 marks) d) Log into the learning platform edstem.org; navigate to: Assessments Final Exam Question 2 PolymorphismDemo.java. Using the classes you have implemented in part 2(a), create a complete program that demonstrates the concept of polymorphism. [SUBMIT ON EDSTEM] (10 marks) e) Describe how the code you have written in part 2(d) demonstrates the concept of polymorphism, making specific references to the code you have written in parts 2(a) and/or 2(d). [max 250 words] (5 marks) f) Explain inheritance with appropriate references to the code you have written in parts 2(a) and/or 2(d). [max 250 words] (5 marks)
Step by Step Solution
3.42 Rating (149 Votes )
There are 3 Steps involved in it
a Code Implementation Here is an example implementation for creating an abstract superclass Consumable and modifying the provided classes to work with this abstract superclass ... View full answer
Get step-by-step solutions from verified subject matter experts
