File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Random cards Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Random cards" Watch "Random cards" New topic

Random cards

Paul Hambleton

Joined: Jul 23, 2012
Posts: 2

I have a very basic understanding of java and have been asked to write a simple program to generate 6 random playing cards cards and print out what they are? I am not sure how i should approach this, could i get some advice please as i have no clue where to start.

Thanks in advance.
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

Hi Paul,

Welcome to the Ranch!

We encourage community members to SearchFirst (<--click) then come back with specific questions. You might try to google for "shuffle and deal cards in java".

Junilu - [How to Ask Questions] [How to Answer Questions]
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

A basic programming rule is to break your requirements down into smaller parts, and implement each of the parts separately as far as possible.

Now, in your case your requirements contain the word "and" right in the middle. This suggests an obvious division of the requirements into two parts. So, now you have two smaller tasks. Pick one and get started on it.
Paul Hambleton

Joined: Jul 23, 2012
Posts: 2
Thank you for your advice thus far, appreciate your time.
I agree. Here's the link:
subject: Random cards
It's not a secret anymore!