using java to create the following classes below for this lab you will create a hier 5155134

Using Java to create the following classes below.

For this lab you will create a hierarchy of several classes: iDevice (the parent), iPod, iPad, and iPhone.

The parent class – iDevice – has a non-abstract method called getPurpose() which returns its purpose String. The purpose String instance variable is set in the constructor. The iDevice class also has an abstract method called printDetails() which prints out all of the child class’s instance variables.

Child classes of iDevice:

– iPod:              the purpose of this iDevice is “music”
– iPad:               the purpose of this iDevice is “learning”
– iPhone:          the purpose of this iDevice is “talking”

Note: the child classes also contain instance variables, constructor parameters, accessor methods, and mutator methods for several other data members:

– iPod:              (int) number of songs stored, (double) maximum volume in decibels
– iPad:               (boolean) has a case, (String) operating system version
– iPhone:          (double) number of minutes remaining on phone plan, (String) carrier

Also, each of these four classes also overrides toString() to return all of the object data in a String. Use the @Override annotation. Child classes’ toString() methods must also call their parent’s toString() method.

Furthermore, each of these four classes also overrides equals(). iPods with the same number of songs stored are considered equal; iPads with the operating system version are considered equal; iPhones which have +/- 10 minutes of each other’s number of minutes remaining on their phone plan are considered equal. Use the @Override annotation.

Extend the iPhone class; it has a child called iPhoneSeven.

The iPhoneSeven class also contains instance variables, constructor parameters, accessor methods, and mutator methods for several other data members:

– (boolean) high-resolution camera
– (int) gigabytes of memory

Also, the iPhoneSeven class overrides toString() to return all of the object data in a String. Use the @Override annotation. This toString() method must also call its parent’s toString() method.

Furthermore, this class also overrides equals(). iPhoneSevens that have +/- 10 minutes of each other’s number of minutes remaining on their phone plan are considered equal, but only if they also have the same value for “high-resolution camera”. Use the @Override annotation.

Remember to override hashCode properly too for each class.

Please follow the instructions above for a good rate

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now