title: How can I generate a random percentage between a defined range in C#?
body: <p>I'm brand new to C# and programming in general and I'm having trouble generating a random percentage from a defined range (i.e. between .5 and 1.0)</p>
  
  <p>I've had success with a generating random int variables, however, my code for random percentages is not working:</p>
  
  <pre><code>Random r = new Random();
  double percentage = r.Next(.5, 1.0);
  WriteLine(percentage);
  </code></pre>
  
  <p>I'm expecting an output between .5 and 1, but I'm getting the following errors:</p>
  
  <pre><code>Compilation error (line 9, col 23): The best overloaded method match for 'System.Random.Next(int, int)' has some invalid arguments
  Compilation error (line 9, col 30): Argument 1: cannot convert from 'double' to 'int'
  Compilation error (line 9, col 34): Argument 2: cannot convert from 'double' to 'int'
  </code></pre>
  
  <p>Line 9 is referring to the last line of code I provided where the percentage variable is written. Thanks in advance for any help!</p>