New Year Special - 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ac75sure

You work as a Software Developer for ManSoft Inc.

You work as a Software Developer for ManSoft Inc. The company uses Visual Studio .NET as its application development platform. You create an application named MyRandomGen. You use the System.Security.Cryptography namespace. You want to create a code that randomly rolls the dice fifty times and displays the results on the screen. Which of the following code segments will you use to accomplish this task?

A.

for(int x = 0; x <= 50; x++)

Console.WriteLine(RollTheDice(6));

public static int RollTheDice(int sides)

{

byte[] random = new byte[1];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider();

Gen.GetBytes(random);

int ran = Convert.ToInt32(random[0]);

return ran % sides + 1;

}

B.

for(int x = 0; x <= 50; x++)

Console.WriteLine(RollTheDice(6));

public static int RollTheDice(int sides)

{

byte[] random = new byte[1];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider();

Gen.GetRandom(random);

int ran = Convert.ToInt32(random[0]);

return ran % sides + 1;

}

C.

for(int x = 0; x <= 50; x++)

Console.WriteLine(RollTheDice(6));

public static int RollTheDice(int sides)

{

byte[] random = new byte[1];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider();

Gen.GetBytes(Gen);

int ran = Convert.ToInt32(random[0]);

return ran % sides + 1;

}

D.

for(int x = 0; x <= 50; x++)

Console.WriteLine(RollTheDice(6));

public static int RollTheDice(int sides)

{

byte[] random = new byte[1];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider();

Gen.RandomNumber(random);

int ran = Convert.ToInt32(random[0]);

return ran % sides + 1;

}

GSSP-.NET PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now GSSP-.NET pdf
Get 75% Discount on All Products, Use Coupon: "ac75sure"