Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this last part is for better understanding.. Please i would like you to answer this for me in less than 2hours 30mins thanks in advance.
this last part is for better understanding..
Please i would like you to answer this for me in less than 2hours 30mins thanks in advance.
Home task: Goal: Practice Java Strategy Pattern Imagine the situation, where you have many children and they all want to get a candy (just 1). All children are different meaning that the ways they choose (using what principle) are also different. Let's call it "Children Strategy of choosing Candy". Your task is to implement this logic into Java code and test it in TestStrategy() class. Explanation: Follow this order of implementation to make your work easier Candy type: String +Candy(type: String) +getType(): String +toString(): String Candy class (What children will be choosing). Each Candy has: - Constructor Type : String (type might be whatever you choose : "Marshmallow", "Jelly Candy", "Caramel") getType() method which returns the type of Candy - toString() method which properly format Candy object representation > ChoosingCandyStrategy +chooseCandy(listOfCandies : ListStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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