Problem 10/13 - My code has executed but codeacademy does not let me move on. Please Help


#1

There are no errors. The code has executed properly giving me the expected result. Yet, it does not move on. PLEASE HELP!!!

class Dog {
  
  int age;

	public Dog(int dogsAge) {
    
  	age = dogsAge;
    
  }
  
  public void bark() {
		
    System.out.println("Woof!");
    
	}
  
  public void run(int feet) {
    System.out.println("Your dog ran " + feet + " feet");
  }

	public static void main(String[] args) {
    
    Dog spike = new Dog(5);
    spike.bark();
    spike.run(40);

	}

}

#2

System.out.println("Your dog ran " + feet + " feet");

here you missed a ! at the end


#3

class Dog {

int age;

public Dog(int dogsAge) {
age = dogsAge;

}

public void bark() {

System.out.println("Woof!");

}

public void run(int feet) {

System.out.println("Your dog ran " + feet + " feet!");

}

public static void main(String[] args) {

Dog spike = new Dog(5);
spike.bark();
spike.run(40);

}

}

Could any of you tell what's the problem with the code?


#4

I am having the same issue. I even choose the option "get code" but it is still not letting me proceed!


#5

please create a new topic and post your code.tell us what's your problem?what did you try?where did you get stuck?
so we can help you better :slight_smile:

go to this link
click on +New Topic
create your topic


#6

What you have done is worked ahead of the exercise, complete it step by step rather than rushing the head.
I tested this by going ahead first and failing the exercise but when I did it step by step it accepted the code.

public void run() {
     }

Tada!


#7

what you have to do is to make sure your code format is ok? it means,you should make your code like this:

  public void run() {

  }

only one blank line before the codes and after the codes, and do not forget the two spaces before in the code lines

just let the first test go through,then do the others


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.