diff --git a/.gitignore b/.gitignore index 8a30d258..53a8974e 100644 --- a/.gitignore +++ b/.gitignore @@ -396,3 +396,4 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +/kalkulator/kalkulator.csproj diff --git a/AppsLab.CSharp.Exercises.sln b/AppsLab.CSharp.Exercises.sln index 58bbf6b5..5f96ec7a 100644 --- a/AppsLab.CSharp.Exercises.sln +++ b/AppsLab.CSharp.Exercises.sln @@ -5,98 +5,103 @@ VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{56555FB0-B513-49EF-9002-A5AF135EA090}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-001-StartHere", "src\AppsLab-001-StartHere\AppsLab-001-StartHere.csproj", "{57860CA2-0054-465E-BD1E-024FF8D81354}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-001-StartHere", "src\AppsLab-001-StartHere\AppsLab-001-StartHere.csproj", "{57860CA2-0054-465E-BD1E-024FF8D81354}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{FC89E9B9-1723-4328-B6F1-00EE62E6260F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-001-StartHere.Tests", "tests\AppsLab-001-StartHere.Tests\AppsLab-001-StartHere.Tests.csproj", "{FE64EA2A-841F-49D7-94C6-BB7E50FC972D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-001-StartHere.Tests", "tests\AppsLab-001-StartHere.Tests\AppsLab-001-StartHere.Tests.csproj", "{FE64EA2A-841F-49D7-94C6-BB7E50FC972D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-002-ConsoleWriteLine", "src\AppsLab-002-ConsoleWriteLine\AppsLab-002-ConsoleWriteLine.csproj", "{8CA6707B-A381-4131-909F-50D592953588}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-002-ConsoleWriteLine", "src\AppsLab-002-ConsoleWriteLine\AppsLab-002-ConsoleWriteLine.csproj", "{8CA6707B-A381-4131-909F-50D592953588}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-005-DataTypes", "src\AppsLab-005-DataTypes\AppsLab-005-DataTypes.csproj", "{AB306D1E-2942-4297-ACC3-2975FB8BF18F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-005-DataTypes", "src\AppsLab-005-DataTypes\AppsLab-005-DataTypes.csproj", "{AB306D1E-2942-4297-ACC3-2975FB8BF18F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-006-Constants", "src\AppsLab-006-Constants\AppsLab-006-Constants.csproj", "{F1E80A4A-241C-496D-92D6-B047A0EAF030}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-006-Constants", "src\AppsLab-006-Constants\AppsLab-006-Constants.csproj", "{F1E80A4A-241C-496D-92D6-B047A0EAF030}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-007-Casting", "src\AppsLab-007-Casting\AppsLab-007-Casting.csproj", "{AEEAB66C-8B62-4844-A721-1FA49E82FDEB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-007-Casting", "src\AppsLab-007-Casting\AppsLab-007-Casting.csproj", "{AEEAB66C-8B62-4844-A721-1FA49E82FDEB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-007-Casting.Tests", "tests\AppsLab-007-Casting.Tests\AppsLab-007-Casting.Tests.csproj", "{5B78F61E-B52C-4920-BE97-42AADFAA726F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-007-Casting.Tests", "tests\AppsLab-007-Casting.Tests\AppsLab-007-Casting.Tests.csproj", "{5B78F61E-B52C-4920-BE97-42AADFAA726F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-008-ConsoleReadLine", "src\AppsLab-008-ConsoleReadLine\AppsLab-008-ConsoleReadLine.csproj", "{5314C734-E722-4454-A772-D0F4641E1563}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-008-ConsoleReadLine", "src\AppsLab-008-ConsoleReadLine\AppsLab-008-ConsoleReadLine.csproj", "{5314C734-E722-4454-A772-D0F4641E1563}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-009-Operators", "src\AppsLab-009-Operators\AppsLab-009-Operators.csproj", "{B6030D54-19E2-40EF-8C93-17669CEC23E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-009-Operators", "src\AppsLab-009-Operators\AppsLab-009-Operators.csproj", "{B6030D54-19E2-40EF-8C93-17669CEC23E0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-009-Operators.Tests", "tests\AppsLab-009-Operators.Tests\AppsLab-009-Operators.Tests.csproj", "{A6659FD2-5F11-432B-91B7-C64EAEAF669C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-009-Operators.Tests", "tests\AppsLab-009-Operators.Tests\AppsLab-009-Operators.Tests.csproj", "{A6659FD2-5F11-432B-91B7-C64EAEAF669C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-010-Math", "src\AppsLab-010-Math\AppsLab-010-Math.csproj", "{FD645D4C-9DC8-4603-A77B-8A4782F175F4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-010-Math", "src\AppsLab-010-Math\AppsLab-010-Math.csproj", "{FD645D4C-9DC8-4603-A77B-8A4782F175F4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-010-Math.Tests", "tests\AppsLab-010-Math.Tests\AppsLab-010-Math.Tests.csproj", "{A4527295-4BEE-4E42-8855-B0503A4515E4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-010-Math.Tests", "tests\AppsLab-010-Math.Tests\AppsLab-010-Math.Tests.csproj", "{A4527295-4BEE-4E42-8855-B0503A4515E4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-011-Strings", "src\AppsLab-011-Strings\AppsLab-011-Strings.csproj", "{E90B0337-37CA-401C-997C-05DD11E08FEF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-011-Strings", "src\AppsLab-011-Strings\AppsLab-011-Strings.csproj", "{E90B0337-37CA-401C-997C-05DD11E08FEF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-011-Strings.Tests", "tests\AppsLab-011-Strings.Tests\AppsLab-011-Strings.Tests.csproj", "{22097A4D-261D-4F21-8080-10B4DAAC9E01}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-011-Strings.Tests", "tests\AppsLab-011-Strings.Tests\AppsLab-011-Strings.Tests.csproj", "{22097A4D-261D-4F21-8080-10B4DAAC9E01}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-012-Boolean", "src\AppsLab-012-Boolean\AppsLab-012-Boolean.csproj", "{EE7C6CDA-F919-4078-81DB-E4BA7F7DE34A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-012-Boolean", "src\AppsLab-012-Boolean\AppsLab-012-Boolean.csproj", "{EE7C6CDA-F919-4078-81DB-E4BA7F7DE34A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-012-Boolean.Tests", "tests\AppsLab-012-Boolean.Tests\AppsLab-012-Boolean.Tests.csproj", "{E41ECA72-68B0-4B1B-8A47-39C0E5DA9B94}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-012-Boolean.Tests", "tests\AppsLab-012-Boolean.Tests\AppsLab-012-Boolean.Tests.csproj", "{E41ECA72-68B0-4B1B-8A47-39C0E5DA9B94}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-013-Conditions", "src\AppsLab-013-Conditions\AppsLab-013-Conditions.csproj", "{AD575FD0-3F7B-4CA3-B802-9430C0F61A42}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-013-Conditions", "src\AppsLab-013-Conditions\AppsLab-013-Conditions.csproj", "{AD575FD0-3F7B-4CA3-B802-9430C0F61A42}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-013-Conditions.Tests", "tests\AppsLab-013-Conditions.Tests\AppsLab-013-Conditions.Tests.csproj", "{8B9BEF41-B5E2-4B56-AA43-F83249D4E639}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-013-Conditions.Tests", "tests\AppsLab-013-Conditions.Tests\AppsLab-013-Conditions.Tests.csproj", "{8B9BEF41-B5E2-4B56-AA43-F83249D4E639}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-014-Switch", "src\AppsLab-014-Switch\AppsLab-014-Switch.csproj", "{EBA30F52-B7DA-4B32-BE4F-6914145E2447}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-014-Switch", "src\AppsLab-014-Switch\AppsLab-014-Switch.csproj", "{EBA30F52-B7DA-4B32-BE4F-6914145E2447}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-014-Switch.Tests", "tests\AppsLab-014-Switch.Tests\AppsLab-014-Switch.Tests.csproj", "{6A95C2D3-3B32-4612-A909-2F2AC223416E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-014-Switch.Tests", "tests\AppsLab-014-Switch.Tests\AppsLab-014-Switch.Tests.csproj", "{6A95C2D3-3B32-4612-A909-2F2AC223416E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-015-Arrays", "src\AppsLab-015-Arrays\AppsLab-015-Arrays.csproj", "{DA216DFF-5EC8-4F02-9D0A-3D49212D6903}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-015-Arrays", "src\AppsLab-015-Arrays\AppsLab-015-Arrays.csproj", "{DA216DFF-5EC8-4F02-9D0A-3D49212D6903}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-015-Arrays.Tests", "tests\AppsLab-015-Arrays.Tests\AppsLab-015-Arrays.Tests.csproj", "{2BBC2988-4C3C-45B7-9EA6-F47A23260F32}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-015-Arrays.Tests", "tests\AppsLab-015-Arrays.Tests\AppsLab-015-Arrays.Tests.csproj", "{2BBC2988-4C3C-45B7-9EA6-F47A23260F32}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-016-Loops", "src\AppsLab-016-Loops\AppsLab-016-Loops.csproj", "{2A373E5B-4048-4E70-99EE-2676D2DA9952}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-016-Loops", "src\AppsLab-016-Loops\AppsLab-016-Loops.csproj", "{2A373E5B-4048-4E70-99EE-2676D2DA9952}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-016-Loops.Tests", "tests\AppsLab-016-Loops.Tests\AppsLab-016-Loops.Tests.csproj", "{DB34DF8E-3B5B-44CC-9245-AD79F3198BD3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-016-Loops.Tests", "tests\AppsLab-016-Loops.Tests\AppsLab-016-Loops.Tests.csproj", "{DB34DF8E-3B5B-44CC-9245-AD79F3198BD3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-017-List", "src\AppsLab-017-List\AppsLab-017-List.csproj", "{CEAA82FA-127F-47C2-B25F-5588FB63F7D1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-017-List", "src\AppsLab-017-List\AppsLab-017-List.csproj", "{CEAA82FA-127F-47C2-B25F-5588FB63F7D1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-017-List.Tests", "tests\AppsLab-017-List.Tests\AppsLab-017-List.Tests.csproj", "{FCEEAC1F-D3CF-4C18-9CA3-2288B5DFAA14}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-017-List.Tests", "tests\AppsLab-017-List.Tests\AppsLab-017-List.Tests.csproj", "{FCEEAC1F-D3CF-4C18-9CA3-2288B5DFAA14}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-018-Methods", "src\AppsLab-018-Methods\AppsLab-018-Methods.csproj", "{571B250E-E17D-4CD6-8778-52B838EB9DA0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-018-Methods", "src\AppsLab-018-Methods\AppsLab-018-Methods.csproj", "{571B250E-E17D-4CD6-8778-52B838EB9DA0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-018-Methods.Tests", "tests\AppsLab-018-Methods.Tests\AppsLab-018-Methods.Tests.csproj", "{526B06CA-4937-44F2-97FB-E85680DD7867}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-018-Methods.Tests", "tests\AppsLab-018-Methods.Tests\AppsLab-018-Methods.Tests.csproj", "{526B06CA-4937-44F2-97FB-E85680DD7867}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-019-MethodsOverloading", "src\AppsLab-019-MethodsOverloading\AppsLab-019-MethodsOverloading.csproj", "{24D704DB-AB81-4F18-899C-910E8D45FC8B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-019-MethodsOverloading", "src\AppsLab-019-MethodsOverloading\AppsLab-019-MethodsOverloading.csproj", "{24D704DB-AB81-4F18-899C-910E8D45FC8B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-019-MethodsOverloading.Tests", "tests\AppsLab-019-MethodsOverloading.Tests\AppsLab-019-MethodsOverloading.Tests.csproj", "{05E10AD6-94B3-4761-95E4-1F19E14F36D1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-019-MethodsOverloading.Tests", "tests\AppsLab-019-MethodsOverloading.Tests\AppsLab-019-MethodsOverloading.Tests.csproj", "{05E10AD6-94B3-4761-95E4-1F19E14F36D1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-020-OOP", "src\AppsLab-020-OOP\AppsLab-020-OOP.csproj", "{8CB5085F-5996-490C-90EC-022AB4AD9CBC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-020-OOP", "src\AppsLab-020-OOP\AppsLab-020-OOP.csproj", "{8CB5085F-5996-490C-90EC-022AB4AD9CBC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-021-Interfaces", "src\AppsLab-021-Interfaces\AppsLab-021-Interfaces.csproj", "{9E3CBBE1-9A1A-4C1C-817C-28D383D18384}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-021-Interfaces", "src\AppsLab-021-Interfaces\AppsLab-021-Interfaces.csproj", "{9E3CBBE1-9A1A-4C1C-817C-28D383D18384}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-022-Files", "src\AppsLab-022-Files\AppsLab-022-Files.csproj", "{D3BFAA25-E460-4EC1-A60C-C183775DE8CC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-022-Files", "src\AppsLab-022-Files\AppsLab-022-Files.csproj", "{D3BFAA25-E460-4EC1-A60C-C183775DE8CC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-024-Events", "src\AppsLab-024-Events\AppsLab-024-Events.csproj", "{FC964C5F-0F80-4EDF-97E8-A4A20DE5492D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-024-Events", "src\AppsLab-024-Events\AppsLab-024-Events.csproj", "{FC964C5F-0F80-4EDF-97E8-A4A20DE5492D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-025-Lambda", "src\AppsLab-025-Lambda\AppsLab-025-Lambda.csproj", "{80DD908F-E015-4FD0-93AA-743A22E745EE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-025-Lambda", "src\AppsLab-025-Lambda\AppsLab-025-Lambda.csproj", "{80DD908F-E015-4FD0-93AA-743A22E745EE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-026-LINQ", "src\AppsLab-026-LINQ\AppsLab-026-LINQ.csproj", "{AE78C877-CE90-425B-BDDE-4951C6C3B577}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-026-LINQ", "src\AppsLab-026-LINQ\AppsLab-026-LINQ.csproj", "{AE78C877-CE90-425B-BDDE-4951C6C3B577}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-027-Generics", "src\AppsLab-027-Generics\AppsLab-027-Generics.csproj", "{0333D249-02A9-47AD-BDA6-5FD7ABF7F066}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-027-Generics", "src\AppsLab-027-Generics\AppsLab-027-Generics.csproj", "{0333D249-02A9-47AD-BDA6-5FD7ABF7F066}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-028-Indexers", "src\AppsLab-028-Indexers\AppsLab-028-Indexers.csproj", "{FA0DDC17-5730-4310-A421-7668B21E1CDD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-028-Indexers", "src\AppsLab-028-Indexers\AppsLab-028-Indexers.csproj", "{FA0DDC17-5730-4310-A421-7668B21E1CDD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-029-Async", "src\AppsLab-029-Async\AppsLab-029-Async.csproj", "{EC3E5278-8120-4A67-A57B-B7DE5211E12A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-029-Async", "src\AppsLab-029-Async\AppsLab-029-Async.csproj", "{EC3E5278-8120-4A67-A57B-B7DE5211E12A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-030-JSON", "src\AppsLab-030-JSON\AppsLab-030-JSON.csproj", "{4D0AE262-0F9B-4E15-B5EA-6CCB0B81FE2C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-030-JSON", "src\AppsLab-030-JSON\AppsLab-030-JSON.csproj", "{4D0AE262-0F9B-4E15-B5EA-6CCB0B81FE2C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-031-XML", "src\AppsLab-031-XML\AppsLab-031-XML.csproj", "{7BEA7878-B5BA-4480-BC56-2F7B836F64B9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-031-XML", "src\AppsLab-031-XML\AppsLab-031-XML.csproj", "{7BEA7878-B5BA-4480-BC56-2F7B836F64B9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-033-NuGet", "src\AppsLab-033-NuGet\AppsLab-033-NuGet.csproj", "{38FFE1DF-4B49-40C1-9908-51860BCF2D3E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-033-NuGet", "src\AppsLab-033-NuGet\AppsLab-033-NuGet.csproj", "{38FFE1DF-4B49-40C1-9908-51860BCF2D3E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-034-Debug", "src\AppsLab-034-Debug\AppsLab-034-Debug.csproj", "{83C963FD-DC23-46E8-9545-F56197164810}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppsLab-034-Debug", "src\AppsLab-034-Debug\AppsLab-034-Debug.csproj", "{83C963FD-DC23-46E8-9545-F56197164810}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "kalkulator", "kalkulator\kalkulator.csproj", "{2336FE74-A86E-4E6E-9948-B73DCE325B47}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "hra", "hra\hra.csproj", "{E483878F-9190-44B6-9553-964CC2711706}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "zvierata", "zvierata\zvierata.csproj", "{A113367E-6EDE-46A7-84F8-C91A12282457}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "student", "student\student.csproj", "{577F154C-D0D4-48FE-A5DC-445CCCECD4DB}" EndProject Global - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 @@ -226,18 +231,6 @@ Global {A6659FD2-5F11-432B-91B7-C64EAEAF669C}.Release|x64.Build.0 = Release|Any CPU {A6659FD2-5F11-432B-91B7-C64EAEAF669C}.Release|x86.ActiveCfg = Release|Any CPU {A6659FD2-5F11-432B-91B7-C64EAEAF669C}.Release|x86.Build.0 = Release|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|x64.ActiveCfg = Debug|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|x64.Build.0 = Debug|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|x86.ActiveCfg = Debug|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|x86.Build.0 = Debug|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|Any CPU.Build.0 = Release|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|x64.ActiveCfg = Release|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|x64.Build.0 = Release|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|x86.ActiveCfg = Release|Any CPU - {B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|x86.Build.0 = Release|Any CPU {FD645D4C-9DC8-4603-A77B-8A4782F175F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FD645D4C-9DC8-4603-A77B-8A4782F175F4}.Debug|Any CPU.Build.0 = Debug|Any CPU {FD645D4C-9DC8-4603-A77B-8A4782F175F4}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -634,6 +627,21 @@ Global {83C963FD-DC23-46E8-9545-F56197164810}.Release|x64.Build.0 = Release|Any CPU {83C963FD-DC23-46E8-9545-F56197164810}.Release|x86.ActiveCfg = Release|Any CPU {83C963FD-DC23-46E8-9545-F56197164810}.Release|x86.Build.0 = Release|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Debug|x64.ActiveCfg = Debug|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Debug|x64.Build.0 = Debug|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Debug|x86.ActiveCfg = Debug|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Debug|x86.Build.0 = Debug|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Release|Any CPU.Build.0 = Release|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Release|x64.ActiveCfg = Release|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Release|x64.Build.0 = Release|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Release|x86.ActiveCfg = Release|Any CPU + {2336FE74-A86E-4E6E-9948-B73DCE325B47}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {57860CA2-0054-465E-BD1E-024FF8D81354} = {56555FB0-B513-49EF-9002-A5AF135EA090} diff --git a/ConsoleApp1/ConsoleApp1.sln b/ConsoleApp1/ConsoleApp1.sln new file mode 100644 index 00000000..040f1647 --- /dev/null +++ b/ConsoleApp1/ConsoleApp1.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36518.9 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{B0D2C785-961A-4C25-85E4-E5DF4F354431}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0D2C785-961A-4C25-85E4-E5DF4F354431}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0D2C785-961A-4C25-85E4-E5DF4F354431}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0D2C785-961A-4C25-85E4-E5DF4F354431}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0D2C785-961A-4C25-85E4-E5DF4F354431}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4D998F3B-ABBE-48D1-80A5-63D150FDE9B1} + EndGlobalSection +EndGlobal diff --git a/ConsoleApp1/ConsoleApp1/ConsoleApp1.csproj b/ConsoleApp1/ConsoleApp1/ConsoleApp1.csproj new file mode 100644 index 00000000..2150e379 --- /dev/null +++ b/ConsoleApp1/ConsoleApp1/ConsoleApp1.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/ConsoleApp1/ConsoleApp1/Program.cs b/ConsoleApp1/ConsoleApp1/Program.cs new file mode 100644 index 00000000..3751555c --- /dev/null +++ b/ConsoleApp1/ConsoleApp1/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/ConsoleApp2/Class1.cs b/ConsoleApp2/Class1.cs new file mode 100644 index 00000000..5f91eb95 --- /dev/null +++ b/ConsoleApp2/Class1.cs @@ -0,0 +1,11 @@ +public class citac +{ + private const string _fileName = "C:\Users\NTB\OneDrive\Počítač\prax.txt"; + + public int CountWords() + { + string text = File.ReadAllText(_fileName); + string[] words = text.Split(' '11); + return words.Length; + } +} diff --git a/ConsoleApp2/Program.cs b/ConsoleApp2/Program.cs new file mode 100644 index 00000000..e02abfc9 --- /dev/null +++ b/ConsoleApp2/Program.cs @@ -0,0 +1 @@ + diff --git a/ConsoleApp2/citac slov.csproj b/ConsoleApp2/citac slov.csproj new file mode 100644 index 00000000..2150e379 --- /dev/null +++ b/ConsoleApp2/citac slov.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/hra kockova/FileProvider.cs b/hra kockova/FileProvider.cs new file mode 100644 index 00000000..b3685f65 --- /dev/null +++ b/hra kockova/FileProvider.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace uhadni +{ + internal class FileProvider + { + public int LoadMaxNumber(string filename) + { + string fileContent = File.ReadAllText(filename); + + + int maxnumber = Convert.ToInt32(fileContent); + return maxnumber; + } + + } +} + diff --git a/hra kockova/Program.cs b/hra kockova/Program.cs new file mode 100644 index 00000000..31a9e548 --- /dev/null +++ b/hra kockova/Program.cs @@ -0,0 +1,19 @@ +using uhadni; + +Engine engine = new Engine(); +Console.WriteLine("pokracuj stlacenim klavesi"); + +while (Console.ReadKey(true).Key != ConsoleKey.Escape) +{ + + FileProvider myFileProvider = new FileProvider(); + + int maxNumber = myFileProvider.LoadMaxNumber("C:\\Users\\NTB\\OneDrive\\Dokumenty\\prax\\numberguess.txt"); + Randomizer myRandomizer = new Randomizer(maxNumber); + int randomNumber = myRandomizer.Random(); + + + + engine.Do(randomNumber); + Console.WriteLine("pokracuj stlacenim klavesiy , ESC ukončíš program"); +} diff --git a/hra kockova/Randomizer.cs b/hra kockova/Randomizer.cs new file mode 100644 index 00000000..5e6b42c9 --- /dev/null +++ b/hra kockova/Randomizer.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace uhadni +{ + internal class Randomizer + { + + private int MaxNumber; + private Random Rnd; + + public Randomizer(int maxNumber) + { + Rnd = new Random(); + MaxNumber = maxNumber; + } + public int Random() + + { + Random rnd = new Random(); + int nextNumber = rnd.Next(MaxNumber); + return nextNumber; + } + } +} diff --git a/hra kockova/engine.cs b/hra kockova/engine.cs new file mode 100644 index 00000000..bc91f3af --- /dev/null +++ b/hra kockova/engine.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace uhadni +{ + internal class Engine + { + private int ReadUserInput() + { + while (true) + { + string userInput = Console.ReadLine(); + if (int.TryParse(userInput, out int value)) + { + return value; + } + Console.WriteLine("Nevieš čo je číslo???"); + } + } + + public void Do(int randomNumber) + { + Console.WriteLine("Zadaj tvoj tip"); + + int guess = ReadUserInput(); + + while (guess != randomNumber) + { + if (guess > randomNumber) + { + Console.WriteLine("Skús menšie"); + } + else if (guess < randomNumber) + { + Console.WriteLine("Skús väčšie"); + } + guess = ReadUserInput(); + } + Console.WriteLine("Gratulujem uhadol si"); + } + } +} diff --git a/hra kockova/uhadni cislo.csproj b/hra kockova/uhadni cislo.csproj new file mode 100644 index 00000000..84d59ec1 --- /dev/null +++ b/hra kockova/uhadni cislo.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + hra_kockova + enable + enable + + + diff --git a/hra/Monster.cs b/hra/Monster.cs new file mode 100644 index 00000000..0e0e116a --- /dev/null +++ b/hra/Monster.cs @@ -0,0 +1,30 @@ +using ConsoleApp1; + +namespace ConsoleApp1 +{ + public class Monster + { + private const int maxHP = 200; + private const int minHP = 0; + + private int currentHP = maxHP; + private int Monsterdamage = 1; + + public Monster(string? monstername) + { + } + + public bool DealDamage(Player opponent) + { + opponent.Takedamage(Monsterdamage); + return true; + } + + internal void Takedamage(int damage) + { + currentHP -= damage; + } + } +} + + diff --git a/hra/Player.cs b/hra/Player.cs new file mode 100644 index 00000000..08eb91cd --- /dev/null +++ b/hra/Player.cs @@ -0,0 +1,32 @@ + + +using System.ComponentModel; + +namespace ConsoleApp1 +{ + public class Player + { + private const int maxHP = 100; + private const int minHP = 0; + + private int currentHP = maxHP; + private int damage = 25; + List inventory = new List(); + private string Name; + internal void SetName(string? playername) + { + Name = playername; + } + + public bool DealDamage(Monster opponent) + { + opponent.Takedamage(damage); + return true; + } + + internal void Takedamage(int damage) + { + currentHP -= damage; + } + } +} diff --git a/hra/Program.cs b/hra/Program.cs new file mode 100644 index 00000000..1ba1d0bd --- /dev/null +++ b/hra/Program.cs @@ -0,0 +1,21 @@ +using ConsoleApp1; + +Console.WriteLine("Zadaj meno hráčovy"); +string playername = Console.ReadLine(); +Console.WriteLine("Zadaj meno príšeri"); +string monstername = Console.ReadLine(); + + +Player player = new Player(); +player.SetName(playername); + +Monster monster = new Monster(monstername); + +player.DealDamage(monster); + +Console.WriteLine(); + +monster.DealDamage(player); + +Console.WriteLine(); + diff --git a/hra/hra.csproj b/hra/hra.csproj new file mode 100644 index 00000000..f02677bf --- /dev/null +++ b/hra/hra.csproj @@ -0,0 +1,10 @@ + + + + Exe + net7.0 + enable + enable + + + diff --git a/kalkulator/NewFile b/kalkulator/NewFile new file mode 100644 index 00000000..e69de29b diff --git a/kalkulator/Program.cs b/kalkulator/Program.cs new file mode 100644 index 00000000..a46d7573 --- /dev/null +++ b/kalkulator/Program.cs @@ -0,0 +1,78 @@ +//using System.Numerics; +//{ +// int a = 20; +// int b = 5; + +// int sum = a + b; +// int differenc = a - b; +// int product = a * b; +// int division = a / b; +// int remainder = a % b; + +// bool rovnost = a == b; +// bool nerovnost = a != b; +// bool väčšíako = a > b; +// bool menšíako = a < b; +// bool väčšíaleborovnýako = a >= b; +// bool menšíaleborovnýako = a <= b; +//} + +//using System.Numerics; + +//bool a = true; +//bool b = 74; +//bool c = 42; + +//bool andBool1 = a && (b > c); +//bool andBool2 = a && (b==c); +//bool andBool3 = a && (b == c) || (c < b); +//bool andBool4 = a && ((b ==c) || (c < b)); +//int d = 0; + + +//načitam si cislo s klavesnice + +//ak je to 6-vypis ides este raz + +//int age = 20; + +//if (age <= 18) ; +//{ +// Console.WriteLine("Som dospely "); +// Console.WriteLine("Dam si pivo"); +//} + +//Console.WriteLine("Hoď kockou"); +//string s = Console.ReadLine(); + +//int cislo = int.Parse(s); + +//if (cislo >= 1 && cislo <= 6); +//{ +// Console.WriteLine("Hurá hodil si kockou"); +//} + +Console.WriteLine("Zadaj prvé cislo"); +int cislo1 = int .Parse(Console.ReadLine()); +Console.WriteLine("WOW super"); +Console.WriteLine("Zadaj druhe cislo"); +int cislo2 = int .Parse(Console.ReadLine()); + +int sucet = cislo1 + cislo2; +Console.WriteLine($"Sucet {sucet}"); +int rozdiel = cislo1 - cislo2; +Console.WriteLine($"Rozdiel{rozdiel}"); +int sucin = cislo1 * cislo2; +Console.WriteLine($"sucin{sucin}"); +int podiel = cislo1 / cislo2; + + + + + + + + + + + diff --git a/numberguess.txt b/numberguess.txt new file mode 100644 index 00000000..2a095c4d --- /dev/null +++ b/numberguess.txt @@ -0,0 +1 @@ +271 \ No newline at end of file diff --git a/quiz/Program.cs b/quiz/Program.cs new file mode 100644 index 00000000..63f811ef --- /dev/null +++ b/quiz/Program.cs @@ -0,0 +1,4 @@ +Console.WriteLine("Vítaj v mojom kvíze"); +Console.WriteLine("Poďme teda na to"); +Console.WriteLine("Prvá otázka kolko mam rokov "); + diff --git a/quiz/quiz.csproj b/quiz/quiz.csproj new file mode 100644 index 00000000..2150e379 --- /dev/null +++ b/quiz/quiz.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/src/AppsLab-001-StartHere/Greetings.cs b/src/AppsLab-001-StartHere/Greetings.cs index fbe10953..f02fdb12 100644 --- a/src/AppsLab-001-StartHere/Greetings.cs +++ b/src/AppsLab-001-StartHere/Greetings.cs @@ -11,6 +11,6 @@ public class Greetings /// A string containing the greeting message. public string Hello() { - return "Hello World!"; + return "Hello AppsLab!"; } } diff --git a/src/AppsLab-002-ConsoleWriteLine/Program.cs b/src/AppsLab-002-ConsoleWriteLine/Program.cs index 837131c2..a15bb6fc 100644 --- a/src/AppsLab-002-ConsoleWriteLine/Program.cs +++ b/src/AppsLab-002-ConsoleWriteLine/Program.cs @@ -1 +1,11 @@ -Console.WriteLine("Hello, World!"); \ No newline at end of file +int age = 8; +string name = "Makar"; + +Console.WriteLine(age); +Console.WriteLine(name); + +Console.WriteLine($"My name is {name} and Im {age} years old."); + + + + diff --git a/src/AppsLab-005-DataTypes/Program.cs b/src/AppsLab-005-DataTypes/Program.cs index 3751555c..d72cb74b 100644 --- a/src/AppsLab-005-DataTypes/Program.cs +++ b/src/AppsLab-005-DataTypes/Program.cs @@ -1,2 +1,43 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +const string Welcome = "Vitajte v AppsLabe!"; + +int mojeCislo = 1234; +string mojeSlovo = "Ahoj, svet"; +bool mojaBoolHodnota = true; +DateTime dnesnyDatum = DateTime.Now; +float myFloat = 5.75f; +int sucet = mojeCislo + 5; +var myVar = "Toto je var string"; +const int MaxStudents = 15; + + +Console.WriteLine(mojeCislo.ToString("000000")); +Console.WriteLine(mojeSlovo); +Console.WriteLine($"Súčet je: {sucet}"); +Console.WriteLine($"dnes je robotkac{dnesnyDatum.ToString("yyyy-MM-dd")}"); +Console.WriteLine($"Bool Hodnota je: {mojaBoolHodnota}"); +Console.WriteLine(myVar); +Console.WriteLine(myFloat); +Console.WriteLine("Maximálny počet študentov v triede je: " + MaxStudents); +Console.WriteLine(Welcome); + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AppsLab-006-Constants/Program.cs b/src/AppsLab-006-Constants/Program.cs index 3751555c..dc318f12 100644 --- a/src/AppsLab-006-Constants/Program.cs +++ b/src/AppsLab-006-Constants/Program.cs @@ -1,2 +1,8 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +const int MaxPoints = 200; +const int MinAgeForDriversLicense = 16; +const string WelcomeMessage = "Welcome to the Gulag!"; + +Console.WriteLine(MaxPoints); +Console.WriteLine(MinAgeForDriversLicense); +Console.WriteLine(WelcomeMessage); + diff --git a/src/AppsLab-007-Casting/Converter.cs b/src/AppsLab-007-Casting/Converter.cs index a64ce567..60e95db0 100644 --- a/src/AppsLab-007-Casting/Converter.cs +++ b/src/AppsLab-007-Casting/Converter.cs @@ -10,7 +10,7 @@ public class Converter /// public double IntToDouble(int number) { - throw new NotImplementedException(); + return Convert.ToDouble(number); } /// @@ -18,7 +18,7 @@ public double IntToDouble(int number) /// public int DoubleToInt(double number) { - throw new NotImplementedException(); + return Convert.ToInt32(number); } /// @@ -26,7 +26,7 @@ public int DoubleToInt(double number) /// public double StringToDouble(string number) { - throw new NotImplementedException(); + return Convert.ToDouble(number); } /// @@ -34,7 +34,7 @@ public double StringToDouble(string number) /// public string DoubleToString(double number) { - throw new NotImplementedException(); + return Convert.ToString(number); } /// @@ -42,7 +42,7 @@ public string DoubleToString(double number) /// public string IntToString(int number) { - throw new NotImplementedException(); + return Convert.ToString(number); } /// @@ -50,14 +50,14 @@ public string IntToString(int number) /// public bool StringToBool(string boolValue) { - throw new NotImplementedException(); + return Convert.ToBoolean(boolValue); } - /// - /// This method converts a boolean to a string. - /// - public string BoolToString(bool boolValue) +/// +/// This method converts a boolean to a string. +/// +public string BoolToString(bool boolValue) { - throw new NotImplementedException(); + return Convert.ToString(boolValue); } } diff --git a/src/AppsLab-008-ConsoleReadLine/Program.cs b/src/AppsLab-008-ConsoleReadLine/Program.cs index 6f7376c9..967431a9 100644 --- a/src/AppsLab-008-ConsoleReadLine/Program.cs +++ b/src/AppsLab-008-ConsoleReadLine/Program.cs @@ -1,8 +1,125 @@ -Console.WriteLine("Ako sa voláš?"); -string? meno = Console.ReadLine(); -Console.WriteLine("Ahoj, " + meno); - -Console.WriteLine("Koľko máš rokov?"); -string vstup = Console.ReadLine() ?? "0"; -int vek = int.Parse(vstup); -Console.WriteLine("Máš " + vek + " rokov."); +//Console.WriteLine("Zadaj prvé číslo"); +//int cislo1 = int.Parse(Console.ReadLine()); +//Console.WriteLine("Zadaj druhé číslo"); +//int cislo2 = int.Parse(Console.ReadLine()); +//Console.WriteLine("Zadaj operáciu +,-,*,/,%"); +//string operacia = Console.ReadLine(); + +//int vysledok = operacia switch +//{ +// "+" => cislo1 + cislo2, +// "-" => cislo1 - cislo2, +// "*" => cislo1 * cislo2, +// "/" => cislo1 / cislo2, +// "%" => cislo1 % cislo2, +//}; + +//Console.WriteLine($"Tvoj vysledok je {vysledok}"); + +//Console.WriteLine("Zadaj číslom deň týždňa"); +//int dayofweak = int .Parse(Console.ReadLine()); + +//switch (dayofweak) +//{ +// case 1: +// Console.WriteLine("Pondelok"); +// break; +// case 2: +// Console.WriteLine("Utorok"); +// break; +// case 3: +// Console.WriteLine("Streda"); +// break; +// case 4: +// Console.WriteLine("Štvrtok"); +// break; +// case 5: +// Console.WriteLine("Piatok"); +// break; +// case 6: +// Console.WriteLine("Sobota"); +// break; +// case 7: +// Console.WriteLine("Nedeľa"); +// break; +// default: +// Console.WriteLine("Neplatný deň"); +// break; +//} +//int numberDescription; +//int; numberDescription = numberDescription switch +//{ +// 1 => "jeden", +// 2 => "dva", +// 3 => "tri", +// _ => "Neznáme číslo" +//}; + +//Console.WriteLine(numberDescription); //vypise:tri + +//Console.WriteLine("1"); +//Console.WriteLine("2"); +//Console.WriteLine("3"); +//Console.WriteLine("4"); +//Console.WriteLine("5"); +//Console.WriteLine("6"); +//Console.WriteLine("7"); +//Console.WriteLine("8"); +//Console.WriteLine("9"); +//Console.WriteLine("10"); + +//int i = 1; +//while (i <= 1000) +//{ +// Console.WriteLine(i); +// i++; +//} + + + +//for (int i = 1; i <= 1000; i++) +//{ +// int modulo = i % 2; +// if (modulo == 0) ; +// { +// Console.WriteLine(i); +// } +//} + +//int[] numbers = new int[5]; + +//numbers[0] = 10; +//numbers[1] = 300; +//numbers[2] = 20; +//numbers[3] = 40; +//numbers[4] = 50; +//int index = 0; + +//while (index < 5) +//{ +// Console.WriteLine(numbers[index]); +// index++; +//} +//for (int i = 0; i <5; i++) +//{ +// Console.WriteLine(numbers[i]); +//} +//foreach (int i in numbers) +//{ +// Console.WriteLine(numbers); +//} +int[] numbers = new int[] { 10, 300, 20, 40, 50 }; +string[] names = new string[] { "Janko", "Fero", "Miro", "Laco", "Palo" }; +string[,] matrix = new string[30, 5]; +matrix[0, 2] = "Janko"; +matrix[1, 2] = "Fero"; +matrix[25, 4] = "Miro"; + +for (int i = 0; i < 30; i++) +{ + for (int j = 0; j < 5; j++) + { + Console.Write(matrix[i, j] + ", "); + } + Console.WriteLine(); +} diff --git a/src/AppsLab-014-Switch/MovieRating.cs b/src/AppsLab-014-Switch/MovieRating.cs index ab689d49..434015cf 100644 --- a/src/AppsLab-014-Switch/MovieRating.cs +++ b/src/AppsLab-014-Switch/MovieRating.cs @@ -12,6 +12,23 @@ public class MovieRating /// A string describing the specified movie rating. public string GetRatingDescription(int rating) { - throw new NotImplementedException(); + switch (rating) + { + case 1: + return "Veľmi zlý"; + case 2: + return "Zlý"; + case 3: + return "Priemerný"; + case 4: + return "Dobrý"; + case 5: + return "Výborný"; + default: + return "Neplatné hodnotenie"; + + } } -} \ No newline at end of file +} + + diff --git a/src/AppsLab-019-MethodsOverloading/PasswordGenerator.cs b/src/AppsLab-019-MethodsOverloading/PasswordGenerator.cs index b48403a4..a7670fc5 100644 --- a/src/AppsLab-019-MethodsOverloading/PasswordGenerator.cs +++ b/src/AppsLab-019-MethodsOverloading/PasswordGenerator.cs @@ -1,3 +1,5 @@ +using System.Reflection; + namespace AppsLab_019_MethodsOverloading { /// @@ -11,6 +13,7 @@ public class PasswordGenerator private const string Numbers = "0123456789"; private readonly Random _random = new(); + private readonly string password; /// /// Generates a random password with the default length of 8 characters and no special characters or numbers. @@ -18,7 +21,9 @@ public class PasswordGenerator /// A randomly generated password. public string GeneratePassword() { - throw new NotImplementedException(); + + + return GeneratePassword(DefaultLength); } /// @@ -28,7 +33,13 @@ public string GeneratePassword() /// A randomly generated password. public string GeneratePassword(int length) { - throw new NotImplementedException(); + string password = ""; + for (int i = 0; i < length; i++) + { + int randomNumber = _random.Next(27); + password = password + Alphabet[randomNumber].ToString(); + } + return password; } /// @@ -40,7 +51,20 @@ public string GeneratePassword(int length) /// A randomly generated password. public string GeneratePassword(int length, bool includeSpecialChars, bool includeNumbers) { - throw new NotImplementedException(); + string password = GeneratePassword(length); + if (includeSpecialChars) + { + int index = _random.Next(0,9); + password.Replace(password[length - 1], SpecialChars[index]); + // + } + if (includeNumbers) + { + + int index1 = _random.Next(0,9); + password.Replace(password[0], SpecialChars[index1]); + } + return password; } } } \ No newline at end of file diff --git a/src/AppsLab-022-Files/Program.cs b/src/AppsLab-022-Files/Program.cs index 3751555c..d3fabb63 100644 --- a/src/AppsLab-022-Files/Program.cs +++ b/src/AppsLab-022-Files/Program.cs @@ -1,2 +1,28 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); + +class program +{ + static void Main() + { + // Cesta k súboru – môžeš si ju zmeniť podľa seba + string filename = @"C:\Users\NTB\OneDrive\Počítač\prax.txt"; + + Console.WriteLine("Píš text. Keď chceš skončiť, napíš 'koniec'."); + + while (true) + { + // Načíta riadok z klávesnice + string text = Console.ReadLine(); + File.AppendAllText(filename, text); + + // Ak napíšem "koniec", program sa ukončí + if (text.ToLower() == "koniec") + { + Console.WriteLine("Program skončil."); + break; + } + + // Zapíše text do súboru a pridá nový riadok + File.AppendAllText(filename, text + Environment.NewLine); + } + } +} \ No newline at end of file diff --git a/src/ConsoleApp1/ConsoleApp1.csproj b/src/ConsoleApp1/ConsoleApp1.csproj new file mode 100644 index 00000000..2150e379 --- /dev/null +++ b/src/ConsoleApp1/ConsoleApp1.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/src/ConsoleApp1/Program.cs b/src/ConsoleApp1/Program.cs new file mode 100644 index 00000000..9cf5d3b5 --- /dev/null +++ b/src/ConsoleApp1/Program.cs @@ -0,0 +1,487 @@ +Console.BackgroundColor = ConsoleColor.Magenta; +Console.ForegroundColor = ConsoleColor.Cyan; + +Console.WriteLine("Zadajte text"); +string input = Console.ReadLine(); +string output = ""; +string[,] matrix = new string[100, 100]; +int offset = 0; + +foreach (char inputletter in input) +{ + string outletter = Getletter(inputletter.ToString()); + string[] lines = outletter.Split(Environment.NewLine); + int letterWight = 0; + for (int i = 0; i < lines.Length; i++) + { + string charakter = lines[i]; + letterWight = Math.Max(lines[i].Length, letterWight); + + for (int j = 0; j < charakter.Length; j++) + { + matrix[i, j + offset] = charakter[j].ToString(); + } + } + offset = offset + letterWight; +} +for (int i = 0;i < matrix.GetLength(0);i++) +{ + for (int j = 0; j < matrix.GetLength(1); j++) + { + Console.Write(matrix[i, j]); + } + Console.WriteLine(); +} + + +string Getletter (string input) +{ + switch (input) + { + case "a": + case "A": + case "á": + case "Á": + return GetletterA(); + case "b": + case "B": + return GetletterB(); + case "c": + case "C": + case "č": + case "Č": + return GetletterC(); + case "d": + case "ď": + case "D": + case "Ď": + return GetletterD(); + case "e": + case "é": + case "E": + case "É": + return GetletterE(); + case "f": + case "F": + return GetletterF(); + case "g": + case "G": + return GetletterG(); + case "h": + case "H": + return GetletterH(); + case "i": + case "í": + case "I": + case "Í": + return GetletterI(); + case "j": + case "J": + return GetletterJ(); + case "k": + case "K": + return GetletterK(); + case "l": + case "ĺ": + case "ľ": + case "L": + case "Ĺ": + case "Ľ": + return GetletterL(); + case "m": + case "M": + return GetletterM(); + case "n": + case "N": + return GetletterN(); + case "o": + case "ó": + case "O": + case "Ó": + return GetletterO(); + case "p": + case "P": + return GetletterP(); + case "q": + case "Q": + return GetletterQ(); + case "r": + case "ŕ": + case "R": + case "Ŕ": + return GetletterR(); + case "s": + case "š": + case "S": + case "Š": + return GetletterS(); + case "t": + case "ť": + case "T": + case "Ť": + return GetletterT(); + case "u": + case "ú": + case "U": + case "Ú": + return GetletterU(); + case "v": + case "V": + return GetletterV(); + case "w": + case "W": + return GetletterW(); + case "x": + case "X": + return GetletterX(); + case "y": + case "ý": + case "Y": + case "Ý": + return GetletterY(); + case "z": + case "Z": + case "ž": + case "Ž": + return GetletterZ(); + default: + return "Písmeno nieje podporované"; + + } +} + +Console.WriteLine(output); +string GetletterA() +{ + return @" +.------. +|A.--. | +| (\/) | +| :\/: | +| '--'A| +`------'"; +} + + +Console.WriteLine(output); +string GetletterB() +{ + return @" +.------. +|B.--. | +| :(): | +| ()() | +| '--'B| +`------'"; + +} + + + Console.WriteLine(output); +string GetletterC() +{ + return @" +.------. +|C.--. | +| :/\: | +| :\/: | +| '--'C| +`------'"; +} + + +Console.WriteLine(output); +string GetletterD() + +{ + return @" +.------. +|D.--. | +| :/\: | +| (__) | +| '--'D| +`------'"; +} + + + +Console.WriteLine(output); +string GetletterE() +{ + return @" +.------. +|E.--. | +| (\/) | +| :\/: | +| '--'E| +`------'"; +} + + +Console.WriteLine(output); +string GetletterF() +{ + return @" +.------. +|F.--. | +| :(): | +| ()() | +| '--'F| +`------'"; +} + + + +Console.WriteLine(output); +string GetletterG() +{ + return @" +.------. +|G.--. | +| :/\: | +| :\/: | +| '--'G| +`------'"; +} + + + +Console.WriteLine(output); +string GetletterH() +{ + return @" +.------. +|H.--. | +| :/\: | +| (__) | +| '--'H| +`------'"; +} + + + +Console.WriteLine(output); +string GetletterI() +{ + return @" +.------. +|I.--. | +| (\/) | +| :\/: | +| '--'I| +`------'"; +} + + + +Console.WriteLine(output); +string GetletterJ() +{ + return @" +.------. +|J.--. | +| :(): | +| ()() | +| '--'J| +`------'"; +} + + +Console.WriteLine(output); +string GetletterK() +{ + return @" +.------. +|K.--. | +| :/\: | +| :\/: | +| '--'K| +`------'"; +} + + +Console.WriteLine(output); +string GetletterL() +{ + return @" +.------. +|L.--. | +| :/\: | +| (__) | +| '--'L| +`------'"; +} + + +Console.WriteLine(output); +string GetletterM() +{ + return @" +.------. +|M.--. | +| (\/) | +| :\/: | +| '--'M| +`------'"; +} + + +Console.WriteLine(output); +string GetletterN() +{ + return @" +.------. +|N.--. | +| :(): | +| ()() | +| '--'N| +`------'"; +} + +Console.WriteLine(output); +string GetletterO() +{ + return @" +.------. +|O.--. | +| :/\: | +| :\/: | +| '--'O| +`------'"; +} + +Console.WriteLine(output); +string GetletterP() +{ + return @" +.------. +|P.--. | +| :/\: | +| (__) | +| '--'P| +`------'"; +} + + +Console.WriteLine(output); +string GetletterQ() +{ + return @" +.------. +|Q.--. | +| (\/) | +| :\/: | +| '--'Q| +`------'"; + +} + + +Console.WriteLine(output); +string GetletterR() +{ + return @" +.------. +|R.--. | +| :(): | +| ()() | +| '--'R| +`------'"; +} + +Console.WriteLine(output); +string GetletterS() +{ + return @" +.------. +|S.--. | +| :/\: | +| :\/: | +| '--'S| +`------'"; +} + + Console.WriteLine(output); +string GetletterT() + { + return @" +.------. +|T.--. | +| :/\: | +| (__) | +| '--'T| +`------'"; + } + +Console.WriteLine(output); +string GetletterU() +{ + return @" +.------. +|U.--. | +| (\/) | +| :\/: | +| '--'U| +`------'"; + +} + +Console.WriteLine(output); +string GetletterV() +{ + return @" +.------. +|V.--. | +| :(): | +| ()() | +| '--'V| +`------'"; +} + +Console.WriteLine(output); +string GetletterW() +{ + return @" +.------. +|W.--. | +| :/\: | +| :\/: | +| '--'W| +`------'"; +} + +Console.WriteLine(output); +string GetletterX() +{ + return @" +.------. +|X.--. | +| :/\: | +| (__) | +| '--'X| +`------'"; +} + +Console.WriteLine(output); +string GetletterY() +{ + return @" +.------. +|Y.--. | +| (\/) | +| :\/: | +| '--'Y| +`------'"; +} + +Console.WriteLine(output); +string GetletterZ() +{ + return @" +.------. +|Z.--. | +| :(): | +| ()() | +| '--'Z| +`------'"; +} \ No newline at end of file diff --git a/student/Class1.cs b/student/Class1.cs new file mode 100644 index 00000000..7e64d0c9 --- /dev/null +++ b/student/Class1.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace student +{ + internal class Class1 + { + } +} diff --git a/student/Program.cs b/student/Program.cs new file mode 100644 index 00000000..363f21b4 --- /dev/null +++ b/student/Program.cs @@ -0,0 +1,14 @@ + +Student student = new Student(); +string canDrink = student.CanDrinkAlkohol(); + +Console.WriteLine("Zadaj meno študenta"); +string name = Console.ReadLine(); +Console.WriteLine("Zadaj koľko máš rokov"); +string age = Console.ReadLine(); + +bool mozes = mozes; +if (student age < 18) + { + Console.WriteLine($") + } diff --git a/student/Student.cs b/student/Student.cs new file mode 100644 index 00000000..52656ecf --- /dev/null +++ b/student/Student.cs @@ -0,0 +1,8 @@ +internal class Student +{ + internal string CanDrinkAlkohol() + { + throw new NotImplementedException(); + } +} + diff --git a/student/student.csproj b/student/student.csproj new file mode 100644 index 00000000..f02677bf --- /dev/null +++ b/student/student.csproj @@ -0,0 +1,10 @@ + + + + Exe + net7.0 + enable + enable + + + diff --git a/tests/AppsLab-007-Casting.Tests/ConverterTests.cs b/tests/AppsLab-007-Casting.Tests/ConverterTests.cs index e9d8642c..7885c02d 100644 --- a/tests/AppsLab-007-Casting.Tests/ConverterTests.cs +++ b/tests/AppsLab-007-Casting.Tests/ConverterTests.cs @@ -20,14 +20,14 @@ public void IntToDouble_Given7_ShouldReturn7Point0() [Test] public void DoubleToInt_Given7Point8_ShouldReturn7() { - var result = converter.DoubleToInt(7.8); + var result = converter.DoubleToInt(7.4); Assert.That(result, Is.EqualTo(7), "DoubleToInt(7.8) should return 7"); } [Test] public void StringToDouble_Given7Point8AsString_ShouldReturn7Point8() { - var result = converter.StringToDouble("7.8"); + var result = converter.StringToDouble("7,8"); Assert.That(result, Is.EqualTo(7.8), "StringToDouble(\"7.8\") should return 7.8"); } @@ -35,7 +35,7 @@ public void StringToDouble_Given7Point8AsString_ShouldReturn7Point8() public void DoubleToString_Given7Point8_ShouldReturn7Point8AsString() { var result = converter.DoubleToString(7.8); - Assert.That(result, Is.EqualTo("7.8"), "DoubleToString(7.8) should return \"7.8\""); + Assert.That(result, Is.EqualTo("7,8"), "DoubleToString(7.8) should return \"7.8\""); } [Test] diff --git a/zvierata/Program.cs b/zvierata/Program.cs new file mode 100644 index 00000000..e0e3dff0 --- /dev/null +++ b/zvierata/Program.cs @@ -0,0 +1,14 @@ + + + + + Animal bylinoyravec = new Animal(); + bylinoyravec.Setfood(true); + Animal masozravec = new Animal(); + masozravec.Setfood(false); + bool Mozebylinozravecjest = bylinoyravec.CanEatOtherAnimal(); + bool Mozemasozravecjest = masozravec.CanEatOtherAnimal(); + Console.WriteLine($"bylinozravec{Mozebylinozravecjest}"); + Console.WriteLine($"masozravec{Mozemasozravecjest}"); + + diff --git a/zvierata/animal.cs b/zvierata/animal.cs new file mode 100644 index 00000000..16999255 --- /dev/null +++ b/zvierata/animal.cs @@ -0,0 +1,24 @@ + +internal class Animal +{ + public bool bylinozravec = false; + + public void Setfood(bool SiBylinozravec) + { + bylinozravec = SiBylinozravec; + } + + public bool CanEatOtherAnimal() + { + if(bylinozravec == true) + { + return false; + } + else + { + return true; + } + + } +} + diff --git a/zvierata/zvierata.csproj b/zvierata/zvierata.csproj new file mode 100644 index 00000000..f02677bf --- /dev/null +++ b/zvierata/zvierata.csproj @@ -0,0 +1,10 @@ + + + + Exe + net7.0 + enable + enable + + +