Question: Please help. In java for. Write a program that does some magic math. Here are the steps you need to take / follow. First, define
Please help. In java for.
Write a program that does some "magic" math. Here are the steps you need to take / follow. First, define an integer variable and assign it any value of your choice. Then you'll need to perform the following operations with it: 1. Add 9 2. Multiply by 2 3. Subtract 4 4. Divide by 2 5. Subtract by the variable's original value 6. Finally, display what the end result is. 7. Once your math / code is complete, double check your work by seeing what happens with the end result when you use different starting values. You should notice something "interesting". . Requirements: 1. Write a comment in your source code (NOT on the Canvas submission comments section) briefly describing the "magic" math / result. 2. Your program's output MUST display more than just a single number (for example, as seen in image on last page). More specifically, you'll need to convey what it is your program is doing to your "audience". No need to go overboard on the presentation, at the very least describe what your result is AND how it came to be. IMPORTANT: DO NOT copy my sample output / format below or else you will be penalized. 3. DO NOT ask the user for any input, what-so-ever. 4. So long as the requirements above are met, you can go about solving this problem using whatever expression(s) you like. Just try not to over complicate things as I expect most students' final solution to be approximately 5 to 10 lines long (not counting the skeleton code). TIP: The final magic math result is NOT zero. Double-check your work to make sure you followed the operations exactly as described. Try the doing the math on paper before you code. TIP: Be careful of the math operation in step 5, when I grade / test your code by changing the integer variable's initialized value with other numbers, this operation must ALWAYS reference the correct original value ever time the program runs no matter what the starting value is. Think about what you can do to avoid / bypass hardcoding the operand's value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
