Question: I. Create a new class and name it as counter, and then use another given class (TestCounter) with a 150%! main method below for testing

 I. Create a new class and name it as counter, and

then use another given class (TestCounter) with a 150%! main method below

for testing it. Here are descriptions of all the members that you

I. Create a new class and name it as counter, and then use another given class (TestCounter) with a 150%! main method below for testing it. Here are descriptions of all the members that you will need to implement in the Counter class: Counter member descriptiorn State private int count public Counter () public void reset () public void inc ) public void dec () public int getCount public void printCount () public String toString () public boolean equals (Counter rhs) stores the count constructor which returns a new counter with a count of o resets the value of count to 0 increments the value of count by 1 decrements the value of count by 1, if possible returns the current value of count prints the current value of count, on a line by itself returns a string containing the value of count returns true if contents of this equals contents of rhs, otherwISe false Behaviour Now use the following TestCounter program for testing the Counter class above I/ TestCounter.java // Purpose: This program is designed to test the Counter.java class file to ensure it functions as intended public class TestCounter public static void main(String[ args) Counter counter = new Counter(); Counter counter2 = new Counter(); // These next two while loops will test the method for increasing // the counter value, the getCount method, and the printCount method // Output should be 15 and then 20 in the printCount format

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!