Interview Question
- 0of 0 votes
AnswersPlease make analysis of RandomNumber1 and RandomNumber2 methods
- i-sokrat November 17, 2016 in United States
Result: values returned by methods, description of differences in behavior.
using System;
using static System.Math;
namespace Program
{
public class Analysis
{
public double RandomNumber1()
{
Random random = new Random();
return Round((random.NextDouble() - 0.5) * 2.00);
}
public double RandomNumber2()
{
Random random = new Random();
return Round((random.NextDouble() - 0.5) * 2.99);
}
}
}| Report Duplicate | Flag | PURGE
Coding
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.