Skip to content

Instructions: In this project, you will become a mathemagician and write a small program that performs a mathematical magic trick! It will involve performing arithmetic operations on an integer that you choose. The instructions provided are general guidelines. Upon completion of the project, feel free to explore the code on your own.

Notifications You must be signed in to change notification settings

fabianzelaya/Math-Magic_Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Math Magic

Instructions: In this project, you will become a mathemagician and write a small program that performs a mathematical magic trick! It will involve performing arithmetic operations on an integer that you choose. The instructions provided are general guidelines. Upon completion of the project, feel free to explore the code on your own.

public class Magic {
  public static void main (String[], arg) {
    int myNumber = 15;
    
    // We will refer to myNumber as the original number from now on.
    
    int stepOne = (myNumber) * (myNumber);
    int stepTwo = (stepTwo) + myNumber;
    int stepThree = (stepTwo) / myNumber;
    int stepFour = (stepThree) + 17;
    int stepFive = (stepFour) - myNumber;
    int stepSix = (stepFive) / 6;
    
    System.out.println(stepFive);
  }
}
// FZ

// Sample output: 18

Thanks for watching!

If you liked my coding then follow me on my Instagram account or GitHub account.

About

Instructions: In this project, you will become a mathemagician and write a small program that performs a mathematical magic trick! It will involve performing arithmetic operations on an integer that you choose. The instructions provided are general guidelines. Upon completion of the project, feel free to explore the code on your own.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published