You can download the example solutions to see additional details and to experiment with the programs at https://github.com/PacktPublishing/The-Modern-CSharp-Challenge/tree/master/Chapter04.
Solutions
49. Random doubles
The following NextDouble extension method uses the Random class's existing NextDouble method to generate a double value within a range:
public static class RandomExtensions
{
// A Random objects shared by all extensions.
private static Random Rand = new Random();
// Return a double between minValue and maxValue.
public static double NextDouble(this Random rand,
double minValue, double maxValue)
{
return minValue + Rand.NextDouble() * (maxValue - minValue);
...