You have been given a broken function CalculateMagic(...)
. Your task is to write some code, and fix it.
To get the magic number, you must:
- Do A + B + B
- Add 90 to previous answer.
- Divide previous answer by 10.
- If the previous answer is a multiple of 5, subtract 8. Otherwise add 9
- Take the previous number and square it
- Divide the previous answer by 3 (lets call the answer G)
- return the result of calling roundUp(G);