Project 8-1: count alligators and clone sheep, computer programming, Programming Languages

Operation
• This application uses an Alligator class that implements a Countable interface to
display Alligator objects as shown above.
• This application uses a Sheep class that implements a Countable interface and the
Cloneable interface to display and clone Sheep objects as shown above.
Specifications
• Create an interface named Countable that can be used to count an object. This
interface should include these methods:
void incrementCount()
void resetCount()
int getCount()
String getCountString()
• Create a class named Alligator that implements the Countable interface. This class
should include an instance variable that stores the count and a method that returns the
formatted count.
• Create a class named CountUtil. This class should include a static method that lets
you count any Countable objects a specified number of times. For example:
public static void count(Countable c, int maxCount)
• Create a class named CountTestApp that uses the CountUtil class to count an
Alligator object 3 times as shown above.
• Create a class named Sheep that implements the Countable and Cloneable interfaces.
This class should include an instance variable that stores the count and the name of
the sheep, and it should provide methods that can set and get the name of the sheep.
• Modify the CountTestApp class so it (a) counts the first sheep 2 times, (b) clones the
first sheep, changes the name, and counts it 3 times, and (c) counts the first sheep
again 1 time.
Posted Date: 2/25/2012 9:59:21 PM | Location : United States







Related Discussions:- Project 8-1: count alligators and clone sheep, computer programming, Assignment Help, Ask Question on Project 8-1: count alligators and clone sheep, computer programming, Get Answer, Expert's Help, Project 8-1: count alligators and clone sheep, computer programming Discussions

Write discussion on Project 8-1: count alligators and clone sheep, computer programming
Your posts are moderated
Related Questions
Triple Eigenvalue with 1 Eigenvector The eigenvalue/vector pair in this case are l and  ?h , . Since the eigenvalue is real we know as the first solution we require is, e l

PLEASE HELP ME ORACLE PROGRAMING TRIGGER

Write a script called 'prob3.m' that does the same thing as the previous question except that it makes use of a switch-case construct instead of an if-else. In the file 'hw4.m'

Assigment 01 Subject Code: ITE 2106 Subject Name: Software Engineering You run a software development organization catering to external clients to build software solutions. The bus

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

How to create an ER diagram?

how to get horizontal motion vectors field with quiver ?

The Maze Game from Laboratory 7 loads its maze directly in the program's code. This should be avoided as it requires the program to be recreated if the maze needs to be changed. In

Expertsmind brings you unique solution in java assignments Reflection API Uses of Reflection with java assignment help Reflection is widely used by applications which

Question: (a)  An HTML file "decor.html" uses an external Cascading Style Sheet file name  "nicedesign.css". Users are viewing the Web page making use of different kinds of  br