Always a 3 and not myNumber :(

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-java/projects/math-magic

<In what way does your code behave incorrectly? Include ALL error messages.>
I’ve cleaned up my error messages, but I am always getting the number 3 as my answer no matter what number I put as myNumber. What am I missing? thanks!

```

public class Magic {
public static void main(String args) {

int myNumber = 10;
int stepOne = myNumber * myNumber;
int stepTwo = stepOne + myNumber;
int stepThree = stepTwo / myNumber;
int stepFour = stepThree + 17;
int stepFive = stepFour - myNumber;
int stepSix = stepFive / 6;

System.out.println(stepSix);

<do not remove the three backticks above>

Nothing is wrong with your code, provided that you have the necessary closing curly braces at the end.

Instruction 8 states …

Finally, use System.out.println(stepSix) to print out the value of the last step. What number prints to the console? This number will be printed to the console no matter what integer you choose as the original number!

Thanks: so my problem is not reading right to the end. ha! :blush:

1 Like

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