aspose file tools*
The moose likes Java in General and the fly likes Please help me with the logic of the code! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Please help me with the logic of the code!" Watch "Please help me with the logic of the code!" New topic
Author

Please help me with the logic of the code!

Jacob Sonia
Ranch Hand

Joined: Jun 28, 2009
Posts: 174
I have designed a coin Flipping program as follows:


But i want to design it using Enums but i am not getting exactly how to do it. This is my start






Please guide me if we can shuffle the enum values only and get the result to be the enum fields.


[HENRY: Formatted code]
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Jacob:

It would be easier to help you if you formatted your code to be easier to read.

John.
Jacob Sonia
Ranch Hand

Joined: Jun 28, 2009
Posts: 174


Here is the code with no enums but i want to do it with enums
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
I believe your enum looks fine.


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Jacob Sonia
Ranch Hand

Joined: Jun 28, 2009
Posts: 174


This is what i have done but i want to know that instead of putting so much logic, is there a way that i can just shuffle between the enum fields, i mean i can shuffle between HEAD and TAIL
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please help me with the logic of the code!