CS 117
Lab 7 - Random Numbers


In this lab we'll work with the random( ) function and you'll write your own non-instantiable class.

Time estimate: not long, an hour or so should suffice.

Due: By classtime Thur, 10/5. (If you've more pressing work and desire an extension, send me a request via e-mail.)

Collusion: You may work together on the lab; but for the ensuing homework you each should maintain and submit your own program. If you wish to share the results of your lab before starting on the homework, simply email the file to the partner whose account you are not in. S/he can retrieve it from the mail.

What's emphasized in this lab:

  • When you're finished:

    This is the end of the lab.

    Strictly Speaking. In Java, a non-instantiable class, i.e. one with only class variables and class methods can actually be instantiated. But, in my opinion, that's not good style. Thus, one could have

        Ran r = Ran();
        int pips = r.ranInt(1,6);
    
    but simply
        int pips = Ran.ranInt(1,6); 
    
    is preferable. More on style to come.