Encapsulate formulae

This commit is contained in:
Andrew Cooper
2022-04-16 17:00:06 +10:00
parent 6927c5ad14
commit 5fbf0dc37f
3 changed files with 38 additions and 16 deletions

18
25_Chief/csharp/Math.cs Normal file
View File

@@ -0,0 +1,18 @@
using static Chief.Resources.Resource;
namespace Chief;
public static class Math
{
public static float CalculateOriginal(float result) => (result + 1 - 5) * 5 / 8 * 5 - 3;
public static string ShowWorking(float value) =>
string.Format(
Formats.Working,
value,
value += 3,
value /= 5,
value *= 8,
value = value / 5 + 5,
value - 1);
}