
Thecount1
By:
ace on
May 5th, 2010 | syntax:
None | size: 1.20 KB | hits: 24 | expires: Never
import java.util.ArrayList;
/**
* Write a description of class TheCount here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class TheCount
{
// instance variables - replace the example below with your own
private ArrayList <String> counter;
/**
* Constructor for objects of class TheCount
*/
public TheCount()
{
// initialise instance variables
counter = new ArrayList<String>();
}
private void fillCount(int index, String count)
{
counter.add(0, "one");
counter.add(1, "two");
counter.add(2, "three");
counter.add(3, "four");
counter.add(4, "five");
counter.add(5, "six");
counter.add(6, "seven");
counter.add(7, "eight");
counter.add(8, "nine");
counter.add(9, "ten");
}
/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
public int tenTo10(String count)
{
while (return counter.indexOf(count) +1;
}
}