From 75ca42575c5d04c36e5a90b35d9c3be2790504b9 Mon Sep 17 00:00:00 2001 From: antonthunmanjonsson Date: Wed, 26 Aug 2020 09:46:28 +0200 Subject: [PATCH 1/7] Initial commit - Session 02 --- Session02/Session02/Session02.sln | 25 +++++++++++++++++++ .../Session02/Session02Exercise01/Program.cs | 13 ++++++++++ .../Session02Exercise01.csproj | 8 ++++++ 3 files changed, 46 insertions(+) create mode 100644 Session02/Session02/Session02.sln create mode 100644 Session02/Session02/Session02Exercise01/Program.cs create mode 100644 Session02/Session02/Session02Exercise01/Session02Exercise01.csproj diff --git a/Session02/Session02/Session02.sln b/Session02/Session02/Session02.sln new file mode 100644 index 0000000..20da6ac --- /dev/null +++ b/Session02/Session02/Session02.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30413.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session02Exercise01", "Session02Exercise01\Session02Exercise01.csproj", "{F7CC7696-115A-4241-B143-120AB0A3F60B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F7CC7696-115A-4241-B143-120AB0A3F60B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7CC7696-115A-4241-B143-120AB0A3F60B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F7CC7696-115A-4241-B143-120AB0A3F60B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F7CC7696-115A-4241-B143-120AB0A3F60B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EF9E92EC-71B2-472F-B2CA-CE53F3040AF9} + EndGlobalSection +EndGlobal diff --git a/Session02/Session02/Session02Exercise01/Program.cs b/Session02/Session02/Session02Exercise01/Program.cs new file mode 100644 index 0000000..c5930f8 --- /dev/null +++ b/Session02/Session02/Session02Exercise01/Program.cs @@ -0,0 +1,13 @@ +using System; + +namespace Session02Exercise01 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + + } + } +} diff --git a/Session02/Session02/Session02Exercise01/Session02Exercise01.csproj b/Session02/Session02/Session02Exercise01/Session02Exercise01.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session02/Session02/Session02Exercise01/Session02Exercise01.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + From ff530c44b81ba25be4adb1c10d2bd183f4165fed Mon Sep 17 00:00:00 2001 From: antonthunmanjonsson Date: Wed, 26 Aug 2020 10:08:42 +0200 Subject: [PATCH 2/7] Testing integers --- Session02/Session02/Session02Exercise01/Program.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Session02/Session02/Session02Exercise01/Program.cs b/Session02/Session02/Session02Exercise01/Program.cs index c5930f8..5d4f0d8 100644 --- a/Session02/Session02/Session02Exercise01/Program.cs +++ b/Session02/Session02/Session02Exercise01/Program.cs @@ -7,6 +7,10 @@ class Program static void Main(string[] args) { Console.WriteLine("Hello World!"); + + var integer = 0; + + Console.WriteLine("Integer is " + integer.ToString()); } } From 5b5aa644debd5f291eb799f1c5b2f3a2aff5cf54 Mon Sep 17 00:00:00 2001 From: antonthunmanjonsson Date: Wed, 26 Aug 2020 10:38:37 +0200 Subject: [PATCH 3/7] String test --- Session02/Session02/Session02Exercise01/Program.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Session02/Session02/Session02Exercise01/Program.cs b/Session02/Session02/Session02Exercise01/Program.cs index c5930f8..724d953 100644 --- a/Session02/Session02/Session02Exercise01/Program.cs +++ b/Session02/Session02/Session02Exercise01/Program.cs @@ -7,7 +7,10 @@ class Program static void Main(string[] args) { Console.WriteLine("Hello World!"); - + + string stringValue = "MyStringValue"; + + Console.WriteLine("The value of stringValue is: " + stringValue); } } } From ce10181d66e6eca82725484fa073c510dad26f24 Mon Sep 17 00:00:00 2001 From: antonthunmanjonsson Date: Wed, 26 Aug 2020 11:53:01 +0200 Subject: [PATCH 4/7] Session02Exercise02 --- Session02/Session02/Session02.sln | 8 ++++++- .../Session02/Session02Exercise02/Program.cs | 22 +++++++++++++++++++ .../Session02Exercise02.csproj | 8 +++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Session02/Session02/Session02Exercise02/Program.cs create mode 100644 Session02/Session02/Session02Exercise02/Session02Exercise02.csproj diff --git a/Session02/Session02/Session02.sln b/Session02/Session02/Session02.sln index 20da6ac..055762b 100644 --- a/Session02/Session02/Session02.sln +++ b/Session02/Session02/Session02.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30413.136 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session02Exercise01", "Session02Exercise01\Session02Exercise01.csproj", "{F7CC7696-115A-4241-B143-120AB0A3F60B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Session02Exercise01", "Session02Exercise01\Session02Exercise01.csproj", "{F7CC7696-115A-4241-B143-120AB0A3F60B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session02Exercise02", "Session02Exercise02\Session02Exercise02.csproj", "{F87226E1-856F-4A22-B01A-15C9C2C1B179}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +17,10 @@ Global {F7CC7696-115A-4241-B143-120AB0A3F60B}.Debug|Any CPU.Build.0 = Debug|Any CPU {F7CC7696-115A-4241-B143-120AB0A3F60B}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7CC7696-115A-4241-B143-120AB0A3F60B}.Release|Any CPU.Build.0 = Release|Any CPU + {F87226E1-856F-4A22-B01A-15C9C2C1B179}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F87226E1-856F-4A22-B01A-15C9C2C1B179}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F87226E1-856F-4A22-B01A-15C9C2C1B179}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F87226E1-856F-4A22-B01A-15C9C2C1B179}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Session02/Session02/Session02Exercise02/Program.cs b/Session02/Session02/Session02Exercise02/Program.cs new file mode 100644 index 0000000..4a344f3 --- /dev/null +++ b/Session02/Session02/Session02Exercise02/Program.cs @@ -0,0 +1,22 @@ +using System; + +namespace Session02Exercise02 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Do you want to enter your name? (y/n)?"); + var key = Console.ReadKey(); + + if (key.KeyChar == 'n') + return; + + Console.WriteLine("\nEnter your name:"); + var name = Console.ReadLine(); + + Console.WriteLine("Hello, " + name); + Console.ReadKey(); + } + } +} diff --git a/Session02/Session02/Session02Exercise02/Session02Exercise02.csproj b/Session02/Session02/Session02Exercise02/Session02Exercise02.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session02/Session02/Session02Exercise02/Session02Exercise02.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + From d4dc6bf913dd0403abb7dc004aaa595a72c03133 Mon Sep 17 00:00:00 2001 From: antonthunmanjonsson Date: Thu, 27 Aug 2020 09:27:14 +0200 Subject: [PATCH 5/7] Solution02 Example04 & 05 --- Session02/Session02/Session02.sln | 12 +++++++ .../Session02/Solution02Example04/Program.cs | 30 ++++++++++++++++++ .../Solution02Example04.csproj | 8 +++++ .../Session02/Solution02Example05/Program.cs | 31 +++++++++++++++++++ .../Solution02Example05.csproj | 8 +++++ 5 files changed, 89 insertions(+) create mode 100644 Session02/Session02/Solution02Example04/Program.cs create mode 100644 Session02/Session02/Solution02Example04/Solution02Example04.csproj create mode 100644 Session02/Session02/Solution02Example05/Program.cs create mode 100644 Session02/Session02/Solution02Example05/Solution02Example05.csproj diff --git a/Session02/Session02/Session02.sln b/Session02/Session02/Session02.sln index 055762b..678a536 100644 --- a/Session02/Session02/Session02.sln +++ b/Session02/Session02/Session02.sln @@ -7,6 +7,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Session02Exercise01", "Sess EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session02Exercise02", "Session02Exercise02\Session02Exercise02.csproj", "{F87226E1-856F-4A22-B01A-15C9C2C1B179}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Solution02Example04", "Solution02Example04\Solution02Example04.csproj", "{C1FA6E96-F933-45BC-BC22-6BE7ABE72636}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Solution02Example05", "Solution02Example05\Solution02Example05.csproj", "{6B150AC3-1C40-4CBA-94DB-F0D6EF27D410}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +25,14 @@ Global {F87226E1-856F-4A22-B01A-15C9C2C1B179}.Debug|Any CPU.Build.0 = Debug|Any CPU {F87226E1-856F-4A22-B01A-15C9C2C1B179}.Release|Any CPU.ActiveCfg = Release|Any CPU {F87226E1-856F-4A22-B01A-15C9C2C1B179}.Release|Any CPU.Build.0 = Release|Any CPU + {C1FA6E96-F933-45BC-BC22-6BE7ABE72636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1FA6E96-F933-45BC-BC22-6BE7ABE72636}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1FA6E96-F933-45BC-BC22-6BE7ABE72636}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1FA6E96-F933-45BC-BC22-6BE7ABE72636}.Release|Any CPU.Build.0 = Release|Any CPU + {6B150AC3-1C40-4CBA-94DB-F0D6EF27D410}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B150AC3-1C40-4CBA-94DB-F0D6EF27D410}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B150AC3-1C40-4CBA-94DB-F0D6EF27D410}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B150AC3-1C40-4CBA-94DB-F0D6EF27D410}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Session02/Session02/Solution02Example04/Program.cs b/Session02/Session02/Solution02Example04/Program.cs new file mode 100644 index 0000000..c3bc330 --- /dev/null +++ b/Session02/Session02/Solution02Example04/Program.cs @@ -0,0 +1,30 @@ +using System; + +namespace Solution02Example04 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Ange ålder: "); + + var input = Console.ReadLine(); + var integer = Convert.ToInt32(input); + + + if (integer >= 18) + { + Console.WriteLine("Du får köpa tobaksprodukter"); + } + else + { + Console.WriteLine("Du får inte köpa tobaksprodukter"); + } + + if (integer >= 40) + { + Console.WriteLine("Du är även jättegammal"); + } + } + } +} diff --git a/Session02/Session02/Solution02Example04/Solution02Example04.csproj b/Session02/Session02/Solution02Example04/Solution02Example04.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session02/Session02/Solution02Example04/Solution02Example04.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + diff --git a/Session02/Session02/Solution02Example05/Program.cs b/Session02/Session02/Solution02Example05/Program.cs new file mode 100644 index 0000000..dcc0e83 --- /dev/null +++ b/Session02/Session02/Solution02Example05/Program.cs @@ -0,0 +1,31 @@ +using System; + +namespace Solution02Example05 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Ange vattentemperatur i grader C:"); + + var input = Console.ReadLine(); + var integer = Convert.ToInt32(input); + + string waterLabel = integer >= 27 ? "Går att bada" : "Går inte att bada"; + + // Är samma sak som + //if (integer > 27) + //{ + // waterLabel = "Går att bada"; + //} + //else + //{ + // waterLabel = "Går inte att bada"; + //} + + + + Console.WriteLine(waterLabel + " i havet"); + } + } +} diff --git a/Session02/Session02/Solution02Example05/Solution02Example05.csproj b/Session02/Session02/Solution02Example05/Solution02Example05.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session02/Session02/Solution02Example05/Solution02Example05.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + From 590a57fd373ad60555b5b11bb972b8ec5a2c8677 Mon Sep 17 00:00:00 2001 From: antonthunmanjonsson Date: Fri, 28 Aug 2020 09:15:41 +0200 Subject: [PATCH 6/7] Session03 Exercise02 --- Session03/Session03/Session03.sln | 25 +++++++++++++++++++ .../Session03/Session03Exercise02/Program.cs | 20 +++++++++++++++ .../Session03Exercise02.csproj | 8 ++++++ 3 files changed, 53 insertions(+) create mode 100644 Session03/Session03/Session03.sln create mode 100644 Session03/Session03/Session03Exercise02/Program.cs create mode 100644 Session03/Session03/Session03Exercise02/Session03Exercise02.csproj diff --git a/Session03/Session03/Session03.sln b/Session03/Session03/Session03.sln new file mode 100644 index 0000000..aff9abe --- /dev/null +++ b/Session03/Session03/Session03.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30413.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session03Exercise02", "Session03Exercise02\Session03Exercise02.csproj", "{F8F25BB2-9822-43C4-899B-8102A0552F7D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F8F25BB2-9822-43C4-899B-8102A0552F7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F8F25BB2-9822-43C4-899B-8102A0552F7D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F8F25BB2-9822-43C4-899B-8102A0552F7D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F8F25BB2-9822-43C4-899B-8102A0552F7D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7E1D272D-D7F3-42FC-A017-131D73DC1330} + EndGlobalSection +EndGlobal diff --git a/Session03/Session03/Session03Exercise02/Program.cs b/Session03/Session03/Session03Exercise02/Program.cs new file mode 100644 index 0000000..20a1593 --- /dev/null +++ b/Session03/Session03/Session03Exercise02/Program.cs @@ -0,0 +1,20 @@ +using System; + +namespace Session03Exercise02 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Ange ett antal siffror, separerat med kommatecken."); + var input = Console.ReadLine(); + + var inputArray = input.Split(",", StringSplitOptions.RemoveEmptyEntries); + + foreach (var number in inputArray) + { + Console.WriteLine("Värdet är " + number); + } + } + } +} diff --git a/Session03/Session03/Session03Exercise02/Session03Exercise02.csproj b/Session03/Session03/Session03Exercise02/Session03Exercise02.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session03/Session03/Session03Exercise02/Session03Exercise02.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + From 3b365d4b5a152ef72c4b14131951662f6c7bb854 Mon Sep 17 00:00:00 2001 From: antonthunmanjonsson Date: Fri, 28 Aug 2020 13:09:40 +0200 Subject: [PATCH 7/7] Numbers exercise --- Session03/Session03/Session03.sln | 6 + .../Session03/Session03Exercise02/Program.cs | 1 + .../Session03/Session03Numbers/Program.cs | 141 ++++++++++++++++++ .../Session03Numbers/Session03Numbers.csproj | 8 + 4 files changed, 156 insertions(+) create mode 100644 Session03/Session03/Session03Numbers/Program.cs create mode 100644 Session03/Session03/Session03Numbers/Session03Numbers.csproj diff --git a/Session03/Session03/Session03.sln b/Session03/Session03/Session03.sln index aff9abe..f62d2a7 100644 --- a/Session03/Session03/Session03.sln +++ b/Session03/Session03/Session03.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.30413.136 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session03Exercise02", "Session03Exercise02\Session03Exercise02.csproj", "{F8F25BB2-9822-43C4-899B-8102A0552F7D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session03Numbers", "Session03Numbers\Session03Numbers.csproj", "{DD026B75-D062-4537-988E-204B8C353397}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {F8F25BB2-9822-43C4-899B-8102A0552F7D}.Debug|Any CPU.Build.0 = Debug|Any CPU {F8F25BB2-9822-43C4-899B-8102A0552F7D}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8F25BB2-9822-43C4-899B-8102A0552F7D}.Release|Any CPU.Build.0 = Release|Any CPU + {DD026B75-D062-4537-988E-204B8C353397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DD026B75-D062-4537-988E-204B8C353397}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DD026B75-D062-4537-988E-204B8C353397}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DD026B75-D062-4537-988E-204B8C353397}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Session03/Session03/Session03Exercise02/Program.cs b/Session03/Session03/Session03Exercise02/Program.cs index 20a1593..ab8c00c 100644 --- a/Session03/Session03/Session03Exercise02/Program.cs +++ b/Session03/Session03/Session03Exercise02/Program.cs @@ -15,6 +15,7 @@ static void Main(string[] args) { Console.WriteLine("Värdet är " + number); } + } } } diff --git a/Session03/Session03/Session03Numbers/Program.cs b/Session03/Session03/Session03Numbers/Program.cs new file mode 100644 index 0000000..c8175b6 --- /dev/null +++ b/Session03/Session03/Session03Numbers/Program.cs @@ -0,0 +1,141 @@ +using System; +using System.Diagnostics; +using System.Globalization; +using System.Linq; + +namespace Session03Numbers +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Ange ett antal siffror, separerat med kommatecken."); + var input = Console.ReadLine(); + + var inputArray = input.Split(",", StringSplitOptions.RemoveEmptyEntries); + + double?[] numbersArray = new double?[inputArray.Length]; + double? sum = 0; + double? largest = 0; + double? smallest = 0; + double? average = 0; + + for (int i = 0; i < inputArray.Length; i++) + { + //try + //{ + + // //Debug.Assert(i < inputArray.Length - 1); + //} + //catch (Exception) + //{ + // numbersArray[i] = 0; + //} + //finally + //{ + + //} + + NumberStyles numberStyle = NumberStyles.Integer | NumberStyles.Float; + + bool parsed = double.TryParse(inputArray[i], numberStyle, CultureInfo.InvariantCulture, out double parsedValue); + + if (parsed) + { + numbersArray[i] = parsedValue; + } + else + { + numbersArray[i] = null; + } + + //numbersArray[i] = Convert.ToDouble(inputArray[i]); + Console.WriteLine("Värde " + numbersArray[i]); + + //sum += numbersArray[i]; + + } + + foreach (double? num in numbersArray) + { + if (num == null) + { + continue; + } + else + { + sum += num; + } + } + + largest = numbersArray.Max(); + smallest = numbersArray.Min(); + average = (float)sum / numbersArray.Length; + + // Option 2 for largest & smallest + largest = numbersArray[0]; + smallest = numbersArray[0]; + + foreach(double? num in numbersArray) + { + if (largest < num) + largest = num; + + if (smallest > num) + smallest = num; + } + + + Console.WriteLine($"\nStörsta värdet: {largest}\nLägsta värdet: {smallest}\n" + + $"Antal tal: {numbersArray.Length}\nMedelvärde: {average}"); + + //int exceptionStatus = getExceptionStatus(); + } + + //static double GetDoubleValue(string input) + //{ + // try + // { + // var result = int.Parse(input); + + // return result; + // } + // catch (FormatException ex) when (ex.Message.Contains("Input string")) + // { + // //throw; + // return double.MinValue; + + // } + // catch (Exception ex) + // { + // return 0; + // } + //} + + //static int getExceptionStatus() + //{ + // int exceptionResult; + + // try + // { + // exceptionResult = -1; + + // throw new Exception("Provocerat fel"); + + // return exceptionResult; + // } + // catch (Exception ex) + // { + // exceptionResult = ex.HResult; + + // return exceptionResult; + + // } + // finally + // { + // exceptionResult = int.MaxValue; + + // } + // } + } +} diff --git a/Session03/Session03/Session03Numbers/Session03Numbers.csproj b/Session03/Session03/Session03Numbers/Session03Numbers.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session03/Session03/Session03Numbers/Session03Numbers.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + +