Always a 3 and not myNumber :(


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;


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:


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