public class Candy{

private String color;

public Candy(String color){

this.color = color;

}

public String getColor(){

return this.color;

}

}

Composition

Review

You have reached an optional review point.

Click the button to view the exam-style questions. Attempt as many as you can.

Scenario

A MoodyBaby is happy after eating lots of red Candy and sad otherwise.

The MoodyBaby has an internal MoodTracker.

Each time she eats a , her MoodTracker will be updated.

After eating all of the Candy, the baby will laugh if her mood is a positive number, and cry otherwise.

is an abstraction of a MoodyBaby in the form of a class.

Task

Complete the worksheet.