Hello
I am having dificulty with this homework question ( I know its
homework but I have been trying for a while with this)
"generate 50 random numbers between 0 and 6 and count the number of
occurences of each value. IT should employ the DAyOfWeek enumeration,
where 0 represents Sunday....."
public class DayOfWeek {
enum Days {Sat, Sun, Mon, Tue, Wed, Thu, Fri};
int[] DayOfWeek = new int[7];
Random r = new Random();
for(int i = 0; i < 50; i++)
{
++DayOfWeek[r.Next(0,7)];
}
string output = null;
for(int ans=0; ans < 7; ans++)
output += DayOfWeek[ans] + "\n";
Console.WriteLine(output);
When I compile I am getting a lot of errors with the "++" , "<"
ect
Can Anyone help?
Thank
Rob
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com