Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am working on a java project called turtles and I am having trouble trying to

ID: 3790426 • Letter: I

Question

I am working on a java project called turtles and I am having trouble trying to figure out how to call a method once I create it. My program has a menu, but when i select from the menu which method I want to run it doesn't work. In my draw method I just told the turtle to move forward, but it doesn't do that. If i write the code in the main it will work, but I need to call on the method for it to work.

Ex: public static void drawName(Turtle t) { t.forwad(pixels: 90);

my main is: public static void main(String[] args) { EndWorld W = new EndWorld(); AnimatedTurtle t = new AnimatedTurtle(W); String choice = menu(); System.out.println(choice);

Explanation / Answer

I don't know what you wrote in the program.As you gave the main method in the example. So , at this point the only possible reason is what I can say is the instance of class with which you are calling are different or you accidently forgot using the instance of the class

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote