Last active
August 29, 2015 14:27
-
-
Save rosalindwills/8f99ac70df2b31ece53a to your computer and use it in GitHub Desktop.
3a -- two coupled C# classes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Adder { | |
public int AddTwoRandomNumbers() { | |
var generator = new RandomNumberGenerator(); | |
var firstInt = generator.Generate(); | |
var secondInt = generator.Generate(); | |
return firstInt + secondInt; | |
} | |
} | |
public class RandomNumberGenerator { | |
public int Generate() { | |
Random rnd = new Random(); | |
return rnd.Next(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment