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

Assignment Help:
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.

Related Discussions:- Project 8-1: count alligators and clone sheep, computer programming

Java project, NOTE: You will only submit the University.java and EmptyFileE...

NOTE: You will only submit the University.java and EmptyFileException.java files (inside P3.zip/tar) NOTE on null objects:. From Project 1: Since the array of students in the Cou

Microsoft''s vc++, Microsoft's VC++ Windows V C++ was a highly effectiv...

Microsoft's VC++ Windows V C++ was a highly effective device. But it was too complicated. It has too many information kinds, and designers had to understand many your local lib

Explain the do - while statement - computer programming, Explain the Do - W...

Explain the Do - While Statement - Computer Programming? A do - while loop is an exit controlled loop and the body of the loop gets executed at least once if the condition is n

JUnit test, hi, can you help me with testing java classes I have wrote usin...

hi, can you help me with testing java classes I have wrote using java and jsp and servlet in eclipse ? I want to use JUnit for testing

Use an insertion sort to sort an array, Use an insertion sort to sort an ar...

Use an insertion sort to sort an array (sequence) of long word integers. The size of the list will appear just before the list itself. Use the same labels as in this example: LE

Controlling stepper motor through rtlinux, In this project, we have measure...

In this project, we have measured and compared the performance given by RTLinux, which is real time system with non-real time Linux operating system. Also, we have measured the

Game, How to make game in pascal language

How to make game in pascal language

Matrices and vectors, This section is proposed to be a catch all for severa...

This section is proposed to be a catch all for several of the fundamental concepts which are used occasionally in working with systems of differential equations. There will not be

Application in pascal language for free pascal compiler , Before I describ...

Before I describe what you are supposed to do, please remember that this programming assignment is NOT a group project. You are NOT allowed to do this with anyone else's help. This

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd