├── 10 ├── Dictionary │ ├── Dictionary.csproj │ └── Program.cs ├── FloatVsDoubleVsDecimal │ ├── FloatVsDoubleVsDecimal.csproj │ └── Program.cs ├── ForEachLoop │ ├── ForEachLoop.csproj │ └── Program.cs ├── List │ ├── List.csproj │ └── Program.cs ├── StringBuilder │ ├── Program.cs │ └── StringBuilder.csproj └── StringConcatVsStringBuilder │ ├── Program.cs │ └── StringConcatVsStringBuilder.csproj ├── 11 ├── Class │ ├── Class.csproj │ ├── Program.cs │ └── Warrior.cs ├── ExtensionMethod │ ├── ExtensionMethod.csproj │ ├── Program.cs │ └── StringExtensions.cs ├── PartialClass │ ├── PartialClass.csproj │ ├── Program.cs │ ├── Robot.LeftArm.cs │ └── Robot.RightArm.cs ├── StaticClass │ ├── Program.cs │ ├── StaticClass.csproj │ └── UnitConverter.cs └── StaticMethod │ ├── CourseCode.cs │ ├── ESubject.cs │ ├── Program.cs │ └── StaticMethod.csproj ├── 12 ├── LINQ │ ├── LINQ.csproj │ ├── Order.cs │ ├── OrderItem.cs │ └── Program.cs ├── Nullable │ ├── Bar.cs │ ├── Foo.cs │ ├── Nullable.csproj │ └── Program.cs ├── Struct │ ├── CartItem.cs │ ├── Program.cs │ └── Struct.csproj └── ValueTypeVsReferenceType │ ├── Program.cs │ ├── ValueTypeVsReferenceType.csproj │ └── Vector.cs ├── 13 ├── ReadAndWriteFile │ ├── Program.cs │ ├── ReadAndWriteFile.csproj │ └── input │ │ └── inputtext.txt ├── ReadAndWriteFileUsingFileStream │ ├── Program.cs │ ├── ReadAndWriteFileUsingFileStream.csproj │ └── input │ │ └── inputtext.txt ├── TryCatchFinally │ ├── IntegerIs10Exception.cs │ ├── Program.cs │ └── TryCatchFinally.csproj └── UsingStatement │ ├── Program.cs │ ├── UsingStatement.csproj │ └── input │ └── inputtext.txt ├── 14 └── CopyDirectory │ ├── CopyDirectory.csproj │ ├── Program.cs │ └── input │ ├── innerfolder │ ├── innerinnerfolder │ │ └── mostinner.txt │ └── mytext.txt │ ├── innerfolder2 │ ├── secretmessage.txt │ └── secretmessage2.txt │ └── notsosecretmessage.txt ├── .gitignore ├── 01 └── HelloWorld │ ├── HelloWorld.csproj │ └── Program.cs ├── 02 ├── Comment │ ├── Comment.csproj │ └── Program.cs ├── PrimitiveTypesToBinary │ ├── PrimitiveTypesToBinary.csproj │ └── Program.cs └── Variables │ ├── Program.cs │ └── Variables.csproj ├── 03 ├── ASCIICodeHelloWorld │ ├── ASCIICodeHelloWorld.csproj │ └── Program.cs ├── BitFlag │ ├── BitFlag.csproj │ └── Program.cs ├── BitwiseMultiplicationAndDivision │ ├── BitwiseMultiplicationAndDivision.csproj │ └── Program.cs ├── Calculator │ ├── Calculator.csproj │ └── Program.cs ├── IncrementAndDecrementOperators │ ├── IncrementAndDecrementOperators.csproj │ └── Program.cs ├── InsertStudentInformation │ ├── InsertStudentInformation.csproj │ └── Program.cs ├── StringInterpolation │ ├── Program.cs │ └── StringInterpolation.csproj └── TypeConversion │ ├── Program.cs │ └── TypeConversion.csproj ├── 04 ├── InsertStudentInformation2 │ ├── InsertStudentInformation2.csproj │ └── Program.cs ├── LogicalExpressions │ ├── LogicalExpressions.csproj │ └── Program.cs └── OrderOfExpressionEvaluation │ ├── OrderOfExpressionEvaluation.csproj │ └── Program.cs ├── 05 ├── AddTwo2dArrays │ ├── AddTwo2dArrays.csproj │ └── Program.cs ├── CalculatorWithSwitchStatement │ ├── CalculatorWithSwitchStatement.csproj │ └── Program.cs ├── InfiniteWhileLoop │ ├── InfiniteWhileLoop.csproj │ └── Program.cs ├── InsertStudentInformation3 │ ├── InsertStudentInformation3.csproj │ └── Program.cs └── Sum │ ├── Program.cs │ └── Sum.csproj ├── 06 ├── CalculatorUsingEnum │ ├── CalculatorUsingEnum.csproj │ ├── EOperator.cs │ └── Program.cs ├── CallByValueAndCallByReference │ ├── CallByValueAndCallByReference.csproj │ └── Program.cs ├── Functions │ ├── Functions.csproj │ └── Program.cs ├── InputValidationUsingAssert │ ├── InputValidationUsingAssert.csproj │ └── Program.cs └── Scope │ ├── Program.cs │ └── Scope.csproj ├── 07 ├── RandomShuffling │ ├── Program.cs │ └── RandomShuffling.csproj └── RecursiveFactorial │ ├── Program.cs │ └── RecursiveFactorial.csproj ├── 09 ├── ArrayOfArrays │ ├── ArrayOfArrays.csproj │ └── Program.cs ├── DefaultParameters │ ├── DefaultParameters.csproj │ └── Program.cs ├── FunctionOverloading │ ├── FunctionOverloading.csproj │ └── Program.cs ├── OutParameterModifier │ ├── OutParameterModifier.csproj │ └── Program.cs └── ParseTextMessage │ ├── ParseTextMessage.csproj │ ├── Program.cs │ └── TextMessage.txt ├── BuildTargets └── Common.targets ├── CODEOWNERS ├── COMP1500CodesSamples.sln └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /01/HelloWorld/HelloWorld.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /01/HelloWorld/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HelloWorld 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /02/Comment/Comment.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /02/Comment/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Comment 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | 11 | // Console.WriteLine("Hello World!"); 12 | 13 | /* 14 | Console.WriteLine("Hello World!"); 15 | Console.WriteLine("Hello World!"); 16 | Console.WriteLine("Hello World!"); 17 | Console.WriteLine("Can you hear me?!"); 18 | */ 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /02/PrimitiveTypesToBinary/PrimitiveTypesToBinary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /02/PrimitiveTypesToBinary/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PrimitiveTypesToBinary 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | byte byte1 = byte.MaxValue; 10 | byte byte2 = byte.MinValue; 11 | 12 | int int1 = int.MaxValue; 13 | int int2 = int.MinValue; 14 | 15 | long long1 = long.MinValue; 16 | long long2 = long.MaxValue; 17 | 18 | char char1 = 'x'; 19 | char char2 = '$'; 20 | 21 | Console.WriteLine(byte1 + " -> " + Convert.ToString(byte1, 2)); 22 | Console.WriteLine(byte2 + " -> " + Convert.ToString(byte2, 2)); 23 | 24 | Console.WriteLine(int1 + " -> " + Convert.ToString(int1, 2)); 25 | Console.WriteLine(int2 + " -> " + Convert.ToString(int2, 2)); 26 | 27 | Console.WriteLine(long1 + " -> " + Convert.ToString(long1, 2)); 28 | Console.WriteLine(long2 + " -> " + Convert.ToString(long2, 2)); 29 | 30 | Console.WriteLine(char1 + " -> " + Convert.ToString(char1, 2)); 31 | Console.WriteLine(char2 + " -> " + Convert.ToString(char2, 2)); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /02/Variables/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Variables 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int int1 = 2; 10 | int int2 = 10; 11 | 12 | float float1 = 10.23f; 13 | float float2 = 3.4f; 14 | 15 | double double1 = 11.0; 16 | double double2 = 5.234; 17 | 18 | char char1 = 'x'; 19 | char char2 = '$'; 20 | 21 | Console.WriteLine(int1 + " + " + int2 + " = " + (int1 + int2)); 22 | Console.WriteLine(int1 + " - " + int2 + " = " + (int1 - int2)); 23 | Console.WriteLine(float1 + " + " + float2 + " = " + (float1 + float2)); 24 | Console.WriteLine(double1 + " + " + double2 + " = " + (double1 + double2)); 25 | Console.WriteLine(char1 + " + " + char2 + " = " + (char1 + char2)); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /02/Variables/Variables.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /03/ASCIICodeHelloWorld/ASCIICodeHelloWorld.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /03/ASCIICodeHelloWorld/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ASCIICodeHelloWorld 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | 11 | Console.WriteLine("\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x21"); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /03/BitFlag/BitFlag.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /03/BitFlag/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BitFlag 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | const int BIT_FLAG_SIZE = 8; 10 | 11 | byte bitFlags = 0; 12 | 13 | byte mask1 = 1 << 2; 14 | 15 | bitFlags |= mask1; 16 | 17 | Console.WriteLine("bitFlags: " + Convert.ToString(bitFlags, 2).PadLeft(BIT_FLAG_SIZE, '0')); 18 | 19 | byte mask3 = (1 << 3) | (1 << 5); 20 | 21 | bitFlags |= mask3; 22 | 23 | Console.WriteLine("bitFlags: " + Convert.ToString(bitFlags, 2).PadLeft(BIT_FLAG_SIZE, '0')); 24 | 25 | bitFlags &= (byte)~mask1; 26 | 27 | Console.WriteLine("bitFlags: " + Convert.ToString(bitFlags, 2).PadLeft(BIT_FLAG_SIZE, '0')); 28 | 29 | bitFlags &= 0; 30 | 31 | Console.WriteLine("bitFlags: " + Convert.ToString(bitFlags, 2).PadLeft(BIT_FLAG_SIZE, '0')); 32 | 33 | char char1 = 'A'; 34 | int result1 = char1 | ' '; 35 | 36 | Console.WriteLine("result1: " + (char)result1); 37 | 38 | char char2 = 'a'; 39 | int result2 = char2 & '_'; 40 | 41 | Console.WriteLine("result2: " + (char)result2); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /03/BitwiseMultiplicationAndDivision/BitwiseMultiplicationAndDivision.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /03/BitwiseMultiplicationAndDivision/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BitwiseMultiplicationAndDivision 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int num1 = 1; 10 | 11 | int result1 = num1 << 1; 12 | 13 | Console.WriteLine("result1: " + result1); 14 | 15 | int result2 = result1 << 2; 16 | 17 | Console.WriteLine("result2: " + result2); 18 | 19 | int result3 = result2 >> 3; 20 | 21 | Console.WriteLine("result3: " + result3); 22 | 23 | //int result4 = result3 << 2.5f; 24 | //int result5 = 2.1f << 2.5f; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /03/Calculator/Calculator.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /03/Calculator/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Calculator 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int num1 = 10; 10 | int num2 = 11; 11 | 12 | int result1 = num1 + num2; 13 | int result2 = num1 - num2; 14 | 15 | Console.WriteLine("result1: " + result1); 16 | Console.WriteLine("result2: " + result2); 17 | 18 | uint result3 = (uint)num1 - (uint)num2; 19 | 20 | Console.WriteLine("result3: " + result3); 21 | 22 | int num3 = int.MaxValue; 23 | int result4 = num3 + 1; 24 | 25 | Console.WriteLine("result4: " + result4); 26 | 27 | float num4 = 2.3f; 28 | 29 | float result5 = num1 + num4; 30 | float result6 = num4 - num1; 31 | 32 | Console.WriteLine("result5: " + result5); 33 | Console.WriteLine("result6: " + result6); 34 | 35 | float result7 = num2 * num4; 36 | 37 | Console.WriteLine("result7: " + result7); 38 | 39 | float result8 = num2 / num1; 40 | float result9 = num2 / (float)num1; 41 | 42 | Console.WriteLine("result8: " + result8); 43 | Console.WriteLine("result9: " + result9); 44 | 45 | int result10 = num1 % num2; 46 | int result11 = num2 % num1; 47 | 48 | Console.WriteLine("result10: " + result10); 49 | Console.WriteLine("result11: " + result11); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /03/IncrementAndDecrementOperators/IncrementAndDecrementOperators.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /03/IncrementAndDecrementOperators/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace IncrementAndDecrementOperators 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int num1 = 0; 10 | int num2 = 10; 11 | 12 | int result1 = num1++ + num2; 13 | 14 | Console.WriteLine("num1: " + num1); 15 | Console.WriteLine("num2: " + num2); 16 | Console.WriteLine("result1: " + result1); 17 | 18 | num1 = 0; 19 | num2 = 10; 20 | 21 | int result2 = ++num1 + num2++; 22 | 23 | Console.WriteLine("num1: " + num1); 24 | Console.WriteLine("num2: " + num2); 25 | Console.WriteLine("result2: " + result2); 26 | 27 | num1 = 0; 28 | num2 = 10; 29 | 30 | int result3 = num1-- + num1-- - --num2; 31 | 32 | Console.WriteLine("num1: " + num1); 33 | Console.WriteLine("num2: " + num2); 34 | Console.WriteLine("result3: " + result3); 35 | 36 | num1 = 0; 37 | num2 = 10; 38 | 39 | int result4 = num2++ * num1++ - --num2 + num1; 40 | 41 | Console.WriteLine("num1: " + num1); 42 | Console.WriteLine("num2: " + num2); 43 | Console.WriteLine("result4: " + result4); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /03/InsertStudentInformation/InsertStudentInformation.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /03/InsertStudentInformation/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace InsertStudentInformation 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Let's fill out student information:"); 10 | 11 | Console.Write("Name: "); 12 | string name = Console.ReadLine(); 13 | 14 | Console.Write("Student Number: "); 15 | string studentNumberString = Console.ReadLine(); 16 | int studentNumber = int.Parse(studentNumberString); 17 | 18 | Console.Write("Grade: "); 19 | string gradeString = Console.ReadLine(); 20 | int grade = int.Parse(gradeString); 21 | 22 | Console.WriteLine("-----------------------------------"); 23 | Console.WriteLine($"{name}\n{studentNumber}\n{grade}%"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /03/StringInterpolation/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StringInterpolation 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int num1 = 48; 10 | int num2 = 65; 11 | 12 | Console.WriteLine("The sum of " + num1 + " and " + num2 + " is " + (num1 + num2)); 13 | Console.WriteLine(string.Format("The sum of {0} and {1} is {2}", num1, num2, num1 + num2)); 14 | Console.WriteLine($"The sum of {num1} and {num2} is {num1 + num2}"); 15 | 16 | Console.WriteLine("\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x21"); 17 | Console.WriteLine(@"\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x21"); 18 | 19 | Console.WriteLine("{0,-11} + {1,11} = {2}", num1, num2, num1 + num2); 20 | Console.WriteLine("{0,-11} - {1,11} = {2}", num1, num2, num1 - num2); 21 | Console.WriteLine("{0,-11} * {1,11} = {2}", num1, num2, num1 * num2); 22 | Console.WriteLine("{0,-11} / {1,11} = {2:f4}", num1, num2, num1 / (float)num2); 23 | Console.WriteLine("{0,-11} % {1,11} = {2}", num2, num1, num2 % num1); 24 | 25 | Console.WriteLine(); 26 | 27 | Console.WriteLine(string.Format("{0,-11} + {1,11} = {2}", num1, num2, num1 + num2)); 28 | Console.WriteLine(string.Format("{0,-11} - {1,11} = {2}", num1, num2, num1 - num2)); 29 | Console.WriteLine(string.Format("{0,-11} * {1,11} = {2}", num1, num2, num1 * num2)); 30 | Console.WriteLine(string.Format("{0,-11} / {1,11} = {2:f4}", num1, num2, num1 / (float)num2)); 31 | Console.WriteLine(string.Format("{0,-11} % {1,11} = {2}", num2, num1, num2 % num1)); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /03/StringInterpolation/StringInterpolation.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /03/TypeConversion/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TypeConversion 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | char char1 = 'a'; 10 | 11 | int int1 = char1; 12 | Console.WriteLine("int1: " + int1); 13 | 14 | long long1 = char1; 15 | Console.WriteLine("long1: " + long1); 16 | 17 | ulong ulong1 = char1; 18 | Console.WriteLine("ulong1: " + ulong1); 19 | 20 | float float1 = char1; 21 | Console.WriteLine("float1: " + float1); 22 | 23 | double double1 = char1; 24 | Console.WriteLine("double1: " + double1); 25 | 26 | long long2 = long.MaxValue; 27 | int long2ToInt = (int)long2; 28 | 29 | Console.WriteLine("long2: " + long2); 30 | Console.WriteLine("long2ToInt: " + long2ToInt); 31 | 32 | float float2 = 3.14159f; 33 | int float2ToInt = (int)float2; 34 | 35 | Console.WriteLine("float2: " + float2); 36 | Console.WriteLine("float2ToInt: " + float2ToInt); 37 | 38 | int int2 = -1; 39 | uint int2ToUInt = (uint)int2; 40 | 41 | Console.WriteLine("int2ToUInt: " + int2ToUInt); 42 | 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /03/TypeConversion/TypeConversion.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /04/InsertStudentInformation2/InsertStudentInformation2.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /04/InsertStudentInformation2/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace InsertStudentInformation2 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Let's fill out student grade:"); 10 | 11 | Console.Write("Name: "); 12 | string name = Console.ReadLine(); 13 | 14 | Console.Write("Grade: "); 15 | string gradeString = Console.ReadLine(); 16 | int grade = int.Parse(gradeString); 17 | 18 | if (grade >= 90) 19 | { 20 | Console.Write("Excellent! You are an A student!"); 21 | } 22 | else if (grade >= 80) 23 | { 24 | Console.Write("Good! You are above average!"); 25 | } 26 | else if (grade >= 70) 27 | { 28 | Console.Write("Meh... You are doing alright..."); 29 | } 30 | else if (grade >= 50) 31 | Console.Write("Are you even trying? You can do better than that!"); // DON'T DO THIS!!! ALWAYS USE { } 32 | 33 | else 34 | { 35 | Console.Write("You have no talent... Maybe you should do something else?"); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /04/LogicalExpressions/LogicalExpressions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /04/LogicalExpressions/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicalExpressions 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int num1 = 1; 10 | int num2 = 1; 11 | int num3 = 4; 12 | 13 | bool bExpression1 = !(num1 == num2 && num1 != num3); 14 | bool bExpression2 = num1 != num2 || num1 == num3; 15 | 16 | Console.WriteLine($"expression1: {bExpression1}"); 17 | Console.WriteLine($"expression2: {bExpression2}"); 18 | 19 | bool bExpression3 = num1 > num2 || num1 == num3 || ++num1 > num2; 20 | Console.WriteLine($"expression3: {bExpression3}"); 21 | 22 | bool bExpression4 = num3 >= num2 || num1-- == num2; 23 | Console.WriteLine($"expression4: {bExpression4}"); 24 | 25 | bool bExpression5 = num3 == num1 && --num2 > num1; 26 | Console.WriteLine($"expression5: {bExpression5}"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /04/OrderOfExpressionEvaluation/OrderOfExpressionEvaluation.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /04/OrderOfExpressionEvaluation/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace OrderOfExpressionEvaluation 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int num1 = 5; 10 | int num2 = 15; 11 | int num3 = 2; 12 | 13 | int max1 = num1; 14 | if (num2 > max1) 15 | { 16 | max1 = num2; 17 | } 18 | 19 | if (num3 > max1) 20 | { 21 | max1 = num3; 22 | } 23 | 24 | Console.WriteLine($"max1: {max1}"); 25 | 26 | int max2 = num1; 27 | max2 = num2 > max2 ? num2 : max2; 28 | max2 = num3 > max2 ? num3 : max2; 29 | 30 | Console.WriteLine($"max2: {max2}"); 31 | 32 | int result1 = num1 * num2 + num2 + num2 - num3 * num1; 33 | Console.WriteLine($"result1: {result1}"); 34 | 35 | int result2 = num1 * num2 + (num2 + num2 - num3) * num1; 36 | Console.WriteLine($"result2: {result2}"); 37 | 38 | int result3 = num1 / (num2 + num1) + num1++; 39 | Console.WriteLine($"result3: {result3}"); 40 | 41 | int result4 = num3 >= num1 ? num1 : num3 + num1 * num2; 42 | Console.WriteLine($"result4: {result4}"); 43 | 44 | int result5 = num3 >= num1 ? num1 : (num3 + num1 * num2); 45 | Console.WriteLine($"result5: {result5}"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /05/AddTwo2dArrays/AddTwo2dArrays.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /05/AddTwo2dArrays/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AddTwo2dArrays 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | const int ROW_COUNT = 4; 10 | const int COLUMN_COUNT = 5; 11 | 12 | int[,] array1 = new int[ROW_COUNT, COLUMN_COUNT] 13 | { 14 | { 2, 3, 4, 10, 5 }, 15 | { 1, 11, -4, 4, 6 }, 16 | { -11, -4, 6, -3, -3 }, 17 | { 7, 17, 2, -4, 2 } 18 | }; 19 | 20 | int[,] array2 = new int[ROW_COUNT, COLUMN_COUNT] 21 | { 22 | { -2, 7, 10, -10, 1 }, 23 | { 2, 7, -6, -13, 6 }, 24 | { 10, 6, -6, 3, 1 }, 25 | { 7, 8, 7, -9, 1 } 26 | }; 27 | 28 | int[,] sumArray = new int[ROW_COUNT, COLUMN_COUNT]; 29 | 30 | for (int i = 0; i < ROW_COUNT; i++) 31 | { 32 | for (int j = 0; j < COLUMN_COUNT; j++) 33 | { 34 | sumArray[i, j] = array1[i, j] + array2[i, j]; 35 | } 36 | } 37 | 38 | Console.WriteLine("---Let's print this!---"); 39 | 40 | for (int i = 0; i < ROW_COUNT; i++) 41 | { 42 | for (int j = 0; j < COLUMN_COUNT; j++) 43 | { 44 | Console.Write("{0,10} ", sumArray[i, j]); 45 | } 46 | 47 | Console.WriteLine(); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /05/CalculatorWithSwitchStatement/CalculatorWithSwitchStatement.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /05/CalculatorWithSwitchStatement/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CalculatorWithSwitchStatement 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.Write("num1: "); 10 | string num1String = Console.ReadLine(); 11 | int num1 = int.Parse(num1String); 12 | 13 | Console.Write("num2: "); 14 | string num2String = Console.ReadLine(); 15 | int num2 = int.Parse(num2String); 16 | 17 | Console.Write("operation (+, -, *, /): "); 18 | string operation = Console.ReadLine(); 19 | 20 | switch (operation) 21 | { 22 | case "+": 23 | Console.WriteLine($"{num1} + {num2} = {num1 + num2}"); 24 | break; 25 | 26 | case "-": 27 | Console.WriteLine($"{num1} - {num2} = {num1 - num2}"); 28 | break; 29 | 30 | case "*": 31 | Console.WriteLine($"{num1} * {num2} = {num1 * num2}"); 32 | break; 33 | 34 | case "/": 35 | Console.WriteLine($"{num1} / {num2} = {num1 / num2}"); 36 | break; 37 | 38 | default: 39 | Console.WriteLine($"You entered a wrong operator: {operation}"); 40 | break; 41 | 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /05/InfiniteWhileLoop/InfiniteWhileLoop.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /05/InfiniteWhileLoop/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace InfiniteWhileLoop 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | while (true) 10 | { 11 | Console.Write("Input Number: "); 12 | string inputString = Console.ReadLine(); 13 | int input = int.Parse(inputString); 14 | 15 | if (input == 0) 16 | { 17 | break; 18 | } 19 | 20 | Console.WriteLine("Number in hex: 0x{0:x}", input); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /05/InsertStudentInformation3/InsertStudentInformation3.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /05/InsertStudentInformation3/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace InsertStudentInformation3 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Let's fill out student information:"); 10 | string[] names = new string[3]; 11 | string[] studentNumbers = new string[3]; 12 | int[] grades = new int[3]; 13 | 14 | Console.WriteLine("Fill out information for student 1."); 15 | 16 | Console.Write("Name: "); 17 | names[0] = Console.ReadLine(); 18 | 19 | Console.Write("Student Number: "); 20 | studentNumbers[0] = Console.ReadLine(); 21 | 22 | Console.Write("Grade: "); 23 | string gradeString = Console.ReadLine(); 24 | grades[0] = int.Parse(gradeString); 25 | 26 | Console.WriteLine(); 27 | Console.WriteLine("Fill out information for student 2."); 28 | 29 | Console.Write("Name: "); 30 | names[1] = Console.ReadLine(); 31 | 32 | Console.Write("Student Number: "); 33 | studentNumbers[1] = Console.ReadLine(); 34 | 35 | Console.Write("Grade: "); 36 | gradeString = Console.ReadLine(); 37 | grades[1] = int.Parse(gradeString); 38 | 39 | Console.WriteLine(); 40 | Console.WriteLine("Fill out information for student 3."); 41 | 42 | Console.Write("Name: "); 43 | names[2] = Console.ReadLine(); 44 | 45 | Console.Write("Student Number: "); 46 | studentNumbers[2] = Console.ReadLine(); 47 | 48 | Console.Write("Grade: "); 49 | gradeString = Console.ReadLine(); 50 | grades[2] = int.Parse(gradeString); 51 | 52 | Console.WriteLine("-----------------------------------"); 53 | Console.WriteLine("1 {0,-20} {1,-20} {2}%", names[0], studentNumbers[0], grades[0]); 54 | Console.WriteLine("2 {0,-20} {1,-20} {2}%", names[1], studentNumbers[1], grades[1]); 55 | Console.WriteLine("3 {0,-20} {1,-20} {2}%", names[2], studentNumbers[2], grades[2]); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /05/Sum/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Sum 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | const int MAX = 100; 10 | 11 | Console.WriteLine($"Sum of 1 - {MAX}"); 12 | 13 | int sum = 0; 14 | for (int i = 0; i < MAX; i++) 15 | { 16 | sum += (i + 1); 17 | } 18 | 19 | Console.WriteLine(sum); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /05/Sum/Sum.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /06/CalculatorUsingEnum/CalculatorUsingEnum.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /06/CalculatorUsingEnum/EOperator.cs: -------------------------------------------------------------------------------- 1 | namespace CalculatorUsingEnum 2 | { 3 | enum EOperator 4 | { 5 | Plus = '+', 6 | Minus = '-', 7 | Multiply = '*', 8 | Divide = '/', 9 | Mod = '%' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /06/CalculatorUsingEnum/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CalculatorUsingEnum 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.Write("num1: "); 10 | string num1String = Console.ReadLine(); 11 | int num1 = int.Parse(num1String); 12 | 13 | Console.Write("num2: "); 14 | string num2String = Console.ReadLine(); 15 | int num2 = int.Parse(num2String); 16 | 17 | Console.Write("operation (+, -, *, /, %): "); 18 | string operationString = Console.ReadLine(); 19 | char operationChar = char.Parse(operationString); 20 | 21 | EOperator operation = (EOperator)operationChar; 22 | 23 | switch (operation) 24 | { 25 | case EOperator.Plus: 26 | Console.WriteLine($"{num1} + {num2} = {num1 + num2}"); 27 | break; 28 | 29 | case EOperator.Minus: 30 | Console.WriteLine($"{num1} - {num2} = {num1 - num2}"); 31 | break; 32 | 33 | case EOperator.Multiply: 34 | Console.WriteLine($"{num1} * {num2} = {num1 * num2}"); 35 | break; 36 | 37 | case EOperator.Divide: 38 | Console.WriteLine($"{num1} / {num2} = {num1 / num2}"); 39 | break; 40 | 41 | default: 42 | Console.WriteLine($"You entered a wrong operator: {operationChar}"); 43 | break; 44 | 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /06/CallByValueAndCallByReference/CallByValueAndCallByReference.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /06/CallByValueAndCallByReference/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CallByValueAndCallByReference 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int num1 = 0; 10 | 11 | IncrementByValue(num1, 2, 5); 12 | 13 | Console.WriteLine($"num1 after IncrementByValue(): {num1}"); 14 | 15 | IncrementByReference(ref num1, 2, 5); 16 | 17 | Console.WriteLine($"num1 after IncrementByReference(): {num1}"); 18 | } 19 | 20 | static void IncrementByValue(int num, int increment, int incrementCount) 21 | { 22 | for (int i = 0; i < incrementCount; i++) 23 | { 24 | num += increment; 25 | } 26 | } 27 | 28 | static void IncrementByReference(ref int num, int increment, int incrementCount) 29 | { 30 | for (int i = 0; i < incrementCount; i++) 31 | { 32 | num += increment; 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /06/Functions/Functions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /06/Functions/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Functions 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int x = 4; 10 | int y = 7; 11 | 12 | int sum1 = x + y; 13 | int sum2 = Add(x, y); 14 | 15 | Console.WriteLine($"x + y = {sum1}"); 16 | Console.WriteLine($"Add(x, y) = {sum2}"); 17 | 18 | int difference1 = x - y; 19 | int difference2 = Subtract(x, y); 20 | 21 | Console.WriteLine($"x - y = {difference1}"); 22 | Console.WriteLine($"Subtract(x, y) = {difference2}"); 23 | 24 | int product1 = x * y; 25 | int product2 = Multiply(x, y); 26 | 27 | Console.WriteLine($"x * y = {product1}"); 28 | Console.WriteLine($"Multiply(x, y) = {product2}"); 29 | 30 | int resultOfA = A(x, y); 31 | 32 | Console.WriteLine($"A(x, y) = {resultOfA}"); 33 | } 34 | 35 | static int Add(int x, int y) 36 | { 37 | int sum = x + y; 38 | return sum; 39 | } 40 | 41 | static int Subtract(int x, int y) 42 | { 43 | int difference = x - y; 44 | return difference; 45 | } 46 | 47 | static int Multiply(int x, int y) 48 | { 49 | int product = x * y; 50 | return product; 51 | } 52 | 53 | static int A(int x, int y) 54 | { 55 | if (y == 0) 56 | { 57 | return 1; 58 | } 59 | 60 | int product = 1; 61 | for (int i = 0; i < y; i++) 62 | { 63 | product *= x; 64 | } 65 | 66 | return product; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /06/InputValidationUsingAssert/InputValidationUsingAssert.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /06/InputValidationUsingAssert/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | 4 | namespace InputValidationUsingAssert 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | double quotient1 = Divide(2, 1); 11 | double quotient2 = Divide(3, 6); 12 | 13 | // double quotient3 = Divide(5, 0); 14 | 15 | int[] numbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; 16 | 17 | PrintRange(0, 10, numbers); 18 | PrintRange(3, 7, numbers); 19 | PrintRange(8, 10, numbers); 20 | 21 | //PrintRange(-1, 3, numbers); 22 | //PrintRange(2, -10, numbers); 23 | 24 | } 25 | 26 | static double Divide(int x, int y) 27 | { 28 | Debug.Assert(y != 0, "y cannot be 0"); 29 | 30 | double quotient = x / (double)y; 31 | return quotient; 32 | } 33 | 34 | static void PrintRange(int start, int end, int[] numbers) 35 | { 36 | Debug.Assert(start >= 0, "start cannot be less than 0"); 37 | Debug.Assert(end >= 0, "end cannot be less than 0"); 38 | 39 | Console.Write("["); 40 | 41 | for (int i = start; i < end; i++) 42 | { 43 | Console.Write($"{numbers[i]}, "); 44 | } 45 | 46 | if (numbers.Length > 0) 47 | { 48 | Console.Write(numbers[numbers.Length - 1]); 49 | } 50 | 51 | Console.WriteLine("]"); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /06/Scope/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Scope 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int[] numbers = new int[] { 1, -3, 4, -10, 4, 2, 9, 15 }; 10 | double average = GetAverage(numbers); 11 | 12 | Console.WriteLine($"average: {average}"); 13 | 14 | { 15 | //int average = 0; // Compile error! 16 | string message = "Message in the first child scope!"; 17 | Console.WriteLine(message); 18 | } 19 | 20 | { 21 | //int average = 0; // Compile error! 22 | string message = "Message in the second child scope!"; 23 | Console.WriteLine(message); 24 | } 25 | } 26 | 27 | static double GetAverage(int[] inputs) 28 | { 29 | int sum = 0; 30 | 31 | //for (int i = 0; i < numbers.Length; i++) 32 | //{ 33 | // sum += numbers[i]; 34 | //} 35 | 36 | for (int i = 0; i < inputs.Length; i++) 37 | { 38 | sum += inputs[i]; 39 | } 40 | 41 | return (double)sum / inputs.Length; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /06/Scope/Scope.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /07/RandomShuffling/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RandomShuffling 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | const int SEED = 0; 10 | int[] numbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }; 11 | 12 | Console.WriteLine("Before shuffling:"); 13 | Console.WriteLine($"[{string.Join(", ", numbers)}]"); 14 | 15 | Random random = new Random(SEED); 16 | 17 | for (int i = numbers.Length - 1; i > 0; i--) 18 | { 19 | int j = random.Next(0, i); 20 | int temp = numbers[j]; 21 | numbers[j] = numbers[i]; 22 | numbers[i] = temp; 23 | } 24 | 25 | Console.WriteLine("After shuffling:"); 26 | Console.WriteLine($"[{string.Join(", ", numbers)}]"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /07/RandomShuffling/RandomShuffling.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /07/RecursiveFactorial/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RecursiveFactorial 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | const ulong FACTORIAL = 10; 10 | 11 | Console.WriteLine("NonRecursiveFactorial:"); 12 | Console.WriteLine(NonRecursiveFactorial(FACTORIAL)); 13 | 14 | Console.WriteLine("RecursiveFactorial:"); 15 | Console.WriteLine(RecursiveFactorial(FACTORIAL)); 16 | } 17 | 18 | static ulong NonRecursiveFactorial(ulong n) 19 | { 20 | if (n <= 1) 21 | { 22 | return 1; 23 | } 24 | 25 | uint factorial = 1; 26 | 27 | for (uint i = 2; i <= n; i++) 28 | { 29 | factorial *= i; 30 | } 31 | 32 | return factorial; 33 | } 34 | 35 | static ulong RecursiveFactorial(ulong n) 36 | { 37 | if (n == 0) 38 | { 39 | return 1; 40 | } 41 | 42 | return RecursiveFactorial(n - 1) * n; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /07/RecursiveFactorial/RecursiveFactorial.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /09/ArrayOfArrays/ArrayOfArrays.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /09/ArrayOfArrays/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ArrayOfArrays 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | const int MONTHS_IN_A_YEAR = 12; 10 | int[] daysInEachMonth = new int[MONTHS_IN_A_YEAR] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 11 | 12 | string[][] calendar = new string[MONTHS_IN_A_YEAR][]; 13 | 14 | for (int i = 0; i < MONTHS_IN_A_YEAR; i++) 15 | { 16 | calendar[i] = new string[daysInEachMonth[i]]; 17 | } 18 | 19 | while (true) 20 | { 21 | Console.Write("Enter the Month (1 - 12): "); 22 | string monthString = Console.ReadLine(); 23 | int month = int.Parse(monthString); 24 | 25 | if (0 >= month || month > 12) 26 | { 27 | Console.WriteLine("Invalid range of month. Terminating program"); 28 | break; 29 | } 30 | 31 | Console.Write($"Enter the Day (1 - {calendar[month - 1].Length}): "); 32 | string dayString = Console.ReadLine(); 33 | int day = int.Parse(dayString); 34 | 35 | if (0 >= day || day > calendar[month - 1].Length) 36 | { 37 | Console.WriteLine("Invalid range of day. Terminating program"); 38 | break; 39 | } 40 | 41 | Console.WriteLine("Enter your schedule: "); 42 | string schedule = Console.ReadLine(); 43 | calendar[month - 1][day - 1] = schedule; 44 | 45 | Console.WriteLine("-----------------------------"); 46 | for (int i = 0; i < MONTHS_IN_A_YEAR; i++) 47 | { 48 | for (int j = 0; j < calendar[i].Length; j++) 49 | { 50 | if (!string.IsNullOrEmpty(calendar[i][j])) 51 | { 52 | Console.WriteLine($"{i + 1} / {j + 1}: {calendar[i][j]}"); 53 | } 54 | } 55 | } 56 | Console.WriteLine("-----------------------------"); 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /09/DefaultParameters/DefaultParameters.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /09/DefaultParameters/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DefaultParameters 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Bar("POCU"); 10 | Bar("POCU", "COMP1500"); 11 | Bar("POCU", "COMP1500", "Intro to programming!"); 12 | } 13 | 14 | static void Bar(string s, string s2 = "", string s3 = "") 15 | { 16 | Console.WriteLine($"{s}, {s2}, {s3}"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /09/FunctionOverloading/FunctionOverloading.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /09/FunctionOverloading/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FunctionOverloading 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Foo(); 10 | Foo(10); 11 | Foo("POCU"); 12 | Foo("POCU", "COMP1500", "Intro to programming!"); 13 | } 14 | 15 | static void Foo() 16 | { 17 | Console.WriteLine("Foo with no arguments."); 18 | } 19 | 20 | static void Foo(int x) 21 | { 22 | Console.WriteLine($"Foo with {typeof(int).Name}: {x} as an argument."); 23 | } 24 | 25 | //static int Foo(int x) 26 | //{ 27 | // return x + 1; 28 | //} 29 | 30 | static void Foo(string s) 31 | { 32 | Console.WriteLine($"Foo with {typeof(string).Name}: {s} as an argument."); 33 | } 34 | 35 | static void Foo(string s1, string s2, string s3) 36 | { 37 | Console.WriteLine($"Foo with {typeof(string).Name}: {s1}, {typeof(string).Name}: {s2} and {typeof(string).Name}: {s3} as an argument."); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /09/OutParameterModifier/OutParameterModifier.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /09/OutParameterModifier/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace OutParameterModifier 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Enter \"true\" or \"false\":"); 10 | string booleanString = Console.ReadLine(); 11 | 12 | bool b; 13 | if (bool.TryParse(booleanString, out b)) 14 | { 15 | Console.WriteLine($"Successfully parsed: {b}"); 16 | } 17 | else 18 | { 19 | Console.WriteLine("Cannot be parsed to boolean"); 20 | } 21 | 22 | Console.WriteLine("Enter an integer:"); 23 | string intString = Console.ReadLine(); 24 | 25 | int number; 26 | if (int.TryParse(intString, out number)) 27 | { 28 | Console.WriteLine($"Successfully parsed: {number}"); 29 | } 30 | else 31 | { 32 | Console.WriteLine("Cannot be parsed to integer"); 33 | } 34 | 35 | int someNumber = 5; 36 | 37 | int randomNumber; 38 | if (TryGetIntegerGreaterThan(someNumber, out randomNumber)) 39 | { 40 | Console.WriteLine($"Great! {randomNumber} > {someNumber}"); 41 | } 42 | else 43 | { 44 | Console.WriteLine($"Failed to get an integer greater than {someNumber}"); 45 | } 46 | } 47 | 48 | static bool TryGetIntegerGreaterThan(int input, out int output) 49 | { 50 | var random = new Random(); 51 | 52 | output = random.Next(0, 10); 53 | 54 | return output > input; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /09/ParseTextMessage/ParseTextMessage.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | PreserveNewest 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /09/ParseTextMessage/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace ParseTextMessage 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | string textMessage = File.ReadAllText(@"TextMessage.txt"); 11 | 12 | // [ "[POCU Web Message]", "Monday 2019-04-15 13:21:54.456", "student1234@fakeemail.com ", "Course COMP1500", "Term 201905" ] 13 | string[] lines = textMessage.Split('\n'); 14 | 15 | // [ "Monday", "2019-04-15", "13:21:54.456" ] 16 | string[] dateTimeString = lines[1].Split(' '); 17 | string nameOfDay = dateTimeString[0]; 18 | 19 | // [ "2019", "04", "15" ] 20 | string[] date = dateTimeString[1].Split('-'); 21 | 22 | int year = int.Parse(date[0]); 23 | int month = int.Parse(date[1]); 24 | int day = int.Parse(date[2]); 25 | 26 | // [ "13", "21", "54.456" ] 27 | string[] time = dateTimeString[2].Split(':'); 28 | 29 | int hours = int.Parse(time[0]); 30 | int mins = int.Parse(time[1]); 31 | float seconds = float.Parse(time[2]); 32 | 33 | string email = lines[2].Trim(); 34 | 35 | string courseCode = lines[3].Replace("Course", "").Trim(); 36 | string term = lines[4].Replace("Term", "").Trim(); 37 | 38 | Console.WriteLine($"Name of Day: {nameOfDay}"); 39 | Console.WriteLine($"Year: {year}"); 40 | Console.WriteLine($"Month: {month}"); 41 | Console.WriteLine($"Day: {day}"); 42 | Console.WriteLine($"Hours: {hours}"); 43 | Console.WriteLine($"Minutes: {mins}"); 44 | Console.WriteLine($"Seconds: {seconds}"); 45 | Console.WriteLine($"Email: {email}"); 46 | Console.WriteLine($"Course Code: {courseCode}"); 47 | Console.WriteLine($"Term: {term}"); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /09/ParseTextMessage/TextMessage.txt: -------------------------------------------------------------------------------- 1 | [POCU Web Message] 2 | Monday 2019-04-15 13:21:54.456 3 | student1234@fakeemail.com 4 | Course COMP1500 5 | Term 201905 -------------------------------------------------------------------------------- /10/Dictionary/Dictionary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /10/Dictionary/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DictionaryExample 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | List list = new List(); 11 | 12 | Random random = new Random(); 13 | 14 | for (int i = 0; i < 20; i++) 15 | { 16 | int number = random.Next(0, 10); 17 | list.Add(number); 18 | } 19 | 20 | Console.WriteLine($"[ {string.Join(", ", list)} ]"); 21 | 22 | Dictionary dictionary = new Dictionary(); 23 | 24 | for (int i = 0; i < list.Count; i++) 25 | { 26 | if (dictionary.ContainsKey(list[i])) 27 | { 28 | list.Remove(list[i]); 29 | } 30 | else 31 | { 32 | dictionary.Add(list[i], true); 33 | } 34 | } 35 | 36 | Console.WriteLine($"[ {string.Join(", ", list)} ]"); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /10/FloatVsDoubleVsDecimal/FloatVsDoubleVsDecimal.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /10/FloatVsDoubleVsDecimal/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FloatVsDoubleVsDecimal 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | float[] floats = new float[] { 2.342f, 9.326f, 3.445f, 5.713f, 2.458f, 3.689f, 10.121f, 4.786f, 6.664f, 18.341f, 0.123f }; 10 | 11 | float averageFloat = GetAverage(floats); 12 | 13 | Console.WriteLine($"Average in float: {averageFloat:G9}"); 14 | 15 | double[] doubles = new double[] { 2.342, 9.326, 3.445, 5.713, 2.458, 3.689, 10.121, 4.786, 6.664, 18.341, 0.123 }; 16 | 17 | double averageDouble = GetAverage(doubles); 18 | 19 | Console.WriteLine($"Average in double: {averageDouble:G17}"); 20 | 21 | decimal[] decimals = new decimal[] { 2.342m, 9.326m, 3.445m, 5.713m, 2.458m, 3.689m, 10.121m, 4.786m, 6.664m, 18.341m, 0.123m }; 22 | 23 | decimal averageDecimal = GetAverage(decimals); 24 | 25 | Console.WriteLine($"Average in decimal: {averageDecimal}"); 26 | } 27 | 28 | static float GetAverage(float[] floats) 29 | { 30 | float sum = 0; 31 | foreach (float f in floats) 32 | { 33 | sum += f; 34 | } 35 | 36 | return sum / floats.Length; 37 | } 38 | 39 | static double GetAverage(double[] doubles) 40 | { 41 | double sum = 0; 42 | foreach (double d in doubles) 43 | { 44 | sum += d; 45 | } 46 | 47 | return sum / doubles.Length; 48 | } 49 | 50 | static decimal GetAverage(decimal[] decimals) 51 | { 52 | decimal sum = 0; 53 | foreach (decimal d in decimals) 54 | { 55 | sum += d; 56 | } 57 | 58 | return sum / decimals.Length; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /10/ForEachLoop/ForEachLoop.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /10/ForEachLoop/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ForEachLoop 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | List list = new List(); 11 | 12 | Random random = new Random(); 13 | 14 | for (int i = 0; i < 20; i++) 15 | { 16 | int number = random.Next(0, 10); 17 | list.Add(number); 18 | } 19 | 20 | int sum = 0; 21 | 22 | foreach(int i in list) 23 | { 24 | sum += i; 25 | } 26 | 27 | Console.WriteLine($"Sum: {sum}"); 28 | 29 | Console.WriteLine("----------------------------------"); 30 | 31 | Dictionary dictionary = new Dictionary 32 | { 33 | { "key1", 1 }, 34 | { "key2", 2 }, 35 | { "key3", 3 }, 36 | { "key4", 4 }, 37 | { "key5", 5 }, 38 | { "key6", 6 }, 39 | }; 40 | 41 | foreach (KeyValuePair entry in dictionary) 42 | { 43 | Console.WriteLine($"{entry.Key}: {entry.Value}"); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /10/List/List.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /10/List/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ListExample 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | const int ELEMENTS_COUNT = 10; 11 | 12 | List list = new List(); 13 | for (int i = 0; i < ELEMENTS_COUNT; i++) 14 | { 15 | list.Add(i); 16 | } 17 | 18 | Console.WriteLine($"[ {string.Join(", ", list)} ]"); 19 | 20 | List list2 = new List { 1, 2, 3, 4, 5, 6 }; 21 | 22 | Console.WriteLine($"[ {string.Join(", ", list2)} ]"); 23 | 24 | Console.WriteLine($"First element: {list[0]}"); 25 | Console.WriteLine($"Last element: {list[list.Count - 1]}"); 26 | 27 | list.Insert(2, 2); 28 | 29 | Console.WriteLine($"[ {string.Join(", ", list)} ]"); 30 | 31 | list.Remove(2); 32 | 33 | Console.WriteLine($"[ {string.Join(", ", list)} ]"); 34 | 35 | bool bContains5 = list.Contains(5); 36 | 37 | Console.WriteLine($"Contains 5? {bContains5}"); 38 | 39 | bool bContains10 = list.Contains(10); 40 | 41 | Console.WriteLine($"Contains 10? {bContains10}"); 42 | 43 | int sum = 0; 44 | for (int i = 0; i < list.Count; i++) 45 | { 46 | sum += list[i]; 47 | } 48 | 49 | Console.WriteLine($"Sum: {sum}"); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /10/StringBuilder/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace StringBuilderExample 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | const int CAPACITY = 1000; 11 | StringBuilder builder = new StringBuilder(CAPACITY); 12 | builder.Append("Hello World!"); 13 | builder.AppendLine(" Welcome to COMP1500!"); 14 | builder.AppendLine("Are you having fun yet?"); 15 | 16 | Console.WriteLine(builder.ToString()); 17 | 18 | builder.Insert(12, " Going to insert this here."); 19 | 20 | Console.WriteLine(builder.ToString()); 21 | 22 | builder.Replace(" Going to insert this here.", " And replace this."); 23 | 24 | Console.WriteLine(builder.ToString()); 25 | 26 | builder.Remove(12, 19); 27 | 28 | Console.WriteLine(builder.ToString()); 29 | 30 | builder.Clear(); 31 | 32 | Console.WriteLine(builder.ToString()); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /10/StringBuilder/StringBuilder.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /10/StringConcatVsStringBuilder/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Text; 4 | 5 | namespace StringConcatVsStringBuilder 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | const int LOOP_COUNT = 1000; 12 | 13 | Stopwatch stopWatch = new Stopwatch(); 14 | 15 | #region USING_CONCATENATION 16 | stopWatch.Start(); 17 | 18 | string concatenated = string.Empty; 19 | for (int i = 0; i < LOOP_COUNT; i++) 20 | { 21 | concatenated += "test"; 22 | } 23 | 24 | stopWatch.Stop(); 25 | Console.WriteLine($"Time elapsed in ms (Concatenated): {stopWatch.Elapsed.TotalMilliseconds}"); 26 | #endregion 27 | 28 | stopWatch.Reset(); 29 | 30 | #region USING_STRING_BUILDER 31 | stopWatch.Start(); 32 | 33 | StringBuilder stringBuilder = new StringBuilder(4096); 34 | for (int i = 0; i < LOOP_COUNT; i++) 35 | { 36 | stringBuilder.Append("test"); 37 | } 38 | 39 | string s = stringBuilder.ToString(); 40 | 41 | stopWatch.Stop(); 42 | Console.WriteLine($"Time elapsed in ms (StringBuilder): {stopWatch.Elapsed.TotalMilliseconds}"); 43 | #endregion 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /10/StringConcatVsStringBuilder/StringConcatVsStringBuilder.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /11/Class/Class.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /11/Class/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Class 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Warrior warrior = new Warrior("Chuck"); 10 | 11 | warrior.Introduce(); 12 | warrior.GetStatus(); 13 | 14 | //warrior.Name = "Peter"; 15 | 16 | warrior.SwordStrike(); 17 | warrior.UseWhirlwind(); 18 | warrior.UseWhirlwind(); 19 | warrior.UseWhirlwind(); 20 | warrior.Rest(); 21 | 22 | warrior.GetStatus(); 23 | 24 | warrior.Health -= 200; 25 | //warrior.mHealth = 5000; 26 | 27 | warrior.GetStatus(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /11/Class/Warrior.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Class 4 | { 5 | public class Warrior 6 | { 7 | private const int MAX_HEALTH = 500; 8 | private const int MAX_MANA = 50; 9 | private const int MAX_STAMINA = 200; 10 | 11 | private int mHealth = MAX_HEALTH; 12 | private int mMana = MAX_MANA; 13 | private int mStamina = MAX_STAMINA; 14 | 15 | public string Name { get; private set; } 16 | 17 | public int Health 18 | { 19 | get 20 | { 21 | return mHealth; 22 | } 23 | set 24 | { 25 | mHealth = value; 26 | 27 | if (mHealth < 0) 28 | { 29 | mHealth = 0; 30 | } 31 | 32 | if (mHealth > MAX_HEALTH) 33 | { 34 | mHealth = MAX_HEALTH; 35 | } 36 | } 37 | } 38 | 39 | public int Mana 40 | { 41 | get 42 | { 43 | return mMana; 44 | } 45 | set 46 | { 47 | mMana = value; 48 | 49 | if (mMana < 0) 50 | { 51 | mMana = 0; 52 | } 53 | 54 | if (mMana > MAX_MANA) 55 | { 56 | mMana = MAX_MANA; 57 | } 58 | } 59 | } 60 | 61 | public int Stamina 62 | { 63 | get 64 | { 65 | return mStamina; 66 | } 67 | set 68 | { 69 | mStamina = value; 70 | 71 | if (mStamina < 0) 72 | { 73 | mStamina = 0; 74 | } 75 | 76 | if (mStamina > MAX_STAMINA) 77 | { 78 | mStamina = MAX_STAMINA; 79 | } 80 | } 81 | } 82 | 83 | public Warrior(string name) 84 | { 85 | Name = name; 86 | } 87 | 88 | public void Introduce() 89 | { 90 | Console.WriteLine($"I'm {Name}! Honour and glory!! THIS IS SPARTA!!"); 91 | } 92 | 93 | public void UseWhirlwind() 94 | { 95 | if (Mana < 5 || Stamina < 70) 96 | { 97 | Console.WriteLine($"{Name} can't use Whirlwind!"); 98 | return; 99 | } 100 | 101 | Mana -= 5; 102 | Stamina -= 70; 103 | 104 | Console.WriteLine($"{Name} used Whilrwind!"); 105 | } 106 | 107 | public void SwordStrike() 108 | { 109 | if (Stamina < 20) 110 | { 111 | Console.WriteLine($"{Name} can't use SwordStrike!"); 112 | return; 113 | } 114 | 115 | Stamina -= 20; 116 | 117 | Console.WriteLine($"{Name} used SwordStrike!"); 118 | } 119 | 120 | public void Rest() 121 | { 122 | Mana += 2; 123 | Stamina += 5; 124 | Health += 5; 125 | 126 | Console.WriteLine($"{Name} is resting."); 127 | } 128 | 129 | public void GetStatus() 130 | { 131 | Console.WriteLine($"{Name} - Health: {Health} / Mana: {Mana} / Stamina: {Stamina}"); 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /11/ExtensionMethod/ExtensionMethod.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /11/ExtensionMethod/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ExtensionMethod 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | const string HELLO_WORLD = "Hello World!"; 10 | 11 | string reversed = HELLO_WORLD.Reverse(); 12 | 13 | Console.WriteLine(reversed); 14 | 15 | string reversed2 = HELLO_WORLD.Reverse(2, 8); 16 | 17 | Console.WriteLine(reversed2); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /11/ExtensionMethod/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace ExtensionMethod 4 | { 5 | public static class StringExtensions 6 | { 7 | public static string Reverse(this string s) 8 | { 9 | StringBuilder sb = new StringBuilder(s.Length); 10 | 11 | for (int i = s.Length - 1; i >= 0; i--) 12 | { 13 | sb.Append(s[i]); 14 | } 15 | 16 | return sb.ToString(); 17 | } 18 | 19 | public static string Reverse(this string s, int start, int end) 20 | { 21 | if (start < 0 || end > s.Length || start > end - 1) 22 | { 23 | return s; 24 | } 25 | 26 | StringBuilder sb = new StringBuilder(s.Length); 27 | 28 | for (int i = 0; i < start; i++) 29 | { 30 | sb.Append(s[i]); 31 | } 32 | 33 | for (int i = end - 1; i >= start; i--) 34 | { 35 | sb.Append(s[i]); 36 | } 37 | 38 | for (int i = end; i < s.Length; i++) 39 | { 40 | sb.Append(s[i]); 41 | } 42 | 43 | return sb.ToString(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /11/PartialClass/PartialClass.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /11/PartialClass/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PartialClass 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Robot robot = new Robot("Taekwon V"); 10 | 11 | Console.WriteLine(robot.Name); 12 | 13 | robot.ShootLaserBeam(); 14 | robot.ShootMissiles(); 15 | robot.Nuke(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /11/PartialClass/Robot.LeftArm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PartialClass 4 | { 5 | public partial class Robot 6 | { 7 | public string Name { get; private set; } 8 | 9 | public Robot(string name) 10 | { 11 | Name = name; 12 | } 13 | 14 | public void ShootLaserBeam() 15 | { 16 | Console.WriteLine($"{Name} shooting laser beam!"); 17 | } 18 | 19 | public void ShootMissiles() 20 | { 21 | Console.WriteLine($"{Name} shooting missiles!"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /11/PartialClass/Robot.RightArm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PartialClass 4 | { 5 | public partial class Robot 6 | { 7 | //public Robot(string name) 8 | //{ 9 | // Name = name; 10 | //} 11 | 12 | //public void ShootLaserBeam() 13 | //{ 14 | // Console.WriteLine($"{Name} Shooting laser beam!"); 15 | //} 16 | 17 | public void Nuke() 18 | { 19 | Console.WriteLine($"{Name}: Nuclear launch detected!"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /11/StaticClass/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StaticClass 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | double centimeters = UnitConverter.GetCentimetersFromInches(1.24); 10 | double feet = UnitConverter.GetFeetFromInches(12); 11 | double inches = UnitConverter.GetInchesFromCentimeters(5.7); 12 | double meters = UnitConverter.GetMetersFromCentimeters(254.92); 13 | 14 | Console.WriteLine(centimeters); 15 | Console.WriteLine(feet); 16 | Console.WriteLine(inches); 17 | Console.WriteLine(meters); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /11/StaticClass/StaticClass.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /11/StaticClass/UnitConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StaticClass 4 | { 5 | public static class UnitConverter 6 | { 7 | public static double GetInchesFromCentimeters(double centimeters) 8 | { 9 | return centimeters * 0.393701; 10 | } 11 | 12 | public static double GetCentimetersFromInches(double inches) 13 | { 14 | return inches / 0.393701; 15 | } 16 | 17 | public static double GetMetersFromCentimeters(double centimeters) 18 | { 19 | return centimeters / 100; 20 | } 21 | 22 | public static double GetFeetFromInches(double inches) 23 | { 24 | return inches / 12; 25 | } 26 | 27 | //public void SomeMethod() 28 | //{ 29 | // Console.WriteLine("Won't compile!"); 30 | //} 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /11/StaticMethod/CourseCode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StaticMethod 4 | { 5 | public class CourseCode 6 | { 7 | public CourseCode(ESubject subject, ushort number) 8 | { 9 | Subject = subject; 10 | Number = number; 11 | } 12 | 13 | public ESubject Subject { get; private set; } 14 | 15 | public ushort Number { get; private set; } 16 | 17 | public static CourseCode Parse(string courseCodeString) 18 | { 19 | string subjectString = courseCodeString.Substring(0, 4); 20 | 21 | ESubject subject = Enum.Parse(subjectString); 22 | 23 | string numberString = courseCodeString.Substring(4); 24 | 25 | ushort number = ushort.Parse(numberString); 26 | 27 | return new CourseCode(subject, number); 28 | } 29 | 30 | public static bool TryParse(string courseCodeString, out CourseCode courseCode) 31 | { 32 | courseCode = null; 33 | if (string.IsNullOrWhiteSpace(courseCodeString) || courseCodeString.Length != 8) 34 | { 35 | return false; 36 | } 37 | 38 | string subjectString = courseCodeString.Substring(0, 4); 39 | 40 | ESubject subject; 41 | if (!Enum.TryParse(subjectString, out subject)) 42 | { 43 | return false; 44 | } 45 | 46 | string numberString = courseCodeString.Substring(4); 47 | 48 | ushort number; 49 | if (!ushort.TryParse(numberString, out number)) 50 | { 51 | return false; 52 | } 53 | 54 | courseCode = new CourseCode(subject, number); 55 | return true; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /11/StaticMethod/ESubject.cs: -------------------------------------------------------------------------------- 1 | namespace StaticMethod 2 | { 3 | public enum ESubject 4 | { 5 | COMP, 6 | MATH 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /11/StaticMethod/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StaticMethod 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | CourseCode courseCode1 = new CourseCode(ESubject.COMP, 3200); 10 | 11 | Console.WriteLine($"{courseCode1.Subject} {courseCode1.Number}"); 12 | 13 | CourseCode courseCode2 = CourseCode.Parse("MATH1100"); 14 | Console.WriteLine($"{courseCode2.Subject} {courseCode2.Number}"); 15 | 16 | //CourseCode.Parse("What is this madness!"); 17 | 18 | CourseCode courseCode3; 19 | bool bParsed = CourseCode.TryParse("What is this madness!", out courseCode3); 20 | 21 | Console.WriteLine($"Parsed: {bParsed}"); 22 | 23 | CourseCode courseCode4; 24 | bParsed = CourseCode.TryParse("MATH1100", out courseCode4); 25 | 26 | Console.WriteLine($"Parsed: {bParsed}"); 27 | Console.WriteLine($"{courseCode4.Subject} {courseCode4.Number}"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /11/StaticMethod/StaticMethod.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /12/LINQ/LINQ.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /12/LINQ/Order.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace LINQ 4 | { 5 | public class Order 6 | { 7 | public long ID { get; set; } 8 | 9 | public string UserID { get; set; } 10 | 11 | public List OrderItems { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /12/LINQ/OrderItem.cs: -------------------------------------------------------------------------------- 1 | namespace LINQ 2 | { 3 | public class OrderItem 4 | { 5 | public long ID { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public uint Quantity { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /12/LINQ/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace LINQ 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | List orders = getOrders(); 12 | 13 | Order petersFirstOrder = orders.Where(o => o.UserID == "Peter").FirstOrDefault(); 14 | 15 | Console.WriteLine($"Peter's first order: {petersFirstOrder.ID}"); 16 | 17 | petersFirstOrder = orders.FirstOrDefault(o => o.UserID == "Peter"); 18 | 19 | Console.WriteLine($"Peter's first order: {petersFirstOrder.ID}"); 20 | 21 | List petersOrders = orders.Where(o => o.UserID == "Peter").ToList(); 22 | 23 | if (petersOrders.Any()) 24 | { 25 | Console.WriteLine($"Peter has {petersOrders.Count} orders!"); 26 | } 27 | 28 | List petersOrderItems = petersOrders.SelectMany(o => o.OrderItems).ToList(); 29 | 30 | printOrderItems(petersOrderItems); 31 | 32 | List petersOrderItemsorderedByIdDesc = petersOrderItems.OrderByDescending(o => o.ID).ToList(); 33 | 34 | printOrderItems(petersOrderItemsorderedByIdDesc); 35 | 36 | List orderedByPrice = petersOrderItems.OrderBy(o => o.Price).ToList(); 37 | 38 | printOrderItems(orderedByPrice); 39 | 40 | List productList = petersOrderItems.Select(oi => oi.Name).ToList(); 41 | 42 | Console.WriteLine($"Peter bought: {string.Join(", ", productList)}"); 43 | 44 | List allOrderItems = orders.SelectMany(o => o.OrderItems).ToList(); 45 | 46 | decimal totalPrice = allOrderItems.Sum(oi => oi.Price * oi.Quantity); 47 | 48 | Console.WriteLine($"Total Price of all order items: {totalPrice}"); 49 | 50 | } 51 | 52 | #region HELPER_METHODS 53 | private static List getOrders() 54 | { 55 | List orders = new List 56 | { 57 | new Order 58 | { 59 | ID = 1, 60 | UserID = "Peter", 61 | OrderItems = new List 62 | { 63 | new OrderItem 64 | { 65 | ID = 1, 66 | Name = "GTX1080", 67 | Price = 809.99m, 68 | Quantity = 1 69 | }, 70 | new OrderItem 71 | { 72 | ID = 2, 73 | Name = "Mechanical Keyboard", 74 | Price = 99.99m, 75 | Quantity = 2 76 | }, 77 | new OrderItem 78 | { 79 | ID = 3, 80 | Name = "Standing Desk", 81 | Price = 607.89m, 82 | Quantity = 1 83 | } 84 | } 85 | }, 86 | new Order 87 | { 88 | ID = 2, 89 | UserID = "Peter", 90 | OrderItems = new List 91 | { 92 | new OrderItem 93 | { 94 | ID = 4, 95 | Name = "Pen", 96 | Price = 1.99m, 97 | Quantity = 10 98 | }, 99 | new OrderItem 100 | { 101 | ID = 5, 102 | Name = "Notebook", 103 | Price = 10.99m, 104 | Quantity = 5 105 | } 106 | } 107 | }, 108 | new Order 109 | { 110 | ID = 3, 111 | UserID = "Jane", 112 | OrderItems = new List 113 | { 114 | new OrderItem 115 | { 116 | ID = 6, 117 | Name = "GTX1080", 118 | Price = 809.99m, 119 | Quantity = 2 120 | } 121 | } 122 | }, 123 | new Order 124 | { 125 | ID = 4, 126 | UserID = "John", 127 | OrderItems = new List 128 | { 129 | new OrderItem 130 | { 131 | ID = 7, 132 | Name = "GTX1080", 133 | Price = 809.99m, 134 | Quantity = 1 135 | }, 136 | new OrderItem 137 | { 138 | ID = 8, 139 | Name = "Pen", 140 | Price = 1.99m, 141 | Quantity = 2 142 | }, 143 | new OrderItem 144 | { 145 | ID = 9, 146 | Name = "Hairspray", 147 | Price = 15.99m, 148 | Quantity = 3 149 | }, 150 | new OrderItem 151 | { 152 | ID = 10, 153 | Name = "Mechanical Keyboard", 154 | Price = 99.99m, 155 | Quantity = 1 156 | } 157 | } 158 | } 159 | }; 160 | 161 | return orders; 162 | } 163 | 164 | private static void printOrderItems(List orderItems) 165 | { 166 | Console.WriteLine("----------------------------------"); 167 | Console.WriteLine("{0,-10} {1,-25} {2, -10} {3, -10}", "ID", "Name", "Price", "Quantity"); 168 | 169 | foreach (OrderItem oi in orderItems) 170 | { 171 | Console.WriteLine("{0,-10} {1,-25} {2, -10} {3, -10}", oi.ID, oi.Name, oi.Price, oi.Quantity); 172 | } 173 | Console.WriteLine("----------------------------------"); 174 | } 175 | #endregion 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /12/Nullable/Bar.cs: -------------------------------------------------------------------------------- 1 | namespace Nullable 2 | { 3 | public struct Bar 4 | { 5 | public Bar(int number) 6 | { 7 | Number = number; 8 | } 9 | 10 | public int Number { get; private set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /12/Nullable/Foo.cs: -------------------------------------------------------------------------------- 1 | namespace Nullable 2 | { 3 | public class Foo 4 | { 5 | public Foo(int number) 6 | { 7 | Number = number; 8 | } 9 | 10 | public int Number { get; private set; } 11 | 12 | public void Increment() 13 | { 14 | Number++; 15 | } 16 | 17 | public void Increment(int increment) 18 | { 19 | Number += increment; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /12/Nullable/Nullable.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /12/Nullable/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Nullable 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Foo[] foos = new Foo[] 10 | { 11 | new Foo(1), 12 | new Foo(2), 13 | new Foo(3) 14 | }; 15 | 16 | Foo foo1 = First(foos, 2); 17 | 18 | if (foo1 == null) 19 | { 20 | Console.WriteLine($"foo1 is null!"); 21 | } 22 | else 23 | { 24 | Console.WriteLine($"foo1: {foo1.Number}"); 25 | } 26 | 27 | Foo foo2 = First(foos, 4); 28 | 29 | if (foo2 == null) 30 | { 31 | Console.WriteLine($"foo2 is null!"); 32 | } 33 | else 34 | { 35 | Console.WriteLine($"foo2: {foo2.Number}"); 36 | } 37 | 38 | Bar[] bars = new Bar[] 39 | { 40 | new Bar(1), 41 | new Bar(2), 42 | new Bar(3) 43 | }; 44 | 45 | //Bar bar1 = First(bars, 2); 46 | Bar? bar2 = First(bars, 2); 47 | 48 | if (bar2 == null) 49 | { 50 | Console.WriteLine($"bar2 is null!"); 51 | } 52 | else 53 | { 54 | Console.WriteLine($"bar2: {bar2.Value.Number}"); 55 | } 56 | 57 | Bar? bar3 = First(bars, 4); 58 | 59 | if (bar3 == null) 60 | { 61 | Console.WriteLine($"bar3 is null!"); 62 | } 63 | else 64 | { 65 | Console.WriteLine($"bar3: {bar3.Value.Number}"); 66 | } 67 | } 68 | 69 | public static Foo First(Foo[] foos, int number) 70 | { 71 | foreach (Foo foo in foos) 72 | { 73 | if (foo.Number == number) 74 | { 75 | return foo; 76 | } 77 | } 78 | 79 | return null; 80 | } 81 | 82 | public static Bar? First(Bar[] bars, int number) 83 | { 84 | foreach (Bar bar in bars) 85 | { 86 | if (bar.Number == number) 87 | { 88 | return bar; 89 | } 90 | } 91 | 92 | return null; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /12/Struct/CartItem.cs: -------------------------------------------------------------------------------- 1 | namespace Struct 2 | { 3 | public struct CartItem 4 | { 5 | public string Name { get; set; } 6 | 7 | public decimal Price { get; set; } 8 | 9 | public uint Quantity { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /12/Struct/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Struct 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | CartItem cartItem = new CartItem 10 | { 11 | Name = "Hello World! Programming Book", 12 | Price = 10.99m, 13 | Quantity = 5 14 | }; 15 | 16 | ModifyCartItem(cartItem); 17 | 18 | Console.WriteLine($"Name: {cartItem.Name}"); 19 | Console.WriteLine($"Price: {cartItem.Price}"); 20 | Console.WriteLine($"Quantity: {cartItem.Quantity}"); 21 | } 22 | 23 | public static void ModifyCartItem(CartItem cartItem) 24 | { 25 | cartItem.Name = "How to suck at programming"; 26 | cartItem.Price = 0.99m; 27 | cartItem.Quantity = 1; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /12/Struct/Struct.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /12/ValueTypeVsReferenceType/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ValueTypeVsReferenceType 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int num = 0; 10 | 11 | Increment(num); 12 | 13 | Console.WriteLine(num); 14 | 15 | int[] nums = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; 16 | 17 | Increment(nums); 18 | 19 | Console.WriteLine(string.Join(", ", nums)); 20 | 21 | Vector vector = new Vector(0, 0); 22 | 23 | Increment(vector); 24 | 25 | Console.WriteLine($"{vector.X} {vector.Y}"); 26 | } 27 | 28 | public static void Increment(int num) 29 | { 30 | num++; 31 | } 32 | 33 | public static void Increment(int[] nums) 34 | { 35 | for (int i = 0; i < nums.Length; i ++) 36 | { 37 | nums[i]++; 38 | } 39 | } 40 | 41 | public static void Increment (Vector vector) 42 | { 43 | vector.X++; 44 | vector.Y++; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /12/ValueTypeVsReferenceType/ValueTypeVsReferenceType.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /12/ValueTypeVsReferenceType/Vector.cs: -------------------------------------------------------------------------------- 1 | namespace ValueTypeVsReferenceType 2 | { 3 | public class Vector 4 | { 5 | public Vector(int x, int y) 6 | { 7 | X = x; 8 | Y = y; 9 | } 10 | 11 | public int X { get; set; } 12 | 13 | public int Y { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /13/ReadAndWriteFile/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace ReadAndWriteFile 5 | { 6 | public class Program 7 | { 8 | private static readonly string CURRENT_DIRECTORY = Directory.GetCurrentDirectory(); 9 | private static readonly string OUTPUT_FOLDER_PATH = Path.Combine(CURRENT_DIRECTORY, "output"); 10 | private static readonly string INPUT_FILE_FULL_PATH = Path.Combine(CURRENT_DIRECTORY, "input", "inputtext.txt"); 11 | private static readonly string OUTPUT_FILE1_FULL_PATH = Path.Combine(CURRENT_DIRECTORY, "output", "outputtext.txt"); 12 | private static readonly string OUTPUT_FILE2_FULL_PATH = Path.Combine(CURRENT_DIRECTORY, "output", "outputtext2.txt"); 13 | 14 | public static void Main(string[] args) 15 | { 16 | setup(); 17 | 18 | Console.WriteLine($"Input file is in: {INPUT_FILE_FULL_PATH}"); 19 | 20 | string allText = File.ReadAllText(INPUT_FILE_FULL_PATH); 21 | 22 | Console.WriteLine("----------------------------------"); 23 | Console.WriteLine(allText); 24 | Console.WriteLine("----------------------------------"); 25 | 26 | string[] allLines = File.ReadAllLines(INPUT_FILE_FULL_PATH); 27 | 28 | Console.WriteLine("----------------------------------"); 29 | foreach (string line in allLines) 30 | { 31 | Console.WriteLine(line); 32 | } 33 | Console.WriteLine("----------------------------------"); 34 | 35 | Console.WriteLine($"Output file 1 is in: {OUTPUT_FILE1_FULL_PATH}"); 36 | 37 | File.WriteAllText(OUTPUT_FILE1_FULL_PATH, allText); 38 | 39 | File.WriteAllLines(OUTPUT_FILE1_FULL_PATH, allLines); 40 | 41 | File.AppendAllLines(OUTPUT_FILE1_FULL_PATH, allLines); 42 | 43 | byte[] bytes = new byte[12] { 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33 }; 44 | 45 | File.WriteAllBytes(OUTPUT_FILE2_FULL_PATH, bytes); 46 | 47 | Console.WriteLine($"Output file 2 is in: {OUTPUT_FILE2_FULL_PATH}"); 48 | } 49 | 50 | private static void setup() 51 | { 52 | if(File.Exists(OUTPUT_FILE1_FULL_PATH)) 53 | { 54 | File.Delete(OUTPUT_FILE1_FULL_PATH); 55 | } 56 | 57 | if (File.Exists(OUTPUT_FILE2_FULL_PATH)) 58 | { 59 | File.Delete(OUTPUT_FILE2_FULL_PATH); 60 | } 61 | 62 | if (!Directory.Exists(OUTPUT_FOLDER_PATH)) 63 | { 64 | Directory.CreateDirectory(OUTPUT_FOLDER_PATH); 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /13/ReadAndWriteFile/ReadAndWriteFile.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | PreserveNewest 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /13/ReadAndWriteFile/input/inputtext.txt: -------------------------------------------------------------------------------- 1 | Hello World! 2 | 3 | Welcome to COMP1500! 4 | 5 | This is the start of your programming journey! -------------------------------------------------------------------------------- /13/ReadAndWriteFileUsingFileStream/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace ReadAndWriteFileUsingFileStream 5 | { 6 | public class Program 7 | { 8 | private static readonly string CURRENT_DIRECTORY = Directory.GetCurrentDirectory(); 9 | private static readonly string OUTPUT_FOLDER_PATH = Path.Combine(CURRENT_DIRECTORY, "output"); 10 | private static readonly string INPUT_FILE_FULL_PATH = Path.Combine(CURRENT_DIRECTORY, "input", "inputtext.txt"); 11 | private static readonly string OUTPUT_FILE_FULL_PATH = Path.Combine(CURRENT_DIRECTORY, "output", "outputtext.txt"); 12 | 13 | public static void Main(string[] args) 14 | { 15 | setup(); 16 | 17 | FileStream fsRead = File.Open(INPUT_FILE_FULL_PATH, FileMode.Open, FileAccess.Read); 18 | 19 | //fsRead.Write(new byte[] { 1, 2, 3 }, 0, 3); 20 | 21 | Console.WriteLine($"CanRead: {fsRead.CanRead}"); 22 | Console.WriteLine($"CanWrite: {fsRead.CanWrite}"); 23 | Console.WriteLine($"CanSeek: {fsRead.CanSeek}"); 24 | 25 | byte[] bytes = new byte[fsRead.Length]; 26 | fsRead.Read(bytes, 0, bytes.Length); 27 | 28 | fsRead.Close(); 29 | 30 | Console.WriteLine(string.Join(", ", bytes)); 31 | 32 | FileStream fsWrite = File.Open(OUTPUT_FILE_FULL_PATH, FileMode.Create, FileAccess.Write); 33 | 34 | Console.WriteLine($"CanRead: {fsWrite.CanRead}"); 35 | Console.WriteLine($"CanWrite: {fsWrite.CanWrite}"); 36 | Console.WriteLine($"CanSeek: {fsWrite.CanSeek}"); 37 | 38 | fsWrite.Write(bytes, 0, bytes.Length); 39 | 40 | fsWrite.Close(); 41 | } 42 | 43 | private static void setup() 44 | { 45 | if (File.Exists(OUTPUT_FILE_FULL_PATH)) 46 | { 47 | File.Delete(OUTPUT_FILE_FULL_PATH); 48 | } 49 | 50 | if (!Directory.Exists(OUTPUT_FOLDER_PATH)) 51 | { 52 | Directory.CreateDirectory(OUTPUT_FOLDER_PATH); 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /13/ReadAndWriteFileUsingFileStream/ReadAndWriteFileUsingFileStream.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | PreserveNewest 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /13/ReadAndWriteFileUsingFileStream/input/inputtext.txt: -------------------------------------------------------------------------------- 1 | Hello World! 2 | 3 | Welcome to COMP1500! 4 | 5 | This is the start of your programming journey! -------------------------------------------------------------------------------- /13/TryCatchFinally/IntegerIs10Exception.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TryCatchFinally 4 | { 5 | public class IntegerIs10Exception : Exception 6 | { 7 | public IntegerIs10Exception(string message) 8 | : base(message) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /13/TryCatchFinally/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TryCatchFinally 4 | { 5 | class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | Random random = new Random(); 10 | int dividend = random.Next(); 11 | Console.WriteLine($"Divide {dividend} by a divisor."); 12 | 13 | try 14 | { 15 | Console.Write($"Input a divisor? "); 16 | string integerString = Console.ReadLine(); 17 | int divisor = int.Parse(integerString); 18 | 19 | if (divisor == 10) 20 | { 21 | throw new IntegerIs10Exception("The input integer is 10!!"); 22 | } 23 | 24 | int result = dividend / divisor; 25 | 26 | Console.WriteLine($"Result: {result}"); 27 | } 28 | catch (ArgumentNullException e) 29 | { 30 | Console.WriteLine("Argument is null"); 31 | Console.WriteLine(e); 32 | } 33 | catch (FormatException e) 34 | { 35 | Console.WriteLine("Integer format is wrong"); 36 | Console.WriteLine(e); 37 | } 38 | catch (OverflowException e) 39 | { 40 | Console.WriteLine("The number is too huge to be an integer"); 41 | Console.WriteLine(e); 42 | } 43 | catch (IntegerIs10Exception e) 44 | { 45 | Console.WriteLine("The divisor is 10. Oh noez!!"); 46 | Console.WriteLine(e); 47 | } 48 | catch (DivideByZeroException e) 49 | { 50 | Console.WriteLine("The dividend is being divided by 0"); 51 | Console.WriteLine(e); 52 | } 53 | finally 54 | { 55 | Console.WriteLine("Finally clause always runs regardless of whether or not there was an exception"); 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /13/TryCatchFinally/TryCatchFinally.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /13/UsingStatement/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace UsingStatement 6 | { 7 | public class Program 8 | { 9 | private static readonly string CURRENT_DIRECTORY = Directory.GetCurrentDirectory(); 10 | private static readonly string OUTPUT_FOLDER_PATH = Path.Combine(CURRENT_DIRECTORY, "output"); 11 | private static readonly string INPUT_FILE_FULL_PATH = Path.Combine(CURRENT_DIRECTORY, "input", "inputtext.txt"); 12 | private static readonly string OUTPUT_FILE_FULL_PATH = Path.Combine(CURRENT_DIRECTORY, "output", "outputtext.txt"); 13 | 14 | public static void Main(string[] args) 15 | { 16 | setup(); 17 | 18 | string allText = string.Empty; 19 | 20 | using (StreamReader reader1 = new StreamReader(File.Open(INPUT_FILE_FULL_PATH, FileMode.Open, FileAccess.Read))) 21 | { 22 | Console.WriteLine("----------------------------------"); 23 | allText = reader1.ReadToEnd(); 24 | Console.WriteLine(allText); 25 | Console.WriteLine("----------------------------------"); 26 | } 27 | 28 | List allLines = new List(); 29 | using (StreamReader reader2 = new StreamReader(File.Open(INPUT_FILE_FULL_PATH, FileMode.Open, FileAccess.Read))) 30 | { 31 | while (!reader2.EndOfStream) 32 | { 33 | allLines.Add(reader2.ReadLine()); 34 | } 35 | 36 | foreach (string line in allLines) 37 | { 38 | Console.WriteLine(line); 39 | } 40 | 41 | Console.WriteLine("----------------------------------"); 42 | } 43 | 44 | using (StreamWriter writer = new StreamWriter(File.Open(OUTPUT_FILE_FULL_PATH, FileMode.OpenOrCreate, FileAccess.Write))) 45 | { 46 | writer.Write(allText); 47 | 48 | foreach (string line in allLines) 49 | { 50 | writer.WriteLine(line); 51 | } 52 | 53 | writer.BaseStream.Seek(0, SeekOrigin.Begin); 54 | writer.Write("Overwritten text"); 55 | } 56 | } 57 | 58 | private static void setup() 59 | { 60 | if (File.Exists(OUTPUT_FILE_FULL_PATH)) 61 | { 62 | File.Delete(OUTPUT_FILE_FULL_PATH); 63 | } 64 | 65 | if (!Directory.Exists(OUTPUT_FOLDER_PATH)) 66 | { 67 | Directory.CreateDirectory(OUTPUT_FOLDER_PATH); 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /13/UsingStatement/UsingStatement.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | PreserveNewest 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /13/UsingStatement/input/inputtext.txt: -------------------------------------------------------------------------------- 1 | Hello World! 2 | 3 | Welcome to COMP1500! 4 | 5 | This is the start of your programming journey! -------------------------------------------------------------------------------- /14/CopyDirectory/CopyDirectory.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PreserveNewest 7 | 8 | 9 | PreserveNewest 10 | 11 | 12 | PreserveNewest 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /14/CopyDirectory/Program.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace CopyDirectory 4 | { 5 | public class Program 6 | { 7 | public static readonly string INPUT_DIRECTORY = Path.Combine(Directory.GetCurrentDirectory(), "input"); 8 | public static readonly string OUTPUT_DIRECTORY = Path.Combine(Directory.GetCurrentDirectory(), "output"); 9 | 10 | public static void Main(string[] args) 11 | { 12 | cleanDirectory(OUTPUT_DIRECTORY); 13 | 14 | if (!Directory.Exists(OUTPUT_DIRECTORY)) 15 | { 16 | Directory.CreateDirectory(OUTPUT_DIRECTORY); 17 | } 18 | 19 | copyDirectory(INPUT_DIRECTORY, OUTPUT_DIRECTORY); 20 | } 21 | 22 | private static void copyDirectory(string sourcePath, string destPath) 23 | { 24 | var files = Directory.GetFiles(sourcePath); 25 | 26 | foreach (var file in files) 27 | { 28 | var fileName = Path.GetFileName(file); 29 | File.Copy(file, Path.Combine(destPath, fileName)); 30 | } 31 | 32 | var directories = Directory.GetDirectories(sourcePath); 33 | 34 | foreach (var directory in directories) 35 | { 36 | var dest = directory.Replace(sourcePath, destPath); 37 | Directory.CreateDirectory(dest); 38 | copyDirectory(directory, dest); 39 | } 40 | } 41 | 42 | private static void cleanDirectory(string path) 43 | { 44 | if (Directory.Exists(path)) 45 | { 46 | string[] files = Directory.GetFiles(path); 47 | 48 | foreach (string filePath in files) 49 | { 50 | File.Delete(filePath); 51 | } 52 | 53 | string[] directories = Directory.GetDirectories(path); 54 | 55 | foreach (string directoryPath in directories) 56 | { 57 | cleanDirectory(directoryPath); 58 | } 59 | 60 | Directory.Delete(path); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /14/CopyDirectory/input/innerfolder/innerinnerfolder/mostinner.txt: -------------------------------------------------------------------------------- 1 | most inner text -------------------------------------------------------------------------------- /14/CopyDirectory/input/innerfolder/mytext.txt: -------------------------------------------------------------------------------- 1 | My text message -------------------------------------------------------------------------------- /14/CopyDirectory/input/innerfolder2/secretmessage.txt: -------------------------------------------------------------------------------- 1 | This is super sensitive message -------------------------------------------------------------------------------- /14/CopyDirectory/input/innerfolder2/secretmessage2.txt: -------------------------------------------------------------------------------- 1 | Again... secret message -------------------------------------------------------------------------------- /14/CopyDirectory/input/notsosecretmessage.txt: -------------------------------------------------------------------------------- 1 | Not so secret message -------------------------------------------------------------------------------- /BuildTargets/Common.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | net9.0 5 | 6 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @POCU/reviewers 2 | -------------------------------------------------------------------------------- /COMP1500CodesSamples.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.489 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01", "01", "{6678DD98-8464-42BF-A2F6-047994F4847E}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "02", "02", "{088370A7-3196-4B58-B620-0FDDE7829C89}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorld", "01\HelloWorld\HelloWorld.csproj", "{7EB83A06-90AA-443A-A7D8-2C54D27BA4FE}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Comment", "02\Comment\Comment.csproj", "{79DED209-3F09-40EF-B094-AFCCC2F7C564}" 13 | EndProject 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Variables", "02\Variables\Variables.csproj", "{50082B0A-22F5-403C-A148-2B4D6A8222F2}" 15 | EndProject 16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrimitiveTypesToBinary", "02\PrimitiveTypesToBinary\PrimitiveTypesToBinary.csproj", "{714A5E8E-F413-442E-881F-2101E0BB4F9F}" 17 | EndProject 18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "03", "03", "{BFC911D9-03DA-47F2-8660-448DD7A9A4A4}" 19 | EndProject 20 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeConversion", "03\TypeConversion\TypeConversion.csproj", "{D608108B-2A30-4A64-A222-40794ACCED54}" 21 | EndProject 22 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Calculator", "03\Calculator\Calculator.csproj", "{2AC0D5D3-22FD-4408-9A1C-D4F840DA92E9}" 23 | EndProject 24 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IncrementAndDecrementOperators", "03\IncrementAndDecrementOperators\IncrementAndDecrementOperators.csproj", "{C43A79F9-8FD2-45C4-8CDA-79C63502DABD}" 25 | EndProject 26 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitwiseMultiplicationAndDivision", "03\BitwiseMultiplicationAndDivision\BitwiseMultiplicationAndDivision.csproj", "{FB781ACC-E8DF-4AA7-AC04-1977D81D9EE3}" 27 | EndProject 28 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitFlag", "03\BitFlag\BitFlag.csproj", "{90C55505-62FC-432C-AFE7-284CDE7CCFF0}" 29 | EndProject 30 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASCIICodeHelloWorld", "03\ASCIICodeHelloWorld\ASCIICodeHelloWorld.csproj", "{413AFEAD-C7D9-44DF-8966-9F955F1FFF83}" 31 | EndProject 32 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StringInterpolation", "03\StringInterpolation\StringInterpolation.csproj", "{F0C31ECE-DD83-4780-8108-237D3E689870}" 33 | EndProject 34 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InsertStudentInformation", "03\InsertStudentInformation\InsertStudentInformation.csproj", "{52C6D987-3C1A-45D2-AC22-2B934FD8F458}" 35 | EndProject 36 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "04", "04", "{C1245CF3-0070-4EA3-B20E-80146468B9A2}" 37 | EndProject 38 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InsertStudentInformation2", "04\InsertStudentInformation2\InsertStudentInformation2.csproj", "{85B41686-F643-4DBB-9DEA-1989CF9B5B06}" 39 | EndProject 40 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogicalExpressions", "04\LogicalExpressions\LogicalExpressions.csproj", "{A9886A91-1140-4DBE-A885-A06FE242FA62}" 41 | EndProject 42 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrderOfExpressionEvaluation", "04\OrderOfExpressionEvaluation\OrderOfExpressionEvaluation.csproj", "{2BFAE356-8C7F-4438-8F16-CDBF00A39CB9}" 43 | EndProject 44 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05", "05", "{0D9CB036-ACA6-4911-8E9F-2D0CBF08721A}" 45 | EndProject 46 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CalculatorWithSwitchStatement", "05\CalculatorWithSwitchStatement\CalculatorWithSwitchStatement.csproj", "{C4F4DC83-A1F8-4BEC-9F27-9531C0C84DBB}" 47 | EndProject 48 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InsertStudentInformation3", "05\InsertStudentInformation3\InsertStudentInformation3.csproj", "{600E0D56-264C-4F0F-8E17-6457C0FE4E4A}" 49 | EndProject 50 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sum", "05\Sum\Sum.csproj", "{BA350D0B-832D-4BFA-A32B-96879D7402BD}" 51 | EndProject 52 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InfiniteWhileLoop", "05\InfiniteWhileLoop\InfiniteWhileLoop.csproj", "{A8DFB64C-7B08-4223-B2E1-780F69CC6817}" 53 | EndProject 54 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AddTwo2dArrays", "05\AddTwo2dArrays\AddTwo2dArrays.csproj", "{B5886FA2-3A36-41F6-9757-6C3EDC72EC16}" 55 | EndProject 56 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "06", "06", "{773EA059-A4E9-4C60-B323-5F412F1D7976}" 57 | EndProject 58 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Functions", "06\Functions\Functions.csproj", "{26BF50FC-FFEA-4FF6-8907-04DE56649526}" 59 | EndProject 60 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Scope", "06\Scope\Scope.csproj", "{6F2D0348-7E7E-4147-8E5F-EC5ECC84FF3C}" 61 | EndProject 62 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CallByValueAndCallByReference", "06\CallByValueAndCallByReference\CallByValueAndCallByReference.csproj", "{FA9AF6C2-9313-4C20-A60C-547DF0511F29}" 63 | EndProject 64 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InputValidationUsingAssert", "06\InputValidationUsingAssert\InputValidationUsingAssert.csproj", "{94E98592-9374-4D50-9250-EDA14BA21D77}" 65 | EndProject 66 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CalculatorUsingEnum", "06\CalculatorUsingEnum\CalculatorUsingEnum.csproj", "{D5B1C45C-D85B-4952-AF22-D29F3C380DE2}" 67 | EndProject 68 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "07", "07", "{C7DF3224-CF8A-444C-AEB4-C7970A821411}" 69 | EndProject 70 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RecursiveFactorial", "07\RecursiveFactorial\RecursiveFactorial.csproj", "{BFA3851F-578C-44EE-AC3C-11B8123EDEEE}" 71 | EndProject 72 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RandomShuffling", "07\RandomShuffling\RandomShuffling.csproj", "{84F27B74-14D4-4939-9321-691E3BE922C2}" 73 | EndProject 74 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "09", "09", "{F7422A70-934F-4308-8D50-ACBBD966BD5C}" 75 | EndProject 76 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArrayOfArrays", "09\ArrayOfArrays\ArrayOfArrays.csproj", "{3976BC50-8751-4851-A28E-2E3D40EA4C04}" 77 | EndProject 78 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OutParameterModifier", "09\OutParameterModifier\OutParameterModifier.csproj", "{46FB4D86-1F2E-4779-B254-D9549D546084}" 79 | EndProject 80 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DefaultParameters", "09\DefaultParameters\DefaultParameters.csproj", "{3DA1FB4C-A8DC-42E3-87D1-6CD25DAD5E6C}" 81 | EndProject 82 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionOverloading", "09\FunctionOverloading\FunctionOverloading.csproj", "{B06F90BC-AAA9-470E-A6FB-B747A4A5BC08}" 83 | EndProject 84 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ParseTextMessage", "09\ParseTextMessage\ParseTextMessage.csproj", "{1E65AF06-19D0-436E-BDCE-4D8B406508B4}" 85 | EndProject 86 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "10", "10", "{0DFD6D98-806F-44EA-A1A4-E6C4D7D670A9}" 87 | EndProject 88 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StringBuilder", "10\StringBuilder\StringBuilder.csproj", "{AFBED5F7-C636-4D66-B4A0-9643B786BD7D}" 89 | EndProject 90 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "List", "10\List\List.csproj", "{9449FDEE-D975-4DCE-9C61-3299B81D03E8}" 91 | EndProject 92 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dictionary", "10\Dictionary\Dictionary.csproj", "{F3DF1CAC-5AF3-40C8-B4DC-A6B18F3D5782}" 93 | EndProject 94 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ForEachLoop", "10\ForEachLoop\ForEachLoop.csproj", "{1088F886-9F11-4139-93A6-8AB82980AE0A}" 95 | EndProject 96 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StringConcatVsStringBuilder", "10\StringConcatVsStringBuilder\StringConcatVsStringBuilder.csproj", "{C26F4CB4-9EE8-4ABA-8078-6D97B3EFEE03}" 97 | EndProject 98 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FloatVsDoubleVsDecimal", "10\FloatVsDoubleVsDecimal\FloatVsDoubleVsDecimal.csproj", "{18A516AC-F118-47F9-9602-34957357F310}" 99 | EndProject 100 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "11", "11", "{C2A5617A-1ED3-45B3-B4C0-3C0E4CA00193}" 101 | EndProject 102 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Class", "11\Class\Class.csproj", "{C10587D0-D893-4908-ADFE-574F17559142}" 103 | EndProject 104 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PartialClass", "11\PartialClass\PartialClass.csproj", "{F2FBCA2B-F955-4C7C-908F-4C6B09DECA8A}" 105 | EndProject 106 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StaticClass", "11\StaticClass\StaticClass.csproj", "{AFE87B88-8A09-447D-A311-DAAA420755D8}" 107 | EndProject 108 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExtensionMethod", "11\ExtensionMethod\ExtensionMethod.csproj", "{AA1362B3-11DF-4CC6-9D9E-07687D95C3B5}" 109 | EndProject 110 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StaticMethod", "11\StaticMethod\StaticMethod.csproj", "{82BE4D7F-271B-4DCE-89E1-DEF23FE668C8}" 111 | EndProject 112 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "12", "12", "{8FCDD4C4-264C-4F02-8DB9-6AA08C9F96CF}" 113 | EndProject 114 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ValueTypeVsReferenceType", "12\ValueTypeVsReferenceType\ValueTypeVsReferenceType.csproj", "{3F247829-CA16-4D58-A338-36829AAE7D7E}" 115 | EndProject 116 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Struct", "12\Struct\Struct.csproj", "{B246D81F-C409-4F44-87C3-F189F51745A0}" 117 | EndProject 118 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nullable", "12\Nullable\Nullable.csproj", "{27D9ED6F-41CC-43D8-B46D-40C953ECCD2A}" 119 | EndProject 120 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINQ", "12\LINQ\LINQ.csproj", "{3ABE0C0E-56D4-484F-9395-54BA43095E47}" 121 | EndProject 122 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "13", "13", "{6A91EBCE-DF22-4C3D-8723-30829F765579}" 123 | EndProject 124 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TryCatchFinally", "13\TryCatchFinally\TryCatchFinally.csproj", "{7EC226EE-ED30-4A21-8565-13E49F742B1E}" 125 | EndProject 126 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReadAndWriteFileUsingFileStream", "13\ReadAndWriteFileUsingFileStream\ReadAndWriteFileUsingFileStream.csproj", "{85CABE87-7668-47D4-A6E0-6FBFE12DFC5C}" 127 | EndProject 128 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReadAndWriteFile", "13\ReadAndWriteFile\ReadAndWriteFile.csproj", "{C4FA2471-C9EC-43E6-B252-2F9C8FA99FC3}" 129 | EndProject 130 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UsingStatement", "13\UsingStatement\UsingStatement.csproj", "{E2B78947-B117-4979-B3E4-0333C02A7EA0}" 131 | EndProject 132 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "14", "14", "{3541F5A7-3325-45B6-BC9F-A0289569C84D}" 133 | EndProject 134 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CopyDirectory", "14\CopyDirectory\CopyDirectory.csproj", "{9AEC8F72-F10D-4F0C-8FC0-C902B214E22B}" 135 | EndProject 136 | Global 137 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 138 | Debug|Any CPU = Debug|Any CPU 139 | Release|Any CPU = Release|Any CPU 140 | EndGlobalSection 141 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 142 | {7EB83A06-90AA-443A-A7D8-2C54D27BA4FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 143 | {7EB83A06-90AA-443A-A7D8-2C54D27BA4FE}.Debug|Any CPU.Build.0 = Debug|Any CPU 144 | {7EB83A06-90AA-443A-A7D8-2C54D27BA4FE}.Release|Any CPU.ActiveCfg = Release|Any CPU 145 | {7EB83A06-90AA-443A-A7D8-2C54D27BA4FE}.Release|Any CPU.Build.0 = Release|Any CPU 146 | {79DED209-3F09-40EF-B094-AFCCC2F7C564}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 147 | {79DED209-3F09-40EF-B094-AFCCC2F7C564}.Debug|Any CPU.Build.0 = Debug|Any CPU 148 | {79DED209-3F09-40EF-B094-AFCCC2F7C564}.Release|Any CPU.ActiveCfg = Release|Any CPU 149 | {79DED209-3F09-40EF-B094-AFCCC2F7C564}.Release|Any CPU.Build.0 = Release|Any CPU 150 | {50082B0A-22F5-403C-A148-2B4D6A8222F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 151 | {50082B0A-22F5-403C-A148-2B4D6A8222F2}.Debug|Any CPU.Build.0 = Debug|Any CPU 152 | {50082B0A-22F5-403C-A148-2B4D6A8222F2}.Release|Any CPU.ActiveCfg = Release|Any CPU 153 | {50082B0A-22F5-403C-A148-2B4D6A8222F2}.Release|Any CPU.Build.0 = Release|Any CPU 154 | {714A5E8E-F413-442E-881F-2101E0BB4F9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 155 | {714A5E8E-F413-442E-881F-2101E0BB4F9F}.Debug|Any CPU.Build.0 = Debug|Any CPU 156 | {714A5E8E-F413-442E-881F-2101E0BB4F9F}.Release|Any CPU.ActiveCfg = Release|Any CPU 157 | {714A5E8E-F413-442E-881F-2101E0BB4F9F}.Release|Any CPU.Build.0 = Release|Any CPU 158 | {D608108B-2A30-4A64-A222-40794ACCED54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 159 | {D608108B-2A30-4A64-A222-40794ACCED54}.Debug|Any CPU.Build.0 = Debug|Any CPU 160 | {D608108B-2A30-4A64-A222-40794ACCED54}.Release|Any CPU.ActiveCfg = Release|Any CPU 161 | {D608108B-2A30-4A64-A222-40794ACCED54}.Release|Any CPU.Build.0 = Release|Any CPU 162 | {2AC0D5D3-22FD-4408-9A1C-D4F840DA92E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 163 | {2AC0D5D3-22FD-4408-9A1C-D4F840DA92E9}.Debug|Any CPU.Build.0 = Debug|Any CPU 164 | {2AC0D5D3-22FD-4408-9A1C-D4F840DA92E9}.Release|Any CPU.ActiveCfg = Release|Any CPU 165 | {2AC0D5D3-22FD-4408-9A1C-D4F840DA92E9}.Release|Any CPU.Build.0 = Release|Any CPU 166 | {C43A79F9-8FD2-45C4-8CDA-79C63502DABD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 167 | {C43A79F9-8FD2-45C4-8CDA-79C63502DABD}.Debug|Any CPU.Build.0 = Debug|Any CPU 168 | {C43A79F9-8FD2-45C4-8CDA-79C63502DABD}.Release|Any CPU.ActiveCfg = Release|Any CPU 169 | {C43A79F9-8FD2-45C4-8CDA-79C63502DABD}.Release|Any CPU.Build.0 = Release|Any CPU 170 | {FB781ACC-E8DF-4AA7-AC04-1977D81D9EE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 171 | {FB781ACC-E8DF-4AA7-AC04-1977D81D9EE3}.Debug|Any CPU.Build.0 = Debug|Any CPU 172 | {FB781ACC-E8DF-4AA7-AC04-1977D81D9EE3}.Release|Any CPU.ActiveCfg = Release|Any CPU 173 | {FB781ACC-E8DF-4AA7-AC04-1977D81D9EE3}.Release|Any CPU.Build.0 = Release|Any CPU 174 | {90C55505-62FC-432C-AFE7-284CDE7CCFF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 175 | {90C55505-62FC-432C-AFE7-284CDE7CCFF0}.Debug|Any CPU.Build.0 = Debug|Any CPU 176 | {90C55505-62FC-432C-AFE7-284CDE7CCFF0}.Release|Any CPU.ActiveCfg = Release|Any CPU 177 | {90C55505-62FC-432C-AFE7-284CDE7CCFF0}.Release|Any CPU.Build.0 = Release|Any CPU 178 | {413AFEAD-C7D9-44DF-8966-9F955F1FFF83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 179 | {413AFEAD-C7D9-44DF-8966-9F955F1FFF83}.Debug|Any CPU.Build.0 = Debug|Any CPU 180 | {413AFEAD-C7D9-44DF-8966-9F955F1FFF83}.Release|Any CPU.ActiveCfg = Release|Any CPU 181 | {413AFEAD-C7D9-44DF-8966-9F955F1FFF83}.Release|Any CPU.Build.0 = Release|Any CPU 182 | {F0C31ECE-DD83-4780-8108-237D3E689870}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 183 | {F0C31ECE-DD83-4780-8108-237D3E689870}.Debug|Any CPU.Build.0 = Debug|Any CPU 184 | {F0C31ECE-DD83-4780-8108-237D3E689870}.Release|Any CPU.ActiveCfg = Release|Any CPU 185 | {F0C31ECE-DD83-4780-8108-237D3E689870}.Release|Any CPU.Build.0 = Release|Any CPU 186 | {52C6D987-3C1A-45D2-AC22-2B934FD8F458}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 187 | {52C6D987-3C1A-45D2-AC22-2B934FD8F458}.Debug|Any CPU.Build.0 = Debug|Any CPU 188 | {52C6D987-3C1A-45D2-AC22-2B934FD8F458}.Release|Any CPU.ActiveCfg = Release|Any CPU 189 | {52C6D987-3C1A-45D2-AC22-2B934FD8F458}.Release|Any CPU.Build.0 = Release|Any CPU 190 | {85B41686-F643-4DBB-9DEA-1989CF9B5B06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 191 | {85B41686-F643-4DBB-9DEA-1989CF9B5B06}.Debug|Any CPU.Build.0 = Debug|Any CPU 192 | {85B41686-F643-4DBB-9DEA-1989CF9B5B06}.Release|Any CPU.ActiveCfg = Release|Any CPU 193 | {85B41686-F643-4DBB-9DEA-1989CF9B5B06}.Release|Any CPU.Build.0 = Release|Any CPU 194 | {A9886A91-1140-4DBE-A885-A06FE242FA62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 195 | {A9886A91-1140-4DBE-A885-A06FE242FA62}.Debug|Any CPU.Build.0 = Debug|Any CPU 196 | {A9886A91-1140-4DBE-A885-A06FE242FA62}.Release|Any CPU.ActiveCfg = Release|Any CPU 197 | {A9886A91-1140-4DBE-A885-A06FE242FA62}.Release|Any CPU.Build.0 = Release|Any CPU 198 | {2BFAE356-8C7F-4438-8F16-CDBF00A39CB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 199 | {2BFAE356-8C7F-4438-8F16-CDBF00A39CB9}.Debug|Any CPU.Build.0 = Debug|Any CPU 200 | {2BFAE356-8C7F-4438-8F16-CDBF00A39CB9}.Release|Any CPU.ActiveCfg = Release|Any CPU 201 | {2BFAE356-8C7F-4438-8F16-CDBF00A39CB9}.Release|Any CPU.Build.0 = Release|Any CPU 202 | {C4F4DC83-A1F8-4BEC-9F27-9531C0C84DBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 203 | {C4F4DC83-A1F8-4BEC-9F27-9531C0C84DBB}.Debug|Any CPU.Build.0 = Debug|Any CPU 204 | {C4F4DC83-A1F8-4BEC-9F27-9531C0C84DBB}.Release|Any CPU.ActiveCfg = Release|Any CPU 205 | {C4F4DC83-A1F8-4BEC-9F27-9531C0C84DBB}.Release|Any CPU.Build.0 = Release|Any CPU 206 | {600E0D56-264C-4F0F-8E17-6457C0FE4E4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 207 | {600E0D56-264C-4F0F-8E17-6457C0FE4E4A}.Debug|Any CPU.Build.0 = Debug|Any CPU 208 | {600E0D56-264C-4F0F-8E17-6457C0FE4E4A}.Release|Any CPU.ActiveCfg = Release|Any CPU 209 | {600E0D56-264C-4F0F-8E17-6457C0FE4E4A}.Release|Any CPU.Build.0 = Release|Any CPU 210 | {BA350D0B-832D-4BFA-A32B-96879D7402BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 211 | {BA350D0B-832D-4BFA-A32B-96879D7402BD}.Debug|Any CPU.Build.0 = Debug|Any CPU 212 | {BA350D0B-832D-4BFA-A32B-96879D7402BD}.Release|Any CPU.ActiveCfg = Release|Any CPU 213 | {BA350D0B-832D-4BFA-A32B-96879D7402BD}.Release|Any CPU.Build.0 = Release|Any CPU 214 | {A8DFB64C-7B08-4223-B2E1-780F69CC6817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 215 | {A8DFB64C-7B08-4223-B2E1-780F69CC6817}.Debug|Any CPU.Build.0 = Debug|Any CPU 216 | {A8DFB64C-7B08-4223-B2E1-780F69CC6817}.Release|Any CPU.ActiveCfg = Release|Any CPU 217 | {A8DFB64C-7B08-4223-B2E1-780F69CC6817}.Release|Any CPU.Build.0 = Release|Any CPU 218 | {B5886FA2-3A36-41F6-9757-6C3EDC72EC16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 219 | {B5886FA2-3A36-41F6-9757-6C3EDC72EC16}.Debug|Any CPU.Build.0 = Debug|Any CPU 220 | {B5886FA2-3A36-41F6-9757-6C3EDC72EC16}.Release|Any CPU.ActiveCfg = Release|Any CPU 221 | {B5886FA2-3A36-41F6-9757-6C3EDC72EC16}.Release|Any CPU.Build.0 = Release|Any CPU 222 | {26BF50FC-FFEA-4FF6-8907-04DE56649526}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 223 | {26BF50FC-FFEA-4FF6-8907-04DE56649526}.Debug|Any CPU.Build.0 = Debug|Any CPU 224 | {26BF50FC-FFEA-4FF6-8907-04DE56649526}.Release|Any CPU.ActiveCfg = Release|Any CPU 225 | {26BF50FC-FFEA-4FF6-8907-04DE56649526}.Release|Any CPU.Build.0 = Release|Any CPU 226 | {6F2D0348-7E7E-4147-8E5F-EC5ECC84FF3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 227 | {6F2D0348-7E7E-4147-8E5F-EC5ECC84FF3C}.Debug|Any CPU.Build.0 = Debug|Any CPU 228 | {6F2D0348-7E7E-4147-8E5F-EC5ECC84FF3C}.Release|Any CPU.ActiveCfg = Release|Any CPU 229 | {6F2D0348-7E7E-4147-8E5F-EC5ECC84FF3C}.Release|Any CPU.Build.0 = Release|Any CPU 230 | {FA9AF6C2-9313-4C20-A60C-547DF0511F29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 231 | {FA9AF6C2-9313-4C20-A60C-547DF0511F29}.Debug|Any CPU.Build.0 = Debug|Any CPU 232 | {FA9AF6C2-9313-4C20-A60C-547DF0511F29}.Release|Any CPU.ActiveCfg = Release|Any CPU 233 | {FA9AF6C2-9313-4C20-A60C-547DF0511F29}.Release|Any CPU.Build.0 = Release|Any CPU 234 | {94E98592-9374-4D50-9250-EDA14BA21D77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 235 | {94E98592-9374-4D50-9250-EDA14BA21D77}.Debug|Any CPU.Build.0 = Debug|Any CPU 236 | {94E98592-9374-4D50-9250-EDA14BA21D77}.Release|Any CPU.ActiveCfg = Release|Any CPU 237 | {94E98592-9374-4D50-9250-EDA14BA21D77}.Release|Any CPU.Build.0 = Release|Any CPU 238 | {D5B1C45C-D85B-4952-AF22-D29F3C380DE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 239 | {D5B1C45C-D85B-4952-AF22-D29F3C380DE2}.Debug|Any CPU.Build.0 = Debug|Any CPU 240 | {D5B1C45C-D85B-4952-AF22-D29F3C380DE2}.Release|Any CPU.ActiveCfg = Release|Any CPU 241 | {D5B1C45C-D85B-4952-AF22-D29F3C380DE2}.Release|Any CPU.Build.0 = Release|Any CPU 242 | {BFA3851F-578C-44EE-AC3C-11B8123EDEEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 243 | {BFA3851F-578C-44EE-AC3C-11B8123EDEEE}.Debug|Any CPU.Build.0 = Debug|Any CPU 244 | {BFA3851F-578C-44EE-AC3C-11B8123EDEEE}.Release|Any CPU.ActiveCfg = Release|Any CPU 245 | {BFA3851F-578C-44EE-AC3C-11B8123EDEEE}.Release|Any CPU.Build.0 = Release|Any CPU 246 | {84F27B74-14D4-4939-9321-691E3BE922C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 247 | {84F27B74-14D4-4939-9321-691E3BE922C2}.Debug|Any CPU.Build.0 = Debug|Any CPU 248 | {84F27B74-14D4-4939-9321-691E3BE922C2}.Release|Any CPU.ActiveCfg = Release|Any CPU 249 | {84F27B74-14D4-4939-9321-691E3BE922C2}.Release|Any CPU.Build.0 = Release|Any CPU 250 | {3976BC50-8751-4851-A28E-2E3D40EA4C04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 251 | {3976BC50-8751-4851-A28E-2E3D40EA4C04}.Debug|Any CPU.Build.0 = Debug|Any CPU 252 | {3976BC50-8751-4851-A28E-2E3D40EA4C04}.Release|Any CPU.ActiveCfg = Release|Any CPU 253 | {3976BC50-8751-4851-A28E-2E3D40EA4C04}.Release|Any CPU.Build.0 = Release|Any CPU 254 | {46FB4D86-1F2E-4779-B254-D9549D546084}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 255 | {46FB4D86-1F2E-4779-B254-D9549D546084}.Debug|Any CPU.Build.0 = Debug|Any CPU 256 | {46FB4D86-1F2E-4779-B254-D9549D546084}.Release|Any CPU.ActiveCfg = Release|Any CPU 257 | {46FB4D86-1F2E-4779-B254-D9549D546084}.Release|Any CPU.Build.0 = Release|Any CPU 258 | {3DA1FB4C-A8DC-42E3-87D1-6CD25DAD5E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 259 | {3DA1FB4C-A8DC-42E3-87D1-6CD25DAD5E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU 260 | {3DA1FB4C-A8DC-42E3-87D1-6CD25DAD5E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU 261 | {3DA1FB4C-A8DC-42E3-87D1-6CD25DAD5E6C}.Release|Any CPU.Build.0 = Release|Any CPU 262 | {B06F90BC-AAA9-470E-A6FB-B747A4A5BC08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 263 | {B06F90BC-AAA9-470E-A6FB-B747A4A5BC08}.Debug|Any CPU.Build.0 = Debug|Any CPU 264 | {B06F90BC-AAA9-470E-A6FB-B747A4A5BC08}.Release|Any CPU.ActiveCfg = Release|Any CPU 265 | {B06F90BC-AAA9-470E-A6FB-B747A4A5BC08}.Release|Any CPU.Build.0 = Release|Any CPU 266 | {1E65AF06-19D0-436E-BDCE-4D8B406508B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 267 | {1E65AF06-19D0-436E-BDCE-4D8B406508B4}.Debug|Any CPU.Build.0 = Debug|Any CPU 268 | {1E65AF06-19D0-436E-BDCE-4D8B406508B4}.Release|Any CPU.ActiveCfg = Release|Any CPU 269 | {1E65AF06-19D0-436E-BDCE-4D8B406508B4}.Release|Any CPU.Build.0 = Release|Any CPU 270 | {AFBED5F7-C636-4D66-B4A0-9643B786BD7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 271 | {AFBED5F7-C636-4D66-B4A0-9643B786BD7D}.Debug|Any CPU.Build.0 = Debug|Any CPU 272 | {AFBED5F7-C636-4D66-B4A0-9643B786BD7D}.Release|Any CPU.ActiveCfg = Release|Any CPU 273 | {AFBED5F7-C636-4D66-B4A0-9643B786BD7D}.Release|Any CPU.Build.0 = Release|Any CPU 274 | {9449FDEE-D975-4DCE-9C61-3299B81D03E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 275 | {9449FDEE-D975-4DCE-9C61-3299B81D03E8}.Debug|Any CPU.Build.0 = Debug|Any CPU 276 | {9449FDEE-D975-4DCE-9C61-3299B81D03E8}.Release|Any CPU.ActiveCfg = Release|Any CPU 277 | {9449FDEE-D975-4DCE-9C61-3299B81D03E8}.Release|Any CPU.Build.0 = Release|Any CPU 278 | {F3DF1CAC-5AF3-40C8-B4DC-A6B18F3D5782}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 279 | {F3DF1CAC-5AF3-40C8-B4DC-A6B18F3D5782}.Debug|Any CPU.Build.0 = Debug|Any CPU 280 | {F3DF1CAC-5AF3-40C8-B4DC-A6B18F3D5782}.Release|Any CPU.ActiveCfg = Release|Any CPU 281 | {F3DF1CAC-5AF3-40C8-B4DC-A6B18F3D5782}.Release|Any CPU.Build.0 = Release|Any CPU 282 | {1088F886-9F11-4139-93A6-8AB82980AE0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 283 | {1088F886-9F11-4139-93A6-8AB82980AE0A}.Debug|Any CPU.Build.0 = Debug|Any CPU 284 | {1088F886-9F11-4139-93A6-8AB82980AE0A}.Release|Any CPU.ActiveCfg = Release|Any CPU 285 | {1088F886-9F11-4139-93A6-8AB82980AE0A}.Release|Any CPU.Build.0 = Release|Any CPU 286 | {C26F4CB4-9EE8-4ABA-8078-6D97B3EFEE03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 287 | {C26F4CB4-9EE8-4ABA-8078-6D97B3EFEE03}.Debug|Any CPU.Build.0 = Debug|Any CPU 288 | {C26F4CB4-9EE8-4ABA-8078-6D97B3EFEE03}.Release|Any CPU.ActiveCfg = Release|Any CPU 289 | {C26F4CB4-9EE8-4ABA-8078-6D97B3EFEE03}.Release|Any CPU.Build.0 = Release|Any CPU 290 | {18A516AC-F118-47F9-9602-34957357F310}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 291 | {18A516AC-F118-47F9-9602-34957357F310}.Debug|Any CPU.Build.0 = Debug|Any CPU 292 | {18A516AC-F118-47F9-9602-34957357F310}.Release|Any CPU.ActiveCfg = Release|Any CPU 293 | {18A516AC-F118-47F9-9602-34957357F310}.Release|Any CPU.Build.0 = Release|Any CPU 294 | {C10587D0-D893-4908-ADFE-574F17559142}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 295 | {C10587D0-D893-4908-ADFE-574F17559142}.Debug|Any CPU.Build.0 = Debug|Any CPU 296 | {C10587D0-D893-4908-ADFE-574F17559142}.Release|Any CPU.ActiveCfg = Release|Any CPU 297 | {C10587D0-D893-4908-ADFE-574F17559142}.Release|Any CPU.Build.0 = Release|Any CPU 298 | {F2FBCA2B-F955-4C7C-908F-4C6B09DECA8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 299 | {F2FBCA2B-F955-4C7C-908F-4C6B09DECA8A}.Debug|Any CPU.Build.0 = Debug|Any CPU 300 | {F2FBCA2B-F955-4C7C-908F-4C6B09DECA8A}.Release|Any CPU.ActiveCfg = Release|Any CPU 301 | {F2FBCA2B-F955-4C7C-908F-4C6B09DECA8A}.Release|Any CPU.Build.0 = Release|Any CPU 302 | {AFE87B88-8A09-447D-A311-DAAA420755D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 303 | {AFE87B88-8A09-447D-A311-DAAA420755D8}.Debug|Any CPU.Build.0 = Debug|Any CPU 304 | {AFE87B88-8A09-447D-A311-DAAA420755D8}.Release|Any CPU.ActiveCfg = Release|Any CPU 305 | {AFE87B88-8A09-447D-A311-DAAA420755D8}.Release|Any CPU.Build.0 = Release|Any CPU 306 | {AA1362B3-11DF-4CC6-9D9E-07687D95C3B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 307 | {AA1362B3-11DF-4CC6-9D9E-07687D95C3B5}.Debug|Any CPU.Build.0 = Debug|Any CPU 308 | {AA1362B3-11DF-4CC6-9D9E-07687D95C3B5}.Release|Any CPU.ActiveCfg = Release|Any CPU 309 | {AA1362B3-11DF-4CC6-9D9E-07687D95C3B5}.Release|Any CPU.Build.0 = Release|Any CPU 310 | {82BE4D7F-271B-4DCE-89E1-DEF23FE668C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 311 | {82BE4D7F-271B-4DCE-89E1-DEF23FE668C8}.Debug|Any CPU.Build.0 = Debug|Any CPU 312 | {82BE4D7F-271B-4DCE-89E1-DEF23FE668C8}.Release|Any CPU.ActiveCfg = Release|Any CPU 313 | {82BE4D7F-271B-4DCE-89E1-DEF23FE668C8}.Release|Any CPU.Build.0 = Release|Any CPU 314 | {3F247829-CA16-4D58-A338-36829AAE7D7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 315 | {3F247829-CA16-4D58-A338-36829AAE7D7E}.Debug|Any CPU.Build.0 = Debug|Any CPU 316 | {3F247829-CA16-4D58-A338-36829AAE7D7E}.Release|Any CPU.ActiveCfg = Release|Any CPU 317 | {3F247829-CA16-4D58-A338-36829AAE7D7E}.Release|Any CPU.Build.0 = Release|Any CPU 318 | {B246D81F-C409-4F44-87C3-F189F51745A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 319 | {B246D81F-C409-4F44-87C3-F189F51745A0}.Debug|Any CPU.Build.0 = Debug|Any CPU 320 | {B246D81F-C409-4F44-87C3-F189F51745A0}.Release|Any CPU.ActiveCfg = Release|Any CPU 321 | {B246D81F-C409-4F44-87C3-F189F51745A0}.Release|Any CPU.Build.0 = Release|Any CPU 322 | {27D9ED6F-41CC-43D8-B46D-40C953ECCD2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 323 | {27D9ED6F-41CC-43D8-B46D-40C953ECCD2A}.Debug|Any CPU.Build.0 = Debug|Any CPU 324 | {27D9ED6F-41CC-43D8-B46D-40C953ECCD2A}.Release|Any CPU.ActiveCfg = Release|Any CPU 325 | {27D9ED6F-41CC-43D8-B46D-40C953ECCD2A}.Release|Any CPU.Build.0 = Release|Any CPU 326 | {3ABE0C0E-56D4-484F-9395-54BA43095E47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 327 | {3ABE0C0E-56D4-484F-9395-54BA43095E47}.Debug|Any CPU.Build.0 = Debug|Any CPU 328 | {3ABE0C0E-56D4-484F-9395-54BA43095E47}.Release|Any CPU.ActiveCfg = Release|Any CPU 329 | {3ABE0C0E-56D4-484F-9395-54BA43095E47}.Release|Any CPU.Build.0 = Release|Any CPU 330 | {7EC226EE-ED30-4A21-8565-13E49F742B1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 331 | {7EC226EE-ED30-4A21-8565-13E49F742B1E}.Debug|Any CPU.Build.0 = Debug|Any CPU 332 | {7EC226EE-ED30-4A21-8565-13E49F742B1E}.Release|Any CPU.ActiveCfg = Release|Any CPU 333 | {7EC226EE-ED30-4A21-8565-13E49F742B1E}.Release|Any CPU.Build.0 = Release|Any CPU 334 | {85CABE87-7668-47D4-A6E0-6FBFE12DFC5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 335 | {85CABE87-7668-47D4-A6E0-6FBFE12DFC5C}.Debug|Any CPU.Build.0 = Debug|Any CPU 336 | {85CABE87-7668-47D4-A6E0-6FBFE12DFC5C}.Release|Any CPU.ActiveCfg = Release|Any CPU 337 | {85CABE87-7668-47D4-A6E0-6FBFE12DFC5C}.Release|Any CPU.Build.0 = Release|Any CPU 338 | {C4FA2471-C9EC-43E6-B252-2F9C8FA99FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 339 | {C4FA2471-C9EC-43E6-B252-2F9C8FA99FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU 340 | {C4FA2471-C9EC-43E6-B252-2F9C8FA99FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU 341 | {C4FA2471-C9EC-43E6-B252-2F9C8FA99FC3}.Release|Any CPU.Build.0 = Release|Any CPU 342 | {E2B78947-B117-4979-B3E4-0333C02A7EA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 343 | {E2B78947-B117-4979-B3E4-0333C02A7EA0}.Debug|Any CPU.Build.0 = Debug|Any CPU 344 | {E2B78947-B117-4979-B3E4-0333C02A7EA0}.Release|Any CPU.ActiveCfg = Release|Any CPU 345 | {E2B78947-B117-4979-B3E4-0333C02A7EA0}.Release|Any CPU.Build.0 = Release|Any CPU 346 | {9AEC8F72-F10D-4F0C-8FC0-C902B214E22B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 347 | {9AEC8F72-F10D-4F0C-8FC0-C902B214E22B}.Debug|Any CPU.Build.0 = Debug|Any CPU 348 | {9AEC8F72-F10D-4F0C-8FC0-C902B214E22B}.Release|Any CPU.ActiveCfg = Release|Any CPU 349 | {9AEC8F72-F10D-4F0C-8FC0-C902B214E22B}.Release|Any CPU.Build.0 = Release|Any CPU 350 | EndGlobalSection 351 | GlobalSection(SolutionProperties) = preSolution 352 | HideSolutionNode = FALSE 353 | EndGlobalSection 354 | GlobalSection(NestedProjects) = preSolution 355 | {7EB83A06-90AA-443A-A7D8-2C54D27BA4FE} = {6678DD98-8464-42BF-A2F6-047994F4847E} 356 | {79DED209-3F09-40EF-B094-AFCCC2F7C564} = {088370A7-3196-4B58-B620-0FDDE7829C89} 357 | {50082B0A-22F5-403C-A148-2B4D6A8222F2} = {088370A7-3196-4B58-B620-0FDDE7829C89} 358 | {714A5E8E-F413-442E-881F-2101E0BB4F9F} = {088370A7-3196-4B58-B620-0FDDE7829C89} 359 | {D608108B-2A30-4A64-A222-40794ACCED54} = {BFC911D9-03DA-47F2-8660-448DD7A9A4A4} 360 | {2AC0D5D3-22FD-4408-9A1C-D4F840DA92E9} = {BFC911D9-03DA-47F2-8660-448DD7A9A4A4} 361 | {C43A79F9-8FD2-45C4-8CDA-79C63502DABD} = {BFC911D9-03DA-47F2-8660-448DD7A9A4A4} 362 | {FB781ACC-E8DF-4AA7-AC04-1977D81D9EE3} = {BFC911D9-03DA-47F2-8660-448DD7A9A4A4} 363 | {90C55505-62FC-432C-AFE7-284CDE7CCFF0} = {BFC911D9-03DA-47F2-8660-448DD7A9A4A4} 364 | {413AFEAD-C7D9-44DF-8966-9F955F1FFF83} = {BFC911D9-03DA-47F2-8660-448DD7A9A4A4} 365 | {F0C31ECE-DD83-4780-8108-237D3E689870} = {BFC911D9-03DA-47F2-8660-448DD7A9A4A4} 366 | {52C6D987-3C1A-45D2-AC22-2B934FD8F458} = {BFC911D9-03DA-47F2-8660-448DD7A9A4A4} 367 | {85B41686-F643-4DBB-9DEA-1989CF9B5B06} = {C1245CF3-0070-4EA3-B20E-80146468B9A2} 368 | {A9886A91-1140-4DBE-A885-A06FE242FA62} = {C1245CF3-0070-4EA3-B20E-80146468B9A2} 369 | {2BFAE356-8C7F-4438-8F16-CDBF00A39CB9} = {C1245CF3-0070-4EA3-B20E-80146468B9A2} 370 | {C4F4DC83-A1F8-4BEC-9F27-9531C0C84DBB} = {0D9CB036-ACA6-4911-8E9F-2D0CBF08721A} 371 | {600E0D56-264C-4F0F-8E17-6457C0FE4E4A} = {0D9CB036-ACA6-4911-8E9F-2D0CBF08721A} 372 | {BA350D0B-832D-4BFA-A32B-96879D7402BD} = {0D9CB036-ACA6-4911-8E9F-2D0CBF08721A} 373 | {A8DFB64C-7B08-4223-B2E1-780F69CC6817} = {0D9CB036-ACA6-4911-8E9F-2D0CBF08721A} 374 | {B5886FA2-3A36-41F6-9757-6C3EDC72EC16} = {0D9CB036-ACA6-4911-8E9F-2D0CBF08721A} 375 | {26BF50FC-FFEA-4FF6-8907-04DE56649526} = {773EA059-A4E9-4C60-B323-5F412F1D7976} 376 | {6F2D0348-7E7E-4147-8E5F-EC5ECC84FF3C} = {773EA059-A4E9-4C60-B323-5F412F1D7976} 377 | {FA9AF6C2-9313-4C20-A60C-547DF0511F29} = {773EA059-A4E9-4C60-B323-5F412F1D7976} 378 | {94E98592-9374-4D50-9250-EDA14BA21D77} = {773EA059-A4E9-4C60-B323-5F412F1D7976} 379 | {D5B1C45C-D85B-4952-AF22-D29F3C380DE2} = {773EA059-A4E9-4C60-B323-5F412F1D7976} 380 | {BFA3851F-578C-44EE-AC3C-11B8123EDEEE} = {C7DF3224-CF8A-444C-AEB4-C7970A821411} 381 | {84F27B74-14D4-4939-9321-691E3BE922C2} = {C7DF3224-CF8A-444C-AEB4-C7970A821411} 382 | {3976BC50-8751-4851-A28E-2E3D40EA4C04} = {F7422A70-934F-4308-8D50-ACBBD966BD5C} 383 | {46FB4D86-1F2E-4779-B254-D9549D546084} = {F7422A70-934F-4308-8D50-ACBBD966BD5C} 384 | {3DA1FB4C-A8DC-42E3-87D1-6CD25DAD5E6C} = {F7422A70-934F-4308-8D50-ACBBD966BD5C} 385 | {B06F90BC-AAA9-470E-A6FB-B747A4A5BC08} = {F7422A70-934F-4308-8D50-ACBBD966BD5C} 386 | {1E65AF06-19D0-436E-BDCE-4D8B406508B4} = {F7422A70-934F-4308-8D50-ACBBD966BD5C} 387 | {AFBED5F7-C636-4D66-B4A0-9643B786BD7D} = {0DFD6D98-806F-44EA-A1A4-E6C4D7D670A9} 388 | {9449FDEE-D975-4DCE-9C61-3299B81D03E8} = {0DFD6D98-806F-44EA-A1A4-E6C4D7D670A9} 389 | {F3DF1CAC-5AF3-40C8-B4DC-A6B18F3D5782} = {0DFD6D98-806F-44EA-A1A4-E6C4D7D670A9} 390 | {1088F886-9F11-4139-93A6-8AB82980AE0A} = {0DFD6D98-806F-44EA-A1A4-E6C4D7D670A9} 391 | {C26F4CB4-9EE8-4ABA-8078-6D97B3EFEE03} = {0DFD6D98-806F-44EA-A1A4-E6C4D7D670A9} 392 | {18A516AC-F118-47F9-9602-34957357F310} = {0DFD6D98-806F-44EA-A1A4-E6C4D7D670A9} 393 | {C10587D0-D893-4908-ADFE-574F17559142} = {C2A5617A-1ED3-45B3-B4C0-3C0E4CA00193} 394 | {F2FBCA2B-F955-4C7C-908F-4C6B09DECA8A} = {C2A5617A-1ED3-45B3-B4C0-3C0E4CA00193} 395 | {AFE87B88-8A09-447D-A311-DAAA420755D8} = {C2A5617A-1ED3-45B3-B4C0-3C0E4CA00193} 396 | {AA1362B3-11DF-4CC6-9D9E-07687D95C3B5} = {C2A5617A-1ED3-45B3-B4C0-3C0E4CA00193} 397 | {82BE4D7F-271B-4DCE-89E1-DEF23FE668C8} = {C2A5617A-1ED3-45B3-B4C0-3C0E4CA00193} 398 | {3F247829-CA16-4D58-A338-36829AAE7D7E} = {8FCDD4C4-264C-4F02-8DB9-6AA08C9F96CF} 399 | {B246D81F-C409-4F44-87C3-F189F51745A0} = {8FCDD4C4-264C-4F02-8DB9-6AA08C9F96CF} 400 | {27D9ED6F-41CC-43D8-B46D-40C953ECCD2A} = {8FCDD4C4-264C-4F02-8DB9-6AA08C9F96CF} 401 | {3ABE0C0E-56D4-484F-9395-54BA43095E47} = {8FCDD4C4-264C-4F02-8DB9-6AA08C9F96CF} 402 | {7EC226EE-ED30-4A21-8565-13E49F742B1E} = {6A91EBCE-DF22-4C3D-8723-30829F765579} 403 | {85CABE87-7668-47D4-A6E0-6FBFE12DFC5C} = {6A91EBCE-DF22-4C3D-8723-30829F765579} 404 | {C4FA2471-C9EC-43E6-B252-2F9C8FA99FC3} = {6A91EBCE-DF22-4C3D-8723-30829F765579} 405 | {E2B78947-B117-4979-B3E4-0333C02A7EA0} = {6A91EBCE-DF22-4C3D-8723-30829F765579} 406 | {9AEC8F72-F10D-4F0C-8FC0-C902B214E22B} = {3541F5A7-3325-45B6-BC9F-A0289569C84D} 407 | EndGlobalSection 408 | GlobalSection(ExtensibilityGlobals) = postSolution 409 | SolutionGuid = {96723904-3ECA-4291-9A14-EEC341AC2BE4} 410 | EndGlobalSection 411 | EndGlobal 412 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # COMP1500 C# Code Samples 2 | C# sample codes for COMP1500 course offered at POCU(https://pocu.academy) 3 | 4 | Web-based presentation with annotation is also available for enrolled users as well 5 | --------------------------------------------------------------------------------