diff --git a/Session02/Session02/Exercise/Exercise.csproj b/Session02/Session02/Exercise/Exercise.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session02/Session02/Exercise/Exercise.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + diff --git a/Session02/Session02/Exercise/Program.cs b/Session02/Session02/Exercise/Program.cs new file mode 100644 index 0000000..cb121f8 --- /dev/null +++ b/Session02/Session02/Exercise/Program.cs @@ -0,0 +1,25 @@ +using System; + +namespace Exercise +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello Mate!"); + + Console.WriteLine("Do you want to enter your name? (y/n)?"); + var key = Console.ReadKey(); + + if (key.KeyChar == 'n') + return; + + Console.WriteLine("Enter your name:"); + var name = Console.ReadLine(); + + Console.WriteLine("Hello, " + name); + Console.ReadKey(); + + } + } +} diff --git a/Session02/Session02/Session02.sln b/Session02/Session02/Session02.sln new file mode 100644 index 0000000..7da5a65 --- /dev/null +++ b/Session02/Session02/Session02.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30413.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Session02Ex01", "Session02Ex01\Session02Ex01.csproj", "{6403743B-E134-4904-9B94-16A34CB63C86}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exercise", "Exercise\Exercise.csproj", "{550C159D-39B6-4958-A631-BCB9A3A9C29C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6403743B-E134-4904-9B94-16A34CB63C86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6403743B-E134-4904-9B94-16A34CB63C86}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6403743B-E134-4904-9B94-16A34CB63C86}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6403743B-E134-4904-9B94-16A34CB63C86}.Release|Any CPU.Build.0 = Release|Any CPU + {550C159D-39B6-4958-A631-BCB9A3A9C29C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {550C159D-39B6-4958-A631-BCB9A3A9C29C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {550C159D-39B6-4958-A631-BCB9A3A9C29C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {550C159D-39B6-4958-A631-BCB9A3A9C29C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CD2718C1-4C7D-4DE5-83CA-6BEDB124EA58} + EndGlobalSection +EndGlobal diff --git a/Session02/Session02/Session02Ex01/Program.cs b/Session02/Session02/Session02Ex01/Program.cs new file mode 100644 index 0000000..8cde803 --- /dev/null +++ b/Session02/Session02/Session02Ex01/Program.cs @@ -0,0 +1,18 @@ +using System; + +namespace Session02Ex01 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + + var integer = 0; + string stinrgValue = "MyStringValue"; + Console.WriteLine("Integer is " + integer.ToString()); + Console.WriteLine("The Value of StringValue is; " + stinrgValue); + + } + } +} diff --git a/Session02/Session02/Session02Ex01/Session02Ex01.csproj b/Session02/Session02/Session02Ex01/Session02Ex01.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session02/Session02/Session02Ex01/Session02Ex01.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + diff --git "a/\303\226vning/\303\226vning/\303\226vning.sln" "b/\303\226vning/\303\226vning/\303\226vning.sln" new file mode 100644 index 0000000..9c4f0ad --- /dev/null +++ "b/\303\226vning/\303\226vning/\303\226vning.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}") = "Övning", "Övning\Övning.csproj", "{26EA665F-DE9E-4E1D-92F9-1A698FD262E2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {26EA665F-DE9E-4E1D-92F9-1A698FD262E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26EA665F-DE9E-4E1D-92F9-1A698FD262E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26EA665F-DE9E-4E1D-92F9-1A698FD262E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26EA665F-DE9E-4E1D-92F9-1A698FD262E2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C131BC95-457B-48A5-BF9E-D693A15E90F4} + EndGlobalSection +EndGlobal diff --git "a/\303\226vning/\303\226vning/\303\226vning/Program.cs" "b/\303\226vning/\303\226vning/\303\226vning/Program.cs" new file mode 100644 index 0000000..6fc9d86 --- /dev/null +++ "b/\303\226vning/\303\226vning/\303\226vning/Program.cs" @@ -0,0 +1,51 @@ +using System; +using System.Diagnostics; +using System.Globalization; + +namespace Övning +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Mata in värden: "); + + var input = Console.ReadLine(); + var inputArray = input.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + + double[] numberArray = new double[inputArray.Length]; + + + for (int i = 0; i < inputArray.Length; i++) + { + + + + + + + + + + //try + //{ + // numberArray[i] = Convert.ToDouble(inputArray[i]); + + + + + //} + //catch (Exception) + //{ + + // numberArray[i] = 0; + + //} + + } + + + } + + } +} diff --git "a/\303\226vning/\303\226vning/\303\226vning/\303\226vning.csproj" "b/\303\226vning/\303\226vning/\303\226vning/\303\226vning.csproj" new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ "b/\303\226vning/\303\226vning/\303\226vning/\303\226vning.csproj" @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + +