vendredi 2 janvier 2015

C# Random number and average

I need some help with an assignment for school. I'm new at programming and I've been trying t figure this out all day but I just can't make it work. So now I feel I need some help.


This is the assignment:


The following code will generate a random number between 1 and 9. Write a program that randomly selects integers whose values range from 0 to 9. The program will calculate the average of the random numbers and print how many of the random numbers are larger than the average. The program's user will specify how many numbers will be randomly generated.




I've started like this;



using System;
class RandomAvrg
{
static void Main()
{
Random rnd = new Random();
int num = rnd.Next(0,10);


If someone out there wants so help, I would be very grateful.


Thanks in advance!





Aucun commentaire:

Enregistrer un commentaire