For the first part of this assignment, you will extend the existing DecisionMaker class. This class defines an object that will take any yes/no question and return a definitive answer. You are to make the following additions to this class.
DecisionMakerobject so that the number of responses of each type is maintained.
percentagethat takes a String as parameter, representing one of the three responses, and returns the percentage of those responses given so far. For example, suppose a
zultarhas been consulted 10 times, with 4 "YES" responses, 3 "NO" responses, and 4 "MAYBE" responses. Then the call
zultar.percentage("YES")should return 40.0, while the call
zultar.percentage("NO")should return 30.0. If the
percentagemethod is called with a String that is not one of the three possible responses, then it should return 0.0.
For the second part of this assignment, you are to design and implement a class
for storing a secret message. Your
LockBox class should allow the user to
store a message and secure that message with a password. Once stored, the
message can only be accessed or changed with the accompanying password. The
detailed behavior of this class is defined by the LockBox.html
javadoc page. Your class should meet the specifications in this page, and include
comments that would generate a similar page.