Tech Off Post

Single Post Permalink

View Thread: C# dice Roller
  • User profile image

    Hi i need help, the program should be work to rolls two dice (add the number on each die for the total), throw the dice 10 times, and show the result for each throw including display the highest and lowest number. so far i've done this (below) i don't know how to show the result and highest and lowest..please help or either of you guys have a better solution? thanks a lot



    Static void main (String[] args)



    double raw;

    double big;

    double bigger;

    Int die;

    Random generator = new Random();


    Raw = generator. NextDouble();

    Console.WriteLine (“raw: {0}”, raw);


    big = raw * 6;

    Console.WriteLine (“bigger: {0}”, bigger);


    die = (int) big;

    Console.WriteLine(“die: {0}”, die);


    die = (int)(generator.NextDouble() * 6) + 1;

    Console.WriteLine(“another die: {0}”, die);




    Console.WriteLine(“please press enter key to quit”);


    }//end main