Math Magic modification - user input for myNumber?


#1



https://www.codecademy.com/courses/learn-java/projects/math-magic


What is the best way to set myNumber equal to user input? This is my working code so far.


//prints 3 to the console

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

    int myNumber = 1;
    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);
	}
}


#2

Unclear what about this you're unable to find with a google search, please elaborate / please start by searching


#3

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