Sherry Henkel

Sherry Henkel

  • NA
  • 1
  • 2.3k

I am learning C# and I have some code that I am generating a random numbers, however, I need to convert some of the random numbers from Integer to a String. Can someone help me with that??

May 8 2011 2:59 AM
I am learning C# and I have some code that I am generating a random numbers, however, I need to convert some of the random numbers from Integer to a String. Can someone help me with that??


public static string GetRandomNumber()
{
Random random = new Random();
return random.Next (2, 15);
}

public static int DisplayCard()
{
int card = " ";

if (card = 14)
card = "Ace";

if (card = 13)
card = "King";

if (card = 12)
card = "Queen";

if (card = 11)
card = "Jack";

Answers (2)