Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 7 Online
OpenStudy (anonymous):

How can i make the tossing random? Write a Java program that simulates tossing a coin repeatedly until the last, say nth, coin’s face value is same as the (n-1)th value and also same as (n-2)th value. The simulation class should write each face value to screen. When the last three face values are the same, it should write the number of elements in the coin tossing series. Make sure that your solution has Coin Class and this class contains toss, isEqualTo, toString methods as well as other necessary methods

OpenStudy (anonymous):

http://download.oracle.com/javase/1,5,0/docs/api/java/util/Random.html generate random integers - if it is even it is heads if it is odd it is tails?

OpenStudy (anonymous):

Thx=)

OpenStudy (carlsmith):

Or just generate a random number between 0 and 1, inclusive.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!