11A

Write an interface Selectable. It has one method select()which determines if the object meets some set of criteria returning true if it does or false otherwise.

Now modify BankAccount to implement Selectable. A BankAccount is selected if the balance is less than or equal to $100,000

For the draft, just write the Selectable interface. There a a hidden class Dummy in Codecheck. It let's me test your interface. Do not worry about it. You can not compile and execute the Runner class in Bluej. The draft is one problem you will have to test in Codecheck.

To add an interface to a Bluej project, click New Class... and select interface

11A draft:
11A final:

11B

Write a class to model a Telephone. A Telephone has a constructor that takes a brand as a String. Call it brand. It takes a 10 digit phone number as a String. Call it phoneNumber. It has methods getPhoneNumber and getBrandTelephone implements the the Comparable interface. Telephone are ordered by brand. If two Telephone have the same brand, then the Telephone with the phone number that comes first in the lexicographical (alphabetical) order is the smaller. For Example, "4084469999" comes before "5102221111"

Remember that the compareTo method take a Object as parameter not a Telephone (That means you will have to cast)

The starter class has a toString method for testing.

For the draft, supply the instance variables, the constructor, and the getBrand method.

11B draft:
11B final:

11C

Copy your Telephone class into a new project. Create a subclass of Telephone called CellPhone.

CellPhone has a battery charge specified in minutes as a int (call it currentCharge). This is the number of minutes the CellPhone can be used before recharging.

It has a maximum number of minutes it can be used on one battery charge.

The maximum minutes will be a construction parameter along with brand and phoneNumber. In the constructor, set the charge to the maximum

CellPhone has a method use that takes a parameter telling how many minutes to use the CellPhone. The charge should never be negative. If the user tries to use the CellPhone for too many minutes, set the charge to 0;

CellPhone has a method recharge which will recharge the battery to its maximum.

Also supply a method getCharge that returns the remaining minutes the CellPhone can be used.

For the draft, create the subclass, add the new instance variable and implement the constructor. Remember that you will not redefine phoneNumber and brand in CellPhone.

Again there is a toString method provided for testing

Be sure to also paste your Telephone class into Codecheck as well as CellPhone

11C draft:
11C final: