diff --git a/HolidayQuiz/HolidayQuiz.sln b/HolidayQuiz/HolidayQuiz.sln new file mode 100644 index 0000000..3e6cade --- /dev/null +++ b/HolidayQuiz/HolidayQuiz.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30330.147 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HolidayQuiz", "HolidayQuiz\HolidayQuiz.csproj", "{62C58643-5110-40F8-ACEA-6A77D2DD4F95}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {62C58643-5110-40F8-ACEA-6A77D2DD4F95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {62C58643-5110-40F8-ACEA-6A77D2DD4F95}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62C58643-5110-40F8-ACEA-6A77D2DD4F95}.Release|Any CPU.ActiveCfg = Release|Any CPU + {62C58643-5110-40F8-ACEA-6A77D2DD4F95}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AB8B192F-60E4-434F-A590-C946DE0A6AE5} + EndGlobalSection +EndGlobal diff --git a/HolidayQuiz/HolidayQuiz/HolidayQuiz.csproj b/HolidayQuiz/HolidayQuiz/HolidayQuiz.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/HolidayQuiz/HolidayQuiz/HolidayQuiz.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + diff --git a/HolidayQuiz/HolidayQuiz/Program.cs b/HolidayQuiz/HolidayQuiz/Program.cs new file mode 100644 index 0000000..15c5b5c --- /dev/null +++ b/HolidayQuiz/HolidayQuiz/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace HolidayQuiz +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/Session02/Exercise01/Exercise01.csproj b/Session02/Exercise01/Exercise01.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session02/Exercise01/Exercise01.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + diff --git a/Session02/Exercise01/Nameprogram.cs b/Session02/Exercise01/Nameprogram.cs new file mode 100644 index 0000000..066d599 --- /dev/null +++ b/Session02/Exercise01/Nameprogram.cs @@ -0,0 +1,23 @@ +using System; + +namespace Exercise01 +{ + class Nameprogram + { + 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("Enter your name:"); + var name = Console.ReadLine(); + + Console.WriteLine("Hello, " + name); + Console.ReadKey(); + + } + } +} diff --git a/Session02/Session02.sln b/Session02/Session02.sln new file mode 100644 index 0000000..529ccbd --- /dev/null +++ b/Session02/Session02.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30330.147 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Session02Exercise01", "Session02Exercise01\Session02Exercise01.csproj", "{7AD8F7EE-EE2F-4406-83B8-175E47A055BA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exercise01", "Exercise01\Exercise01.csproj", "{A006EB6B-4575-4218-8515-908D59C38027}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7AD8F7EE-EE2F-4406-83B8-175E47A055BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AD8F7EE-EE2F-4406-83B8-175E47A055BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AD8F7EE-EE2F-4406-83B8-175E47A055BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AD8F7EE-EE2F-4406-83B8-175E47A055BA}.Release|Any CPU.Build.0 = Release|Any CPU + {A006EB6B-4575-4218-8515-908D59C38027}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A006EB6B-4575-4218-8515-908D59C38027}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A006EB6B-4575-4218-8515-908D59C38027}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A006EB6B-4575-4218-8515-908D59C38027}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A01846C8-7967-4D9C-BFB6-B277CE9B5BFB} + EndGlobalSection +EndGlobal diff --git a/Session02/Session02Exercise01/Program.cs b/Session02/Session02Exercise01/Program.cs new file mode 100644 index 0000000..3de33b5 --- /dev/null +++ b/Session02/Session02Exercise01/Program.cs @@ -0,0 +1,16 @@ +using System; + +namespace Session02Exercise01 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + + + Console.ReadLine(); + + } + } +} diff --git a/Session02/Session02Exercise01/Session02Exercise01.csproj b/Session02/Session02Exercise01/Session02Exercise01.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session02/Session02Exercise01/Session02Exercise01.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + diff --git a/Session03/Session03.sln b/Session03/Session03.sln new file mode 100644 index 0000000..0145b8a --- /dev/null +++ b/Session03/Session03.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30330.147 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session03Exercise02", "Session03Exercise02\Session03Exercise02.csproj", "{AC8EF63F-B225-4D1A-AB4E-0DED2349D8CD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AC8EF63F-B225-4D1A-AB4E-0DED2349D8CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC8EF63F-B225-4D1A-AB4E-0DED2349D8CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC8EF63F-B225-4D1A-AB4E-0DED2349D8CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC8EF63F-B225-4D1A-AB4E-0DED2349D8CD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F9EA986A-D463-4C01-AAE3-D2F92EF01A3C} + EndGlobalSection +EndGlobal diff --git a/Session03/Session03Exercise02/Program.cs b/Session03/Session03Exercise02/Program.cs new file mode 100644 index 0000000..28bf986 --- /dev/null +++ b/Session03/Session03Exercise02/Program.cs @@ -0,0 +1,79 @@ + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Linq; + +namespace Session03Exercise02 +{ + class Program + { + static string line = "--------------------------------------------------------------"; + + static void Main(string[] args) + { + while (true)//Forever and ever n ever + { + Console.WriteLine("Ange ett antal siffror, separat med kommatecken."); + Console.WriteLine(line); + + var inputStringArray = Console.ReadLine().Split(',', StringSplitOptions.RemoveEmptyEntries);//new [] för FrameWork + List numbersList = new List(); //A list so I dont need to sort unparsed values in for + + double sum = 0; + double maxValue; + double minValue; + + int parseNumberCount = 0; //counter for divison with sum for middlevalue + + Console.WriteLine(line); + //Input + for (int i = 0; i < inputStringArray.Length; i++) + { + var label = "Värdet är:"; + var paddedLabel = label.PadRight(14); + + try + { + double currentNumber; + NumberStyles numberStyles = NumberStyles.Any | NumberStyles.Float; //bitwiseoperator + bool parsed = double.TryParse(inputStringArray[i], numberStyles, CultureInfo.InvariantCulture, out currentNumber); + if (!parsed) //Jumps backs to the start of the iteration + continue; + else //Add elements to list and + { + numbersList.Add(currentNumber); + sum += currentNumber; + ++parseNumberCount;//Perhaps exsessive in this stage + } + Console.WriteLine(paddedLabel + currentNumber); //Prints out inputvalue for user if correct + // Debug.Assert(i < numbers.Length - 1); //Remainer just for deeper studies in the subject + } + catch (Exception ex) + { + Console.WriteLine(ex); + throw; + } + + } + //Assigning highest and smallest value if element in list is not zero + if (numbersList.Count != 0) + { + maxValue = numbersList.Max(); + minValue = numbersList.Min(); + + //Printing out evaluated values + Console.WriteLine(line); Console.WriteLine(); + Console.WriteLine($"Högsta värdet: {maxValue}");//Max value + Console.WriteLine($"Minsta värdet: {minValue}");//Min value + Console.WriteLine("Medelvärdet för arrayen är: " + string.Format($"{(sum / parseNumberCount):0.00}")); //Middle value + } + else Console.WriteLine("Här har det inte skrivits in nått värde alls. Försök igen!");//ERROR message + Console.WriteLine("\nTryck på valfri tangent för att köra programmet en gång till."); + + Console.ReadKey(); + } + } + } +} diff --git a/Session03/Session03Exercise02/Session03Exercise02.csproj b/Session03/Session03Exercise02/Session03Exercise02.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session03/Session03Exercise02/Session03Exercise02.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + diff --git a/Session2/Session02/Session02.sln b/Session2/Session02/Session02.sln new file mode 100644 index 0000000..d97404b --- /dev/null +++ b/Session2/Session02/Session02.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30330.147 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Session02Exercise01", "Session02Exercise01\Session02Exercise01.csproj", "{D43377BC-B59A-4BC3-9C2B-E8A1E15DECC3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D43377BC-B59A-4BC3-9C2B-E8A1E15DECC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D43377BC-B59A-4BC3-9C2B-E8A1E15DECC3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D43377BC-B59A-4BC3-9C2B-E8A1E15DECC3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D43377BC-B59A-4BC3-9C2B-E8A1E15DECC3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BE13223B-EA03-4564-8DF3-0ADFF6760509} + EndGlobalSection +EndGlobal diff --git a/Session2/Session02/Session02Exercise01/Program.cs b/Session2/Session02/Session02Exercise01/Program.cs new file mode 100644 index 0000000..c4359a3 --- /dev/null +++ b/Session2/Session02/Session02Exercise01/Program.cs @@ -0,0 +1,19 @@ +using System; + +namespace Session02Exercise01 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + + var integer = 0; + string stringValue = "Mystringvalue"; + + Console.WriteLine("Integer is: " + integer); + Console.WriteLine("value of my stringvalue: " + stringValue); + + } + } +} diff --git a/Session2/Session02/Session02Exercise01/Session02Exercise01.csproj b/Session2/Session02/Session02Exercise01/Session02Exercise01.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/Session2/Session02/Session02Exercise01/Session02Exercise01.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + + diff --git a/csharp-plus-2020 b/csharp-plus-2020 new file mode 160000 index 0000000..f0bd65b --- /dev/null +++ b/csharp-plus-2020 @@ -0,0 +1 @@ +Subproject commit f0bd65ba05e036d62fcc364a4576ff7bad2b442d diff --git a/sharp_projects b/sharp_projects new file mode 160000 index 0000000..dfb7d60 --- /dev/null +++ b/sharp_projects @@ -0,0 +1 @@ +Subproject commit dfb7d60ca7560f9f7296babe424195047eab914a diff --git a/srctreeclone b/srctreeclone new file mode 160000 index 0000000..2177031 --- /dev/null +++ b/srctreeclone @@ -0,0 +1 @@ +Subproject commit 2177031157cda8cc592c01d82666a3813b51bcc4