Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static int High = 1023;
- public static int Low = 126;
- public static float ComputeRain(float raw) => Math.Max(0, ((raw-Low)/(High-Low) * 100));
- public static int Compute(int raw) => (int)Math.Round(ComputeRain(raw));
- public static void Main()
- {
- Console.WriteLine(Compute(1023));
- Console.WriteLine(Compute(500));
- Console.WriteLine(Compute(133));
- Console.WriteLine(Compute(0));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement