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
Padovan String Problem Description A Padovan string P(n) for a natural number n is defined as: P(0) = 'X' P(1) = 'Y' P(2) = 'Z' P(n) = P(n-2) + P(n-3), n

Special Matrices There are some "special" matrices out there which we may use on occasion. The square matrix is the first special matrix.  A square matrix is any matrix that s

Question: (a) Outline the six norms to be considered before designing a Web page. (b) Write a program such that when a user right-clicks anywhere on a Web page, the follow

Write a program that takes integer array of 8 elements from user and find the smallest element among them using pointers

Describe briefly how you might program a computer to exhibit fear or sorrow.

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

1. Write a function that converts a character array to a signed decimal integer. Function prototype must be as follows: int asciiToInt( char *str, unsigned char* eflag) YOU MAY NO

Assume that you are a college professor needing to average grades for 10 students. Write a program that asks for each student's name and grade. Print the list on-screen with each s

We need help for build a Price Quote Generator I am interested in two things (A) a web based system that will allow a user to enter the parameters of their contests (there are o

how much it will cost? i need learn how to make rightsided triangle in forloop