Hi! Im trying to do this class work for Comp Programming class! This is the assignment.

Using integer and modulus division, determine how a deck of 52 cards can be represented by randomly generating 52 numbers(1 to 52). Each Number should have a value and a suit ( Ex: 4 0f clubs).

I have no idea what to do. This is all i have so far

Dim Num as Integer
Dim rand as new random
Num = Rand.next(1,52)

Please help!!

Recommended Answers

All 2 Replies

It goes against the rules of this site for me to give you the answer to your assignment. However this might help:

  • Make sure that 52 unique numbers are chosen
  • Use arrays for the string values representing the suits and the card values
  • the randomly chosen number modulus 4 is the index of the suit array
  • the randomly chosen number modulus 13 is the index of the card values.

If all this is beyond you, you'll probably have to review your instruction materials and/or find some tutorials online.

sorry i did not know about that rule!

And thanks for the tips!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.