Last active
July 30, 2024 19:43
Revisions
-
csim revised this gist
Jul 30, 2024 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ using System; public class Program @@ -15,21 +13,29 @@ public static void Main() Console.WriteLine(ex.Message); } Console.WriteLine(DoSomething()); } public static int DoSomething() { try { throw new ApplicationException("Exception 2"); } catch (ApplicationException) { Console.WriteLine("ApplicationException 2"); return 1; } catch (Exception ex) { Console.WriteLine(ex.Message); return 2; } finally { Console.WriteLine("Finally"); } } } -
Clint Simon revised this gist
Aug 31, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Write a function in any language (preferable C#) which computes the angle between the hand hands of a clock given a time of day. The function must work for all combinations of hour and minute. inputs: int hour, int minute<br/> output: float angle (in degrees) @@ -15,9 +15,9 @@ At 3:00 PM, the angle is 90 degrees At 3:45 PM, the angle is 180 degrees ---------.----- -
Clint Simon revised this gist
Aug 27, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ public class Program public static void Main() { var printers = new List<Action>(); var i = 0; for (i = 0; i < 10; i++) { -
Clint Simon revised this gist
Aug 27, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,9 @@ public class Program public static void Main() { var printers = new List<Action>(); int i = 0; for (i = 0; i < 10; i++) { printers.Add(() => Console.WriteLine(i)); } -
Clint Simon revised this gist
Aug 27, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public static void Main() { throw new ApplicationException("Exception 2"); } catch (ApplicationException) { Console.WriteLine("ApplicationException 2"); } -
Clint Simon revised this gist
Aug 27, 2020 . No changes.There are no files selected for viewing
-
Clint Simon revised this gist
Aug 27, 2020 . 8 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes. -
Clint Simon revised this gist
Aug 26, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Write a function in any language (preferable C#) which computes the angle between hand hands of a clock given a time of day. The function must work for all combinations of hour and minute. inputs: int hour, int minute<br/> output: float angle (in degrees) For Example: -
Clint Simon revised this gist
Aug 24, 2020 . 1 changed file with 0 additions and 26 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,26 +0,0 @@ -
Clint Simon revised this gist
Aug 24, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ At 3:00 PM, the angle is 90 degrees .----- At 3:45 PM, the angle is 180 degrees ---------.----- -
Clint Simon revised this gist
Aug 24, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Write a function in any language (preferable C#) which computes the angle between hand hands of a clock given a time of day. The function must work for all combinations of hour and minute. inputs: hour and minute output: angle (in degrees) -
Clint Simon revised this gist
Aug 24, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ At 3:00 PM, the angle is 90 degrees At 9:45 PM, the angle is 180 degrees ---------.----- -
Clint Simon revised this gist
Aug 24, 2020 . 2 changed files with 23 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ Write a function in any language (preferable C#) which computes the angle between hand hands of a clock given a time of day. inputs: hour and minute output: angle (in degrees) For Example: At 3:00 PM, the angle is 90 degrees | | | .----- At 9:45 PM, the angle is 180 degrees ---------.----- 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +0,0 @@ -
Clint Simon revised this gist
Aug 24, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,4 +7,4 @@ For Example: At 3:00 PM,  -
Clint Simon renamed this gist
Aug 24, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Clint Simon revised this gist
Aug 24, 2020 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ Write a function in any language (preferable C#) which computes the angle between hand hands of a clock given a time of day. inputs: hour and minute output: angle (in degrees) For Example: At 3:00 PM, ![][https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.iconfinder.com%2Ficons%2F3903655%2F3am_3pm_clock_icon&psig=AOvVaw16EDfASipAOrSL34JhJELl&ust=1598377259120000&source=images&cd=vfe&ved=0CAIQjRxqFwoTCIjH-baxtOsCFQAAAAAdAAAAABAD] -
Clint Simon revised this gist
Aug 24, 2020 . 6 changed files with 109 additions and 83 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ using System.Linq; public class Program { public static void Main() { int[] numbers = { 30, 325, 18, 92, 100, 42, 72 }; // Use linq to find which numbers are evenly divisible by 5. } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,22 @@ // What is the output of the program below? Explain your answer. using System; using System.Collections.Generic; public class Program { public static void Main() { var printers = new List<Action>(); for (int i = 0; i < 10; i++) { printers.Add(() => Console.WriteLine(i)); } foreach (var printer in printers) { printer(); } } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,22 +1,24 @@ // What is the output of the program below? Explain your answer. using System; using System.Threading.Tasks; public class Program { private static string _result = "Nothing"; public static void Main() { SaySomethingAsync(); Console.WriteLine(_result); } public static async Task<string> SaySomethingAsync() { await Task.Delay(5); _result = "Something"; return "SaySomething exited"; } } // Also, would the answer change if we were to replace await Task.Delay(5); with Thread.Sleep(5)? Why or why not? 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 charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,33 @@ // What is the output of the short program below? Explain your answer. using System; public class Person { public string Name { get; set; } } public class Program { public static void Main(string[] args) { var joe = new Person(); joe.Name = "Joe"; var tim = joe; tim.Name = "tim"; Console.WriteLine(joe.Name); Console.WriteLine(tim.Name); var myNumber = 666; DoSomething(myNumber); Console.WriteLine(myNumber); } private static void DoSomething(int someNumber) { someNumber = 777; } } 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 charactersOriginal file line number Diff line number Diff line change @@ -2,32 +2,34 @@ using System; public class Program { public static void Main() { try { throw new Exception("Exception 1"); } catch (Exception ex) { Console.WriteLine(ex.Message); } try { throw new ApplicationException("Exception 2"); } catch (ApplicationException ex) { Console.WriteLine("ApplicationException 2"); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { Console.WriteLine("Finally"); } } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,35 +1,26 @@ using System; public class Program { public static void Main() { var circle1 = new Circle { Radius = 1 }; // Given an instance of the Circle class // Write code to calculate the circumference of the circle (2 * pi * r) // without modifying the Circle class itself. } } public sealed class Circle { public double Radius { get; set; } public double Calculate(Func<double, double> operation) { return operation(Radius); } } -
Clint Simon revised this gist
Aug 20, 2020 . 2 changed files with 4 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ public class Program public static void Main() { Console.WriteLine(location == null ? "location is null" : location); Console.WriteLine(time == DateTime.MinValue ? "time is MinValue" : time.ToString()); } } 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 charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,8 @@ public class Program { public static void Main() { int[] numbers = { 30, 325, 18, 92, 100, 42, 72 }; // Use linq to find which numbers are evenly divisible by 5. } } -
Clint Simon revised this gist
Aug 20, 2020 . 6 changed files with 105 additions and 105 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,26 +1,11 @@ using System.Linq; public class Program { public static void Main() { int[] numbers = { 30, 325, 18, 92, 100, 42, 72 }; // Use linq to find which numbers are evenly divisible by 5. } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,22 @@ // What is the output of the program below? Explain your answer. using System; using System.Collections.Generic; public class Program { public static void Main() { var printers = new List<Action>(); for (int i = 0; i < 10; i++) { printers.Add(() => Console.WriteLine(i)); } foreach (var printer in printers) { printer(); } } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,22 +1,24 @@ // What is the output of the program below? Explain your answer. using System; using System.Threading.Tasks; public class Program { private static string _result = "Nothing"; public static void Main() { SaySomethingAsync(); Console.WriteLine(_result); } public static async Task<string> SaySomethingAsync() { await Task.Delay(5); _result = "Something"; return "SaySomething exited"; } } // Also, would the answer change if we were to replace await Task.Delay(5); with Thread.Sleep(5)? Why or why not? 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,33 @@ // What is the output of the short program below? Explain your answer. using System; public class Person { public string Name { get; set; } } public class Program { public static void Main(string[] args) { var joe = new Person(); joe.Name = "Joe"; var tim = joe; tim.Name = "tim"; Console.WriteLine(joe.Name); Console.WriteLine(tim.Name); var myNumber = 666; DoSomething(myNumber); Console.WriteLine(myNumber); } private static void DoSomething(int someNumber) { someNumber = 777; } } 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 charactersOriginal file line number Diff line number Diff line change @@ -2,32 +2,34 @@ using System; public class Program { public static void Main() { try { throw new Exception("Exception 1"); } catch (Exception ex) { Console.WriteLine(ex.Message); } try { throw new ApplicationException("Exception 2"); } catch (ApplicationException ex) { Console.WriteLine("ApplicationException 2"); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { Console.WriteLine("Finally"); } } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,35 +1,26 @@ using System; public class Program { public static void Main() { var circle1 = new Circle { Radius = 1 }; // Given an instance of the Circle class // Write code to calculate the circumference of the circle (2 * pi * r) // without modifying the Circle class itself. } } public sealed class Circle { public double Radius { get; set; } public double Calculate(Func<double, double> operation) { return operation(Radius); } } -
Clint Simon revised this gist
Aug 19, 2020 . No changes.There are no files selected for viewing
-
Clint Simon revised this gist
Aug 19, 2020 . No changes.There are no files selected for viewing
-
Clint Simon revised this gist
Aug 19, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -19,8 +19,8 @@ public sealed class Circle { public double Radius { get; set; } public double Calculate(Func<double, double> operation) { return operation(Radius); } } -
Clint Simon revised this gist
Aug 19, 2020 . 5 changed files with 18 additions and 14 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,15 @@ using System; public class Program { static string location = default(string); static DateTime time = default(DateTime); public static void Main() { Console.WriteLine(location == null ? "location is null" : location); Console.WriteLine(time == DateTime.MinValue ? "time is null" : time.ToString()); } } // What is the output of the short program below? Explain your answer. 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 charactersOriginal file line number Diff line number Diff line change @@ -19,4 +19,4 @@ public static void Main() printer(); } } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,11 @@ using System.Linq; public class Program { public static void Main() { int[] numbers = { 30, 325, 18, 92, 100, 42, 72 }; // Use linq to find which numbers are evenly divisible by 5. } } 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 charactersOriginal file line number Diff line number Diff line change @@ -30,4 +30,4 @@ private static void DoSomething(int someNumber) { someNumber = 777; } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ // What is the output of the short program below? Explain your answer. using System; public class Program @@ -31,4 +32,4 @@ public static void Main() Console.WriteLine("Finally"); } } } -
Clint Simon revised this gist
Aug 19, 2020 . 6 changed files with 107 additions and 72 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,15 @@ // What is the output of the short program below? Explain your answer. using System; class Program { static string location = default(string); static DateTime time = default(DateTime); static void Main() { Console.WriteLine(location == null ? "location is null" : location); Console.WriteLine(time == DateTime.MinValue ? "time is null" : time.ToString()); } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,26 @@ using System; public class Program { public static void Main() { var circle1 = new Circle { Radius = 1 }; // Given an instance of the Circle class // Write code to calculate the circumference of the circle (2 * pi * r) // without modifying the Circle class itself. } } public sealed class Circle { public double Radius { get; set; } public double Calculate(Func<double, double> op) { return op(Radius); } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,24 @@ // What is the output of the program below? Explain your answer. using System; using System.Threading.Tasks; public class Program { private static string _result = "Nothing"; public static void Main() { SaySomethingAsync(); Console.WriteLine(_result); } public static async Task<string> SaySomethingAsync() { await Task.Delay(5); _result = "Something"; return "SaySomething exited"; } } // Also, would the answer change if we were to replace await Task.Delay(5); with Thread.Sleep(5)? Why or why not? 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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,22 @@ // What is the output of the program below? Explain your answer. using System; using System.Collections.Generic; public class Program { public static void Main() { var printers = new List<Action>(); for (int i = 0; i < 10; i++) { printers.Add(() => Console.WriteLine(i)); } foreach (var printer in printers) { printer(); } } } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ // What is the output of the short program below? Explain your answer. using System; public class Person { public string Name { get; set; } @@ -7,17 +11,16 @@ public class Program { public static void Main(string[] args) { var joe = new Person(); joe.Name = "Joe"; var tim = joe; tim.Name = "tim"; Console.WriteLine(joe.Name); Console.WriteLine(tim.Name); var myNumber = 666; DoSomething(myNumber); Console.WriteLine(myNumber); 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 charactersOriginal file line number Diff line number Diff line change @@ -1,31 +1,34 @@ // What is the output of the short program below? Explain your answer. using System; public class Program { public static void Main() { try { throw new Exception("Exception 1"); } catch (Exception ex) { Console.WriteLine(ex.Message); } try { throw new ApplicationException("Exception 2"); } catch (ApplicationException ex) { Console.WriteLine("ApplicationException 2"); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { Console.WriteLine("Finally"); } } } -
Clint Simon revised this gist
Dec 6, 2019 . 2 changed files with 32 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,6 @@ class Program { static void Main() { Console.WriteLine(location == null ? "location is null" : location); Console.WriteLine(time == DateTime.MinValue ? "time is null" : time.ToString()); } } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ // What is the output of the short program below? Explain your answer. class Program { static void Main() { try { throw new Exception("Exception 1"); } catch (Exception ex) { Console.WriteLine(ex.Message); } try { throw new ApplicationException("Exception 2"); } catch (ApplicationException ex) { Console.WriteLine("ApplicationException 2"); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { Console.WriteLine("Finally"); } } } -
Clint Simon revised this gist
Jun 29, 2018 . 3 changed files with 5 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,16 @@ // What is the output of the program below? Explain your answer. class Program { private static string _result; static void Main() { SaySomethingAsync(); Console.WriteLine(_result); } static async Task<string> SaySomethingAsync() { await Task.Delay(5); _result = "Hello world!"; return "Something"; } } 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 charactersOriginal file line number Diff line number Diff line change @@ -6,4 +6,3 @@ static void Main(string[] args) } // Use linq to find which numbers are evenly divisible by 5. 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 charactersOriginal file line number Diff line number Diff line change @@ -16,8 +16,8 @@ public static void Main(string[] args) Console.WriteLine(joe.Name); Console.WriteLine(tim.Name); int myNumber = 666; DoSomething(myNumber); Console.WriteLine(myNumber); -
Clint Simon revised this gist
Jun 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ class Program { private static string result; static void Main() { var result = SaySomethingAsync(); Console.WriteLine(result); } -
Clint Simon revised this gist
Dec 18, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ // Given an instance circle of the following class: public sealed class Circle { public double Radius { get; set; } public double Calculate(Func<double, double> op) { return op(Radius); } } -
Clint Simon revised this gist
Jan 5, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ public class Person public string Name { get; set; } } public class Program { public static void Main(string[] args) { -
Clint Simon renamed this gist
Jan 5, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.
NewerOlder