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
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

how do i make a bomber game using pascal on a software called lazuras

Genetic Diseases Problem Description Many human diseases could be controlled by the knowledge of the gene's structure and pattern. The human gene could be represented by fou

Eclipse Jsp Project. I am making a a project on my website and i was making a help support page on which the user can submit their question and the question is saved to a text file

1. Write a bash shell script which searches through your folders for files with the extension *.tex, and then interactively deletes the corresponding *.aux, *.dvi and *.log files (

What are the main pros and cons of assembly programming language?

In this assignment, you will design a program to perform the following task: Calculate the total price to purchase all the components required to build a state-of-the-art gaming c

I need a program that writes the first column of the matrix. The numbers in this column follow the pattern below: 1. Numbers start at 1 and count up to ''nels'' in increments of

Write a function called withdraw (in the file 'withdraw.m') that simulates withdrawing money from a bank account. The function takes a single input argument, a positive scaler doub

I have a linux lab class that consist of 1 lab assignment per week for 5 weeks. It is an online virtual lab and is fairly easy, I just don''t have the time.