Results 1 to 4 of 4
Thread: Need helps making counter
- 11-26-2008, 08:51 AM #1
Need helps making counter
I need to create a new class named Counter which represents a positive value that may range from zero to some maximum and when incremented past the maximum, reverts to zero. Provide a string representation that shows leading zeros. Test your design with the JUnit test provided.
and have to use these:
increment() method works (“rolls over” to 0)
decrement() method works (“rolls over to max)
setValue() method works as specified
toString() method works as specified
I don't know how to do it :[ I'm stuck doing other projects but missing a lot so failing,,, Please please please help meee :[ :(
I attached the files in a .zip
- 11-26-2008, 02:16 PM #2
I don't understand,you don't know how to do that,but you know how to make JUnit test case,as i saw in the zip file.How can it be?
- 11-26-2008, 02:16 PM #3
Should you create the class according to the TestCase class?
- 11-27-2008, 12:58 AM #4Java Code:
public class Counter { int counter=0; int limit; public Counter(int max) { limit = max; } boolean checkMax(){ if( counter > max) counter =0; }
What are you missing? Where did you get code telling you to format with leading zeros if you are missing too mucy?
If you are this far behind and being assigned code to do decimal formatting your are basically toe-on at the last edge of oblivion, better ask for your old job back flippin burgers or ( based on your avatar ) jockeying vinyl.Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
Similar Threads
-
Frequency Counter
By justlearning in forum New To JavaReplies: 0Last Post: 05-07-2008, 11:50 PM -
[SOLVED] BST Frequency Counter
By theonly in forum Advanced JavaReplies: 7Last Post: 04-30-2008, 12:33 AM -
Making triangle
By banie in forum New To JavaReplies: 4Last Post: 02-02-2008, 12:23 PM -
Help with making this algorithm better
By RLRExtra in forum New To JavaReplies: 6Last Post: 01-17-2008, 05:11 PM -
Help with static variable counter
By silvia in forum New To JavaReplies: 1Last Post: 07-19-2007, 08:53 PM
Bookmarks