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
Describe briefly how you might program a computer to exhibit fear or sorrow.

BACKGROUND: This assignment illustrates the power of mobile applications. OBJECTIVES: 1. Mobile applications DESCRIBED TASK: This is a single part assignment.

Windows Presentation Foundation Designed by Microsoft Technologies, the Microsoft Technologies windows Display Groundwork (or WPF) is a computer-software graphic subsystem for maki

How do i get back data from a FOR loop in order to print them on screen?

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

After studying the concept, terminology, and implementation of CSS stylesheets, create a stylesheet to accompany your solutions to Question 1. A rich collection of styles should be

On a single XHTML page, include the following two div container elements in the body. Using an external stylesheet, add style to the div elements such that one div has some overlap

Define Call by value - Computer Programming? Functions are raise by writing their name and an appropriate list of arguments within parenthesis. Usually these arguments are in t

Matlab Assignment # For each of the three datasets (data1.txt, data2.txt, and data3.txt in bnhw2q2.zip), cluster the data using k-means in Matlab, with k=2, 3, 4 and 5 using the pr

I need help with some simple matlab statements