Hi. I am having trouble understanding some simple concepts. I am frustrated.
I typed this simple code and it counts up by three's.
import acm.program.*;
public class Freespace extends ConsoleProgram {
private static final int MAX_COUNT = 300;
public void run() {
println("Count upwards by 3's");
for (int i = 0; i <= MAX_COUNT; i = i + 3) {
println(i);
}
}
}
I want to create a private method that does the counting for me and then returns it to the public method, but I am stuck.
I basically want the method to be called countThree and have the calculations and for loop done there. Please help. My textbook is vague on its example and Google results are always in a different library I dont know the syntax of yet.