public void Main(string[] args)
for (int i = 0; i < 20; i++)
randval = (int)DateTime.Now.TimeOfDay.Ticks;
total += getRandom(randval);
calculate (ref avg, total);
Console.WriteLine("The average of the 20 random numbers is " + avg);
for (int i = 0; i < 5; i++)
Console.WriteLine("Enter a double value ");
myvalue = Convert.ToDouble(Console.ReadLine());
calculate(ref totalvalue, myvalue);
Console.WriteLine("The total is " + totalvalue);
static int getRandom(int seed)
Random myrandval = new Random(seed);
int randval = myrandval.Next(1, 100);
static void calculate (ref double avg, int randval)
static void calculate(ref double totalvalue, double myvalue)