Select Page

Florida International University Creation of Interface Called Mammal Lab Report

Question Description

I’m working on a java project and need a sample draft to help me study.

Overview

The exercise will create a program to keep track of the animals for sale in a pet store. Our pet store only sells mammals – specifically dogs, cats and rabbits. The program will have an interface for Mammal that can be implemented for our Cat, Dog and Rabbit classes. The implemented classes of Cat, Dog and Rabbit will be abstract classes, which will form the base class for concrete extended from those classes. For example, the Cat class will implement the Mammal interface. From there, we can have a specific type of cat such as a Persian that will be the concrete class. Someone who adopts an animal from our pet store would adopt a specific cat that is the breed of Persian.

Either the Mammal class or an implemented class will implement the Comparable<T> interface. The Mammal interface will contain abstract methods that should be found in any kind of mammal (cat, dog, rabbit and so on). The base class that implements Mammal will contain the elements that are common to all of the subclasses. The concrete classes will represent the variety of forms of the implemented class. The compareTo() method will be implemented either in the base class or in the subclasses to compare attributes that are shared between the classes in the inheritance chain.

Specifications

The project will create an interface called Mammal that can be implemented for the types of animals that we sell in our pet shop – cats, dogs and rabbits. The Mammal interface should have all of the method headers for attributes or actions that are shared commonly amongst all of the animals. There should be at least 3 methods in the Mammal interface. For example, all mammals must eat, so there may be a method for eating that when implemented, will update an attribute in the implemented animal class.

The program will have at least 3 abstract class that extend from Mammal that represent cats, dogs and rabbits. The abstract classes will be the base classes for the variety of specific animals in each category. The concrete animal classes will extend from one of the base classification abstract classes. Either the abstract classes or the concrete classes will implement the Comparable<T> interface and have a compareTo() method to compare some attribute(s) of the animals. Each abstract base class should have at least 3 concrete animal classes that extend from them.

The tester class, containing the main method, should be used to print the information stored and generated by the subclasses. Polymorphism should be used to create a data structure, such as an ArrayList or an array, to hold the objects that will be used to generate the output for the program. The user should be presented with a menu that will allow them to, at a minimum, see the animals available for adoption or view a specific animal in the list. The abstract base class should have at least 5 attributes for the base class. Attributes can include such things as breed, name, age or other information common to the concrete classes based on the abstract class. You have the flexibility to add as many attributes as you determine appropriate, as long as there are a minimum of 5 attributes in the base class. The program should have at least the 3 specified concrete animals with one of the concrete subclasses extending another subclass. For example, the abstract Cat class implements Mammal. The concrete class Siamese extends Cat. The concrete class Tabby_Pointed_Siamese extends Siamese, because a Tabby_Pointed_Siamese “is-a” Siamese, which “is-a” Cat.

The subclasses should use the private instance variables in the base classes rather than creating duplicate instance variables in the subclasses as appropriate. HINT: Remember, public getter and setter methods in the base classes will be inherited in the extended classes. The extended class should only have instance variables for the attributes not stored in the super() class. At least 2 of the 3 extended classes should have a minimum of one additional instance method not found in the base class and unique to the subclass. The subclasses should implement or inherit the compareTo() method as appropriate. The nature of the comparison is up to you. Also, the extended classes should override the default toString() method to print specific information about the object using any of the instance variables available.

The user should be presented with a menu of options for output. The output for this project should include the information stored in both the instance variables in the super() classes and any instance variables in the subclasses as well as the result of the comparison using the compareTo() method.

Expected Output:

The expected output should contain the contents of the instance variables for the base classes and the extended classes. The output should also contain the result of the use of compareTo() and the overridden toString(). The output should include all of the data stored in the instance variables in a way that makes sense to the user based on the menu options presented to the user.

Java Requirements

The program must contain the Mammal interface, the abstract base classes of Cat, Dog and Rabbit that implement Mammal and the subclasses that extend from the base classes.

  • Have an interface called Mammal
  • The Mammal class should have at least 3 methods
  • There are at least 3 abstract classes extended from the Mammal class – Cat, Dog and Rabbit
  • The concrete animal classes extend from an abstract class
  • At least one concrete class extends from another concrete class
  • The abstract classes and concrete classes are created correctly – including private instance variables and the constructor
  • The abstract classes or concrete classes implement the Comparable<T> interface
  • The abstract classes or concrete classes implement have a compareTo() method
  • The subclasses use private instance variables correctly and have at least 5 attributes.
  • The tester class has a data structure that uses polymorphism to store objects
  • The output includes a menu allowing the user to print the information stored in the instance variables in the super class and the subclasses, as well as the result of the comparison using the compareTo() method as appropriate

Once you have it working as expected upload the .java file to this assignment drop box. You must also submit a Word doc or text file containing the Java code. Assignments not containing both the Java code and the text or Word file will be assigned a 0 for a grade.

Rubric

Criteria Ratings Pts

This criterion is linked to a Learning OutcomeMammal interface correctly created

10 pts

Full Marks

The Mammal class is an interface that has at least 3 abstract methods

5 pts

Partial Credit

The Mammal class is not an interface or it does not have at least 3 abstract methods

0 pts

No Marks

The Mammal class is not an interface and it does not have at least 3 abstract methods

10 pts

This criterion is linked to a Learning OutcomeThere are at least 3 abstract classes extended from the Mammal class – Cat, Dog and Rabbit

10 pts

Full Marks

There are 3 or more abstract classes extended from the Mammal class

5 pts

Partial Credit

There are at least 2 abstract classes extended from the Mammal class from the required abstract classes

0 pts

No Marks

There are 1 or no abstract classes extended from the Mammal class

10 pts

This criterion is linked to a Learning OutcomeThe concrete animal classes extend from an abstract class based on Mammal with one of the classes extended from a concrete class

10 pts

Full Marks

The concrete animal classes extend from an abstract class based on Mammal with one of the classes extended from a concrete class

5 pts

Partial Credit

The concrete animal classes extend from an abstract class based on Mammal or one of the classes extended from a concrete class

0 pts

No Marks

The concrete animal classes are not extended from an abstract class based on Mammal

10 pts

This criterion is linked to a Learning OutcomeThe abstract classes or concrete classes implement the Comparable<T> interface and they have a compareTo() method

10 pts

Full Marks

The abstract classes or concrete classes implement the Comparable<T> interface and they have a compareTo() method

5 pts

Partial Credit

The abstract classes or concrete classes do not implement the Comparable<T> interface or they do not have a compareTo() method

0 pts

No Marks

The abstract classes or concrete classes do not implement the Comparable<T> interface nor do they have a compareTo() method

10 pts

This criterion is linked to a Learning OutcomeThe subclasses use private instance variables correctly including appropriate constructor(s) and have at least 5 attributes

10 pts

Full Marks

The subclasses use private instance variables correctly including appropriate constructor(s) and have at least 5 attributes

5 pts

Partial Credit

The subclasses use private instance variables correctly including appropriate constructor(s) or the class has at least 5 attributes

0 pts

No Marks

The subclasses do not use private instance variables correctly nor is there an appropriate constructor and there is not at least 5 attributes

10 pts

This criterion is linked to a Learning OutcomeThe tester class has a data structure that uses polymorphism to store objects

10 pts

Full Marks

The tester class has a data structure that uses polymorphism to store objects

0 pts

No Marks

The tester class does not use a data structure that uses polymorphism to store objects

10 pts

This criterion is linked to a Learning OutcomeThe output includes a menu allowing the user to print the information stored in the instance variables in the super class and the subclasses, as well as the result of the comparison using the compareTo() method as appropriate

10 pts

Full Marks

The output includes a menu allowing the user to print the information stored in the instance variables in the super class and the subclasses, as well as the result of the comparison using the compareTo() method as appropriate

5 pts

Partial Credit

The output does not include a menu or it does not include the information stored in the instance variables in the super class and the subclasses nor does it include the result of the comparison using the compareTo() method

0 pts

No Marks

The output does not include a menu nor does it include the information stored in the instance variables in the super class and the subclasses nor does it include the result of the comparison using the compareTo() method

10 pts

This criterion is linked to a Learning OutcomeCode compiles and runs without errors

5 pts

Full Marks

Code compiles and runs without errors

0 pts

No Marks

Code does not compile and is automatically assigned 0 points for the overall grade

5 pts

This criterion is linked to a Learning OutcomeCode is properly commented

10 pts

Full Marks

Code is properly commented including all required header information

5 pts

Partial Credit

Code has some of the required comments but is sparsely commented or missing the correct header information

0 pts

No Marks

Code is sparsely commented or not commented at all and is missing all or most of the correct header information

10 pts

This criterion is linked to a Learning OutcomeProgram is properly designed and uses whitespace effectively

15 pts

Full Marks

Program is properly designed and uses whitespace effectively

8 pts

Partial Credit

Program is not properly designed or it does not use whitespace effectively

0 pts

No Marks

Program is not properly designed and it does not use whitespace effectively

15 pts

Total Points: 100

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now