Download or clone the C# project Numerology.
This project contains a class called MysticNumbers, with a single method ThreeNumbers. All that is known about ThreeNumbers is that it takes three integers as input, and returns one of them
-
By reading the code for ThreeNumbers, try to figure out what it does. Write some test code to see if you are right.
-
Write and test a new method TwoNumbers, that does the same thing as ThreeNumbers, but now only for two numbers.
-
Write and test a new method FourNumbers, that does the same thing as ThreeNumbers, but now for four numbers (tip – you can probably use the method TwoNumbers to make the code fairly short and easy).
-
Rewrite ThreeNumbers to use the TwoNumbers method. What code do you like best – the original code or the new code?