SHARE
TWEET

Untitled

a guest Jun 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static int High = 1023;
  6.     public static int Low = 126;
  7.     public static float ComputeRain(float raw) => Math.Max(0, ((raw-Low)/(High-Low) * 100));
  8.     public static int Compute(int raw) => (int)Math.Round(ComputeRain(raw));
  9.     public static void Main()
  10.     {
  11.         Console.WriteLine(Compute(1023));
  12.         Console.WriteLine(Compute(500));
  13.         Console.WriteLine(Compute(133));
  14.         Console.WriteLine(Compute(0));
  15.     }
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top