diff --git a/README.md b/README.md index e69de29..a28bcb6 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,2 @@ +# oop + diff --git a/labs/lab1_done/DividerApp/DividerApp.csproj b/labs/lab1_done/DividerApp/DividerApp.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab1_done/DividerApp/DividerApp.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab1_done/DividerApp/Program.cs b/labs/lab1_done/DividerApp/Program.cs new file mode 100644 index 0000000..59e71fd --- /dev/null +++ b/labs/lab1_done/DividerApp/Program.cs @@ -0,0 +1,28 @@ +using System; + +class DivideIt +{ + public static void Main(string[] args) + { + try + { + Console.WriteLine("enter the first integer"); + string temp = Console.ReadLine(); + int i = Int32.Parse(temp); + Console.WriteLine("enter the second integer"); + temp = Console.ReadLine(); + int j = Int32.Parse(temp); + int k = i / j; + Console.WriteLine("{0} / {1} = {2}", i, j, k); + } + catch (FormatException e) + { + Console.WriteLine("format exception was thrown: {0}", e.Message); + } + catch (Exception e) + { + Console.WriteLine("exception was thrown: {0}", e.Message); + } + } +} + diff --git a/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp new file mode 100755 index 0000000..80ea13c Binary files /dev/null and b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp differ diff --git a/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.deps.json b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.deps.json new file mode 100644 index 0000000..3e79e54 --- /dev/null +++ b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "DividerApp/1.0.0": { + "runtime": { + "DividerApp.dll": {} + } + } + } + }, + "libraries": { + "DividerApp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.dll b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.dll new file mode 100644 index 0000000..6162c67 Binary files /dev/null and b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.dll differ diff --git a/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.pdb b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.pdb new file mode 100644 index 0000000..eb330dd Binary files /dev/null and b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.pdb differ diff --git a/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.runtimeconfig.json b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab1_done/DividerApp/bin/Debug/net9.0/DividerApp.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab1_done/DividerApp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.AssemblyInfo.cs b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.AssemblyInfo.cs new file mode 100644 index 0000000..d96dc05 --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("DividerApp")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+926cf4a99659f7dc311340c32c3fb405f373ada2")] +[assembly: System.Reflection.AssemblyProductAttribute("DividerApp")] +[assembly: System.Reflection.AssemblyTitleAttribute("DividerApp")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.AssemblyInfoInputs.cache b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.AssemblyInfoInputs.cache new file mode 100644 index 0000000..15029ae --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +db7a1f7074b9a230313666f8e9d97bc718320a944f0be8ca373ca4311f09db81 diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..a5faf03 --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = DividerApp +build_property.ProjectDir = /home/nik/oop/labs/lab1/DividerApp/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.GlobalUsings.g.cs b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.assets.cache b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.assets.cache new file mode 100644 index 0000000..7573686 Binary files /dev/null and b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.assets.cache differ diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.csproj.CoreCompileInputs.cache b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..b7f249e --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +427addf618e2ddd9e32b6854a63cc9afec007968d9b813d57fdfe02d605377d5 diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.csproj.FileListAbsolute.txt b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..803a341 --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab1/DividerApp/bin/Debug/net9.0/DividerApp +/home/nik/oop/labs/lab1/DividerApp/bin/Debug/net9.0/DividerApp.deps.json +/home/nik/oop/labs/lab1/DividerApp/bin/Debug/net9.0/DividerApp.runtimeconfig.json +/home/nik/oop/labs/lab1/DividerApp/bin/Debug/net9.0/DividerApp.dll +/home/nik/oop/labs/lab1/DividerApp/bin/Debug/net9.0/DividerApp.pdb +/home/nik/oop/labs/lab1/DividerApp/obj/Debug/net9.0/DividerApp.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab1/DividerApp/obj/Debug/net9.0/DividerApp.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab1/DividerApp/obj/Debug/net9.0/DividerApp.AssemblyInfo.cs +/home/nik/oop/labs/lab1/DividerApp/obj/Debug/net9.0/DividerApp.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab1/DividerApp/obj/Debug/net9.0/DividerApp.dll +/home/nik/oop/labs/lab1/DividerApp/obj/Debug/net9.0/refint/DividerApp.dll +/home/nik/oop/labs/lab1/DividerApp/obj/Debug/net9.0/DividerApp.pdb +/home/nik/oop/labs/lab1/DividerApp/obj/Debug/net9.0/DividerApp.genruntimeconfig.cache +/home/nik/oop/labs/lab1/DividerApp/obj/Debug/net9.0/ref/DividerApp.dll diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.dll b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.dll new file mode 100644 index 0000000..6162c67 Binary files /dev/null and b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.dll differ diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.genruntimeconfig.cache b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.genruntimeconfig.cache new file mode 100644 index 0000000..3555e83 --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.genruntimeconfig.cache @@ -0,0 +1 @@ +c16afb299ce3955c993a6ac7a109a3dd80bb6444f5bcb40de0cc7f2eddeca3c0 diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.pdb b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.pdb new file mode 100644 index 0000000..eb330dd Binary files /dev/null and b/labs/lab1_done/DividerApp/obj/Debug/net9.0/DividerApp.pdb differ diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/apphost b/labs/lab1_done/DividerApp/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..80ea13c Binary files /dev/null and b/labs/lab1_done/DividerApp/obj/Debug/net9.0/apphost differ diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/ref/DividerApp.dll b/labs/lab1_done/DividerApp/obj/Debug/net9.0/ref/DividerApp.dll new file mode 100644 index 0000000..839e4fe Binary files /dev/null and b/labs/lab1_done/DividerApp/obj/Debug/net9.0/ref/DividerApp.dll differ diff --git a/labs/lab1_done/DividerApp/obj/Debug/net9.0/refint/DividerApp.dll b/labs/lab1_done/DividerApp/obj/Debug/net9.0/refint/DividerApp.dll new file mode 100644 index 0000000..839e4fe Binary files /dev/null and b/labs/lab1_done/DividerApp/obj/Debug/net9.0/refint/DividerApp.dll differ diff --git a/labs/lab1_done/DividerApp/obj/DividerApp.csproj.nuget.dgspec.json b/labs/lab1_done/DividerApp/obj/DividerApp.csproj.nuget.dgspec.json new file mode 100644 index 0000000..73e5b38 --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/DividerApp.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab1/DividerApp/DividerApp.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab1/DividerApp/DividerApp.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab1/DividerApp/DividerApp.csproj", + "projectName": "DividerApp", + "projectPath": "/home/nik/oop/labs/lab1/DividerApp/DividerApp.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab1/DividerApp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.8, 9.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/DividerApp/obj/DividerApp.csproj.nuget.g.props b/labs/lab1_done/DividerApp/obj/DividerApp.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/DividerApp.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab1_done/DividerApp/obj/DividerApp.csproj.nuget.g.targets b/labs/lab1_done/DividerApp/obj/DividerApp.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/DividerApp.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab1_done/DividerApp/obj/project.assets.json b/labs/lab1_done/DividerApp/obj/project.assets.json new file mode 100644 index 0000000..e886789 --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab1/DividerApp/DividerApp.csproj", + "projectName": "DividerApp", + "projectPath": "/home/nik/oop/labs/lab1/DividerApp/DividerApp.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab1/DividerApp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.8, 9.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/DividerApp/obj/project.nuget.cache b/labs/lab1_done/DividerApp/obj/project.nuget.cache new file mode 100644 index 0000000..e325e50 --- /dev/null +++ b/labs/lab1_done/DividerApp/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "auHtLq26A10=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab1/DividerApp/DividerApp.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.8/microsoft.aspnetcore.app.ref.9.0.8.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/.gitignore b/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/.gitignore new file mode 100644 index 0000000..ffa3faa --- /dev/null +++ b/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/projectSettingsUpdater.xml +/.idea.Greeter.iml +/contentModel.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/encodings.xml b/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/indexLayout.xml b/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/vcs.xml b/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/labs/lab1_done/Greeter/.idea/.idea.Greeter/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter.sln b/labs/lab1_done/Greeter/Greeter.sln new file mode 100644 index 0000000..7b2c72d --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Greeter", "Greeter\Greeter.csproj", "{24061A9C-6141-4A92-84FF-CBE823076F13}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {24061A9C-6141-4A92-84FF-CBE823076F13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {24061A9C-6141-4A92-84FF-CBE823076F13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {24061A9C-6141-4A92-84FF-CBE823076F13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {24061A9C-6141-4A92-84FF-CBE823076F13}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/labs/lab1_done/Greeter/Greeter/Greeter.csproj b/labs/lab1_done/Greeter/Greeter/Greeter.csproj new file mode 100644 index 0000000..85b4959 --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/Greeter.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab1_done/Greeter/Greeter/Program.cs b/labs/lab1_done/Greeter/Greeter/Program.cs new file mode 100644 index 0000000..d2630af --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/Program.cs @@ -0,0 +1,12 @@ +using System; + +class Greeter +{ + static void Main(string[] args) + { + string myName; + Console.WriteLine("Please enter your name"); + myName = Console.ReadLine(); + Console.WriteLine("Hello, {0}", myName); + } +} \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter new file mode 100755 index 0000000..25d1e71 Binary files /dev/null and b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter differ diff --git a/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.deps.json b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.deps.json new file mode 100644 index 0000000..2fcba78 --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Greeter/1.0.0": { + "runtime": { + "Greeter.dll": {} + } + } + } + }, + "libraries": { + "Greeter/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.dll b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.dll new file mode 100644 index 0000000..b64cfe7 Binary files /dev/null and b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.dll differ diff --git a/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.pdb b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.pdb new file mode 100644 index 0000000..5ee5a83 Binary files /dev/null and b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.pdb differ diff --git a/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.runtimeconfig.json b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/bin/Debug/net9.0/Greeter.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.AssemblyInfo.cs b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.AssemblyInfo.cs new file mode 100644 index 0000000..d7c3332 --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Greeter")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d981d6d93ae908ab14fd54d07a6c0dc8bb83e07e")] +[assembly: System.Reflection.AssemblyProductAttribute("Greeter")] +[assembly: System.Reflection.AssemblyTitleAttribute("Greeter")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.AssemblyInfoInputs.cache b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.AssemblyInfoInputs.cache new file mode 100644 index 0000000..0e481be --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +62a2410f95fa6f55a9743eb23ed01a32edc4d52412e128330c1788f7f0a956cb diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..c9acaa5 --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Greeter +build_property.ProjectDir = /home/nik/oop/labs/lab1/Greeter/Greeter/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.GlobalUsings.g.cs b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.assets.cache b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.assets.cache new file mode 100644 index 0000000..47e624a Binary files /dev/null and b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.assets.cache differ diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.csproj.CoreCompileInputs.cache b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7a872a3 --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +3a3970336af7fbfc66410774efee69902c01827daed2e48cd1fc0641d7ff4f68 diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.csproj.FileListAbsolute.txt b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..5e4305b --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab1/Greeter/Greeter/bin/Debug/net9.0/Greeter +/home/nik/oop/labs/lab1/Greeter/Greeter/bin/Debug/net9.0/Greeter.deps.json +/home/nik/oop/labs/lab1/Greeter/Greeter/bin/Debug/net9.0/Greeter.runtimeconfig.json +/home/nik/oop/labs/lab1/Greeter/Greeter/bin/Debug/net9.0/Greeter.dll +/home/nik/oop/labs/lab1/Greeter/Greeter/bin/Debug/net9.0/Greeter.pdb +/home/nik/oop/labs/lab1/Greeter/Greeter/obj/Debug/net9.0/Greeter.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab1/Greeter/Greeter/obj/Debug/net9.0/Greeter.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab1/Greeter/Greeter/obj/Debug/net9.0/Greeter.AssemblyInfo.cs +/home/nik/oop/labs/lab1/Greeter/Greeter/obj/Debug/net9.0/Greeter.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab1/Greeter/Greeter/obj/Debug/net9.0/Greeter.dll +/home/nik/oop/labs/lab1/Greeter/Greeter/obj/Debug/net9.0/refint/Greeter.dll +/home/nik/oop/labs/lab1/Greeter/Greeter/obj/Debug/net9.0/Greeter.pdb +/home/nik/oop/labs/lab1/Greeter/Greeter/obj/Debug/net9.0/Greeter.genruntimeconfig.cache +/home/nik/oop/labs/lab1/Greeter/Greeter/obj/Debug/net9.0/ref/Greeter.dll diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.dll b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.dll new file mode 100644 index 0000000..b64cfe7 Binary files /dev/null and b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.dll differ diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.genruntimeconfig.cache b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.genruntimeconfig.cache new file mode 100644 index 0000000..b17f09e --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.genruntimeconfig.cache @@ -0,0 +1 @@ +6293328012bb2a31e52517edc5600c1bbd9a9c188d4eb8b5d803c99b8e092537 diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.pdb b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.pdb new file mode 100644 index 0000000..5ee5a83 Binary files /dev/null and b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/Greeter.pdb differ diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/apphost b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..25d1e71 Binary files /dev/null and b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/apphost differ diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/ref/Greeter.dll b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/ref/Greeter.dll new file mode 100644 index 0000000..3ad1d8e Binary files /dev/null and b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/ref/Greeter.dll differ diff --git a/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/refint/Greeter.dll b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/refint/Greeter.dll new file mode 100644 index 0000000..3ad1d8e Binary files /dev/null and b/labs/lab1_done/Greeter/Greeter/obj/Debug/net9.0/refint/Greeter.dll differ diff --git a/labs/lab1_done/Greeter/Greeter/obj/Greeter.csproj.nuget.dgspec.json b/labs/lab1_done/Greeter/Greeter/obj/Greeter.csproj.nuget.dgspec.json new file mode 100644 index 0000000..f4c21ed --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Greeter.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab1/Greeter/Greeter/Greeter.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab1/Greeter/Greeter/Greeter.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab1/Greeter/Greeter/Greeter.csproj", + "projectName": "Greeter", + "projectPath": "/home/nik/oop/labs/lab1/Greeter/Greeter/Greeter.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab1/Greeter/Greeter/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.8, 9.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/obj/Greeter.csproj.nuget.g.props b/labs/lab1_done/Greeter/Greeter/obj/Greeter.csproj.nuget.g.props new file mode 100644 index 0000000..d2220d8 --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Greeter.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.14.0 + + + + + \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/obj/Greeter.csproj.nuget.g.targets b/labs/lab1_done/Greeter/Greeter/obj/Greeter.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/Greeter.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/obj/project.assets.json b/labs/lab1_done/Greeter/Greeter/obj/project.assets.json new file mode 100644 index 0000000..687a53f --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab1/Greeter/Greeter/Greeter.csproj", + "projectName": "Greeter", + "projectPath": "/home/nik/oop/labs/lab1/Greeter/Greeter/Greeter.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab1/Greeter/Greeter/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.8, 9.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/obj/project.nuget.cache b/labs/lab1_done/Greeter/Greeter/obj/project.nuget.cache new file mode 100644 index 0000000..b13338d --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "fWcYCUWrzhs=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab1/Greeter/Greeter/Greeter.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.8/microsoft.aspnetcore.app.ref.9.0.8.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/obj/project.packagespec.json b/labs/lab1_done/Greeter/Greeter/obj/project.packagespec.json new file mode 100644 index 0000000..d9b2d6a --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"/home/nik/oop/labs/lab1/Greeter/Greeter/Greeter.csproj","projectName":"Greeter","projectPath":"/home/nik/oop/labs/lab1/Greeter/Greeter/Greeter.csproj","outputPath":"/home/nik/oop/labs/lab1/Greeter/Greeter/obj/","projectStyle":"PackageReference","originalTargetFrameworks":["net9.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"targetAlias":"net9.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.100"}"frameworks":{"net9.0":{"targetAlias":"net9.0","imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"downloadDependencies":[{"name":"Microsoft.AspNetCore.App.Ref","version":"[9.0.8, 9.0.8]"}],"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/obj/rider.project.model.nuget.info b/labs/lab1_done/Greeter/Greeter/obj/rider.project.model.nuget.info new file mode 100644 index 0000000..6591a8d --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17580088666823366 \ No newline at end of file diff --git a/labs/lab1_done/Greeter/Greeter/obj/rider.project.restore.info b/labs/lab1_done/Greeter/Greeter/obj/rider.project.restore.info new file mode 100644 index 0000000..6591a8d --- /dev/null +++ b/labs/lab1_done/Greeter/Greeter/obj/rider.project.restore.info @@ -0,0 +1 @@ +17580088666823366 \ No newline at end of file diff --git a/labs/lab1_done/GreeterApp/GreeterApp.csproj b/labs/lab1_done/GreeterApp/GreeterApp.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab1_done/GreeterApp/GreeterApp.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab1_done/GreeterApp/Program.cs b/labs/lab1_done/GreeterApp/Program.cs new file mode 100644 index 0000000..a562e14 --- /dev/null +++ b/labs/lab1_done/GreeterApp/Program.cs @@ -0,0 +1,13 @@ +using System; + +class Greeter +{ + static void Main(string[] args) + { + string myName; + Console.WriteLine("Please enter your name"); + myName = Console.ReadLine(); + Console.WriteLine("Hello, {0}", myName); + } +} + diff --git a/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp new file mode 100755 index 0000000..f1003c3 Binary files /dev/null and b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp differ diff --git a/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.deps.json b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.deps.json new file mode 100644 index 0000000..76f8e42 --- /dev/null +++ b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "GreeterApp/1.0.0": { + "runtime": { + "GreeterApp.dll": {} + } + } + } + }, + "libraries": { + "GreeterApp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.dll b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.dll new file mode 100644 index 0000000..a9784ba Binary files /dev/null and b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.dll differ diff --git a/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.pdb b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.pdb new file mode 100644 index 0000000..1fa4221 Binary files /dev/null and b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.pdb differ diff --git a/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.runtimeconfig.json b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab1_done/GreeterApp/bin/Debug/net9.0/GreeterApp.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.AssemblyInfo.cs b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.AssemblyInfo.cs new file mode 100644 index 0000000..d7340bb --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("GreeterApp")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d981d6d93ae908ab14fd54d07a6c0dc8bb83e07e")] +[assembly: System.Reflection.AssemblyProductAttribute("GreeterApp")] +[assembly: System.Reflection.AssemblyTitleAttribute("GreeterApp")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.AssemblyInfoInputs.cache b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.AssemblyInfoInputs.cache new file mode 100644 index 0000000..a131ab5 --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +ddd921c7ef2527a7e15f312ce4b8cff64c9722f28f08ec25a8a65525ee70cde7 diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..06d1d77 --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = GreeterApp +build_property.ProjectDir = /home/nik/oop/labs/lab1/GreeterApp/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.GlobalUsings.g.cs b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.assets.cache b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.assets.cache new file mode 100644 index 0000000..fcb41cb Binary files /dev/null and b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.assets.cache differ diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.csproj.CoreCompileInputs.cache b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..d68b513 --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +e53b743c43efb9e55f14c628de656bdbeaf02d6e429af420f5d27015dca4e892 diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.csproj.FileListAbsolute.txt b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..40d6c2a --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab1/GreeterApp/bin/Debug/net9.0/GreeterApp +/home/nik/oop/labs/lab1/GreeterApp/bin/Debug/net9.0/GreeterApp.deps.json +/home/nik/oop/labs/lab1/GreeterApp/bin/Debug/net9.0/GreeterApp.runtimeconfig.json +/home/nik/oop/labs/lab1/GreeterApp/bin/Debug/net9.0/GreeterApp.dll +/home/nik/oop/labs/lab1/GreeterApp/bin/Debug/net9.0/GreeterApp.pdb +/home/nik/oop/labs/lab1/GreeterApp/obj/Debug/net9.0/GreeterApp.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab1/GreeterApp/obj/Debug/net9.0/GreeterApp.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab1/GreeterApp/obj/Debug/net9.0/GreeterApp.AssemblyInfo.cs +/home/nik/oop/labs/lab1/GreeterApp/obj/Debug/net9.0/GreeterApp.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab1/GreeterApp/obj/Debug/net9.0/GreeterApp.dll +/home/nik/oop/labs/lab1/GreeterApp/obj/Debug/net9.0/refint/GreeterApp.dll +/home/nik/oop/labs/lab1/GreeterApp/obj/Debug/net9.0/GreeterApp.pdb +/home/nik/oop/labs/lab1/GreeterApp/obj/Debug/net9.0/GreeterApp.genruntimeconfig.cache +/home/nik/oop/labs/lab1/GreeterApp/obj/Debug/net9.0/ref/GreeterApp.dll diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.dll b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.dll new file mode 100644 index 0000000..a9784ba Binary files /dev/null and b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.dll differ diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.genruntimeconfig.cache b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.genruntimeconfig.cache new file mode 100644 index 0000000..97fb139 --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.genruntimeconfig.cache @@ -0,0 +1 @@ +1ee9c3442ddca775c68cbec4c11e375bc333222fe71afc7b4961033037dfa59f diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.pdb b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.pdb new file mode 100644 index 0000000..1fa4221 Binary files /dev/null and b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/GreeterApp.pdb differ diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/apphost b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..f1003c3 Binary files /dev/null and b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/apphost differ diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/ref/GreeterApp.dll b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/ref/GreeterApp.dll new file mode 100644 index 0000000..1ec8cb1 Binary files /dev/null and b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/ref/GreeterApp.dll differ diff --git a/labs/lab1_done/GreeterApp/obj/Debug/net9.0/refint/GreeterApp.dll b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/refint/GreeterApp.dll new file mode 100644 index 0000000..1ec8cb1 Binary files /dev/null and b/labs/lab1_done/GreeterApp/obj/Debug/net9.0/refint/GreeterApp.dll differ diff --git a/labs/lab1_done/GreeterApp/obj/GreeterApp.csproj.nuget.dgspec.json b/labs/lab1_done/GreeterApp/obj/GreeterApp.csproj.nuget.dgspec.json new file mode 100644 index 0000000..484e090 --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/GreeterApp.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab1/GreeterApp/GreeterApp.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab1/GreeterApp/GreeterApp.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab1/GreeterApp/GreeterApp.csproj", + "projectName": "GreeterApp", + "projectPath": "/home/nik/oop/labs/lab1/GreeterApp/GreeterApp.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab1/GreeterApp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.8, 9.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/GreeterApp/obj/GreeterApp.csproj.nuget.g.props b/labs/lab1_done/GreeterApp/obj/GreeterApp.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/GreeterApp.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab1_done/GreeterApp/obj/GreeterApp.csproj.nuget.g.targets b/labs/lab1_done/GreeterApp/obj/GreeterApp.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/GreeterApp.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab1_done/GreeterApp/obj/project.assets.json b/labs/lab1_done/GreeterApp/obj/project.assets.json new file mode 100644 index 0000000..d08c1cc --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab1/GreeterApp/GreeterApp.csproj", + "projectName": "GreeterApp", + "projectPath": "/home/nik/oop/labs/lab1/GreeterApp/GreeterApp.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab1/GreeterApp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.8, 9.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/GreeterApp/obj/project.nuget.cache b/labs/lab1_done/GreeterApp/obj/project.nuget.cache new file mode 100644 index 0000000..6b42c1d --- /dev/null +++ b/labs/lab1_done/GreeterApp/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "wKzibDaTu48=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab1/GreeterApp/GreeterApp.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.8/microsoft.aspnetcore.app.ref.9.0.8.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab1_done/TriangleApp/Program.cs b/labs/lab1_done/TriangleApp/Program.cs new file mode 100644 index 0000000..373e789 --- /dev/null +++ b/labs/lab1_done/TriangleApp/Program.cs @@ -0,0 +1,16 @@ +using System; +using System.Globalization; + +class TriangleArea +{ + static void Main() + { + Console.WriteLine("enter perimeter: "); + double p = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); + double a = p / 3.0; + double s = Math.Sqrt((1.5 * a) * (0.5 * a) * (0.5 * a) * (0.5 * a)); + Console.WriteLine("side\tarea"); + Console.WriteLine("{0}\t{1}", a.ToString("F2", CultureInfo.InvariantCulture), s.ToString("F2", CultureInfo.InvariantCulture)); + } +} + diff --git a/labs/lab1_done/TriangleApp/TriangleApp.csproj b/labs/lab1_done/TriangleApp/TriangleApp.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab1_done/TriangleApp/TriangleApp.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp new file mode 100755 index 0000000..7d7cbbf Binary files /dev/null and b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp differ diff --git a/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.deps.json b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.deps.json new file mode 100644 index 0000000..812a4a8 --- /dev/null +++ b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "TriangleApp/1.0.0": { + "runtime": { + "TriangleApp.dll": {} + } + } + } + }, + "libraries": { + "TriangleApp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.dll b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.dll new file mode 100644 index 0000000..aa226ec Binary files /dev/null and b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.dll differ diff --git a/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.pdb b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.pdb new file mode 100644 index 0000000..6662013 Binary files /dev/null and b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.pdb differ diff --git a/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.runtimeconfig.json b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab1_done/TriangleApp/bin/Debug/net9.0/TriangleApp.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.AssemblyInfo.cs b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.AssemblyInfo.cs new file mode 100644 index 0000000..087ad87 --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("TriangleApp")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+926cf4a99659f7dc311340c32c3fb405f373ada2")] +[assembly: System.Reflection.AssemblyProductAttribute("TriangleApp")] +[assembly: System.Reflection.AssemblyTitleAttribute("TriangleApp")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.AssemblyInfoInputs.cache b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.AssemblyInfoInputs.cache new file mode 100644 index 0000000..f85bad5 --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +b533f4fb065fa97896a892c19f7629d2f9857969728af573e3971964a6e9c9e6 diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..a0549fa --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = TriangleApp +build_property.ProjectDir = /home/nik/oop/labs/lab1/TriangleApp/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.GlobalUsings.g.cs b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.assets.cache b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.assets.cache new file mode 100644 index 0000000..a2968ad Binary files /dev/null and b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.assets.cache differ diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.csproj.CoreCompileInputs.cache b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..348e935 --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +b911b7c3d3fe4bc614dacedf3a9b69342550d0f1c9cd816816c9b46b1ce5c093 diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.csproj.FileListAbsolute.txt b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..907f11e --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab1/TriangleApp/bin/Debug/net9.0/TriangleApp +/home/nik/oop/labs/lab1/TriangleApp/bin/Debug/net9.0/TriangleApp.deps.json +/home/nik/oop/labs/lab1/TriangleApp/bin/Debug/net9.0/TriangleApp.runtimeconfig.json +/home/nik/oop/labs/lab1/TriangleApp/bin/Debug/net9.0/TriangleApp.dll +/home/nik/oop/labs/lab1/TriangleApp/bin/Debug/net9.0/TriangleApp.pdb +/home/nik/oop/labs/lab1/TriangleApp/obj/Debug/net9.0/TriangleApp.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab1/TriangleApp/obj/Debug/net9.0/TriangleApp.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab1/TriangleApp/obj/Debug/net9.0/TriangleApp.AssemblyInfo.cs +/home/nik/oop/labs/lab1/TriangleApp/obj/Debug/net9.0/TriangleApp.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab1/TriangleApp/obj/Debug/net9.0/TriangleApp.dll +/home/nik/oop/labs/lab1/TriangleApp/obj/Debug/net9.0/refint/TriangleApp.dll +/home/nik/oop/labs/lab1/TriangleApp/obj/Debug/net9.0/TriangleApp.pdb +/home/nik/oop/labs/lab1/TriangleApp/obj/Debug/net9.0/TriangleApp.genruntimeconfig.cache +/home/nik/oop/labs/lab1/TriangleApp/obj/Debug/net9.0/ref/TriangleApp.dll diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.dll b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.dll new file mode 100644 index 0000000..aa226ec Binary files /dev/null and b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.dll differ diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.genruntimeconfig.cache b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.genruntimeconfig.cache new file mode 100644 index 0000000..72ef6db --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.genruntimeconfig.cache @@ -0,0 +1 @@ +2e2b9dcdf7eaf33cc02d043acb679faf95753cf25775b025556cec5e7a7bcff2 diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.pdb b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.pdb new file mode 100644 index 0000000..6662013 Binary files /dev/null and b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/TriangleApp.pdb differ diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/apphost b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..7d7cbbf Binary files /dev/null and b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/apphost differ diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/ref/TriangleApp.dll b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/ref/TriangleApp.dll new file mode 100644 index 0000000..6998108 Binary files /dev/null and b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/ref/TriangleApp.dll differ diff --git a/labs/lab1_done/TriangleApp/obj/Debug/net9.0/refint/TriangleApp.dll b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/refint/TriangleApp.dll new file mode 100644 index 0000000..6998108 Binary files /dev/null and b/labs/lab1_done/TriangleApp/obj/Debug/net9.0/refint/TriangleApp.dll differ diff --git a/labs/lab1_done/TriangleApp/obj/TriangleApp.csproj.nuget.dgspec.json b/labs/lab1_done/TriangleApp/obj/TriangleApp.csproj.nuget.dgspec.json new file mode 100644 index 0000000..ddf2972 --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/TriangleApp.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab1/TriangleApp/TriangleApp.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab1/TriangleApp/TriangleApp.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab1/TriangleApp/TriangleApp.csproj", + "projectName": "TriangleApp", + "projectPath": "/home/nik/oop/labs/lab1/TriangleApp/TriangleApp.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab1/TriangleApp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.8, 9.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/TriangleApp/obj/TriangleApp.csproj.nuget.g.props b/labs/lab1_done/TriangleApp/obj/TriangleApp.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/TriangleApp.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab1_done/TriangleApp/obj/TriangleApp.csproj.nuget.g.targets b/labs/lab1_done/TriangleApp/obj/TriangleApp.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/TriangleApp.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab1_done/TriangleApp/obj/project.assets.json b/labs/lab1_done/TriangleApp/obj/project.assets.json new file mode 100644 index 0000000..174753c --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab1/TriangleApp/TriangleApp.csproj", + "projectName": "TriangleApp", + "projectPath": "/home/nik/oop/labs/lab1/TriangleApp/TriangleApp.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab1/TriangleApp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.8, 9.0.8]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab1_done/TriangleApp/obj/project.nuget.cache b/labs/lab1_done/TriangleApp/obj/project.nuget.cache new file mode 100644 index 0000000..57f02dc --- /dev/null +++ b/labs/lab1_done/TriangleApp/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "xq80s485UeU=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab1/TriangleApp/TriangleApp.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.8/microsoft.aspnetcore.app.ref.9.0.8.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab1_done/assets/1.png b/labs/lab1_done/assets/1.png new file mode 100644 index 0000000..a715d3c Binary files /dev/null and b/labs/lab1_done/assets/1.png differ diff --git a/labs/lab1_done/assets/10.png b/labs/lab1_done/assets/10.png new file mode 100644 index 0000000..b7ee40e Binary files /dev/null and b/labs/lab1_done/assets/10.png differ diff --git a/labs/lab1_done/assets/2.png b/labs/lab1_done/assets/2.png new file mode 100644 index 0000000..c7fb9c7 Binary files /dev/null and b/labs/lab1_done/assets/2.png differ diff --git a/labs/lab1_done/assets/3.png b/labs/lab1_done/assets/3.png new file mode 100644 index 0000000..d3bd1b0 Binary files /dev/null and b/labs/lab1_done/assets/3.png differ diff --git a/labs/lab1_done/assets/4.png b/labs/lab1_done/assets/4.png new file mode 100644 index 0000000..0aefda0 Binary files /dev/null and b/labs/lab1_done/assets/4.png differ diff --git a/labs/lab1_done/assets/5.png b/labs/lab1_done/assets/5.png new file mode 100644 index 0000000..0b434e5 Binary files /dev/null and b/labs/lab1_done/assets/5.png differ diff --git a/labs/lab1_done/assets/6.png b/labs/lab1_done/assets/6.png new file mode 100644 index 0000000..c2cf5ac Binary files /dev/null and b/labs/lab1_done/assets/6.png differ diff --git a/labs/lab1_done/assets/7.png b/labs/lab1_done/assets/7.png new file mode 100644 index 0000000..28dde19 Binary files /dev/null and b/labs/lab1_done/assets/7.png differ diff --git a/labs/lab1_done/assets/8.png b/labs/lab1_done/assets/8.png new file mode 100644 index 0000000..75c861e Binary files /dev/null and b/labs/lab1_done/assets/8.png differ diff --git a/labs/lab1_done/assets/9.png b/labs/lab1_done/assets/9.png new file mode 100644 index 0000000..8e702d8 Binary files /dev/null and b/labs/lab1_done/assets/9.png differ diff --git a/labs/lab1_done/report.pdf b/labs/lab1_done/report.pdf new file mode 100644 index 0000000..4aa3c8c Binary files /dev/null and b/labs/lab1_done/report.pdf differ diff --git a/labs/lab1_done/report.typ b/labs/lab1_done/report.typ new file mode 100644 index 0000000..658678f --- /dev/null +++ b/labs/lab1_done/report.typ @@ -0,0 +1,232 @@ +#set text(size: 1.3em) + +// title + +#align(center)[Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики] +\ +\ +\ +#align(center)[Факультет инфокоммуникационных технологий] +#align(center)[Направление подготовки 11.03.02] +\ +\ +#align(center)[Лабораторная работа №1] +#align(center)[Создание программы с помощью среды разработки VisualStudio.NET] +\ +\ +\ //#align(center)[Вариант 19] +\ +\ +\ +\ +\ +\ +\ +#align(right)[Выполнил:] +#align(right)[Дощенников Никита Андреевич] +#align(right)[Группа: К3221] +#align(right)[Проверил:] +#align(right)[Иванов Сергей Евгеньевич] +\ +\ +#align(center)[Санкт-Петербург] +#align(center)[2025] + +#pagebreak() + +=== Цель работы: + +- Ознакомиться с основами языка программирования C\# и .NET. +- Научиться создавать и запускать консольные приложения. +- Получить навыки отладки программ. +- Освоить базовые операции ввода/вывода и обработку исключений. +- Реализовать простые задачи в виде консольных программ. + +=== Задачи: + +- Реализовать программу «Hello, Name», которая считывает имя пользователя и выводит приветствие. +- Создать проект в среде разработки (или с помощью .NET CLI) и реализовать аналогичную программу Greeter. +- Провести отладку программы с использованием точек останова и просмотра переменных. +- Написать программу Divider, которая выполняет деление целых чисел с обработкой исключений. +- Реализовать программу вычисления площади равностороннего треугольника по заданному периметру. + +=== Теория: + +- Язык C\# является объектно-ориентированным языком, работающим в рамках платформы .NET. +- Консольные приложения содержат метод Main(), являющийся точкой входа программы. +- Для работы с консолью используются методы Console.WriteLine() и Console.ReadLine(). +- Обработка ошибок выполняется с помощью конструкции try-catch. +- Для вычисления площади равностороннего треугольника можно использовать формулу Герона: + +$ +S = sqrt(p(p - a)(p - b)(p - c)), space.quad p = P/2 +$ + +где $P$ - периметр треугольника. + +=== Практическая часть. + +==== Hello, Name + +```csharp +using System; + +class Program +{ + static void Main() + { + string myName; + Console.WriteLine("enter your name"); + myName = Console.ReadLine(); + Console.WriteLine("hello, {0}", myName); + } +} +``` + + + + +Пример работы: + +#align(center)[#image("assets/1.png")] + +=== Debug: + +==== Ход выполнения: + +- В JetBrains Rider был создан новый проект типа Console Application. + +- В файл Program.cs добавлен код программы. + +- Программа была запущена через встроенный терминал IDE. + +- Для проверки корректности работы была введена строка с именем. Программа вывела корректное приветствие. + +- Для изучения процесса отладки были установлены точки останова (breakpoints) на строках ввода и вывода. + +- С помощью пошагового выполнения (Step Over/Step Into) наблюдалось изменение значения переменной myName. + +- В окне Debug и панели Variables было подтверждено, что введённое значение корректно сохраняется в переменной. + +Пример: + +#align(center)[#image("assets/6.png")] +#align(center)[#image("assets/7.png")] +#align(center)[#image("assets/8.png")] +#align(center)[#image("assets/9.png")] +#align(center)[#image("assets/10.png")] + + +==== Divider + +``` +using System; + +class DivideIt +{ + public static void Main(string[] args) + { + try + { + Console.WriteLine("enter the first integer"); + string temp = Console.ReadLine(); + int i = Int32.Parse(temp); + Console.WriteLine("enter the second integer"); + temp = Console.ReadLine(); + int j = Int32.Parse(temp); + int k = i / j; + Console.WriteLine("{0} / {1} = {2}", i, j, k); + } + catch (FormatException e) + { + Console.WriteLine("format exception was thrown: {0}", e.Message); + } + catch (Exception e) + { + Console.WriteLine("exception was thrown: {0}", e.Message); + } + } +} +``` + +Пример: + +#align(center)[#image("assets/2.png")] +#align(center)[#image("assets/3.png")] +#align(center)[#image("assets/4.png")] + +==== TriangleArea + +```csharp +using System; +using System.Globalization; + +class TriangleArea +{ + static void Main() + { + Console.WriteLine("perimeter"); + double p = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture); + double a = p / 3.0; + double s = Math.Sqrt((1.5 * a) * (0.5 * a) * (0.5 * a) * (0.5 * a)); + Console.WriteLine("side \tarea"); + Console.WriteLine("{0}\t{1}", a.ToString("F2", CultureInfo.InvariantCulture), s.ToString("F2", CultureInfo.InvariantCulture)); + } +} +``` + +Пример: + +#align(center)[#image("assets/5.png")] + +=== Выводы: + +В ходе выполнения лабораторной работы: + +- Освоены основы работы с консольными приложениями на C\#. +- Получены навыки ввода/вывода данных, обработки исключений. +- Реализованы несколько программ, решающие простые задачи. +- Освоены базовые приёмы отладки приложений. + +=== Code review: + + +*Резюме* + +В данном коде представлены три класса: DivideIt, Greeter и TriangleArea. Каждый из них выполняет свою задачу, однако в коде есть несколько моментов, которые можно улучшить для повышения его качества и надежности. + +*Ошибка* + +В классе DivideIt отсутствует обработка деления на ноль, что может привести к исключению DivideByZeroException. Рекомендуется добавить проверку перед выполнением деления. + +*Стиль кода* + +Код в целом написан в соответствии с общепринятыми стандартами C\#. Однако, для улучшения читаемости, стоит использовать более понятные сообщения для пользователя. Например, вместо "enter the first integer" можно использовать "Введите первое целое число". + +*Структура кода* + +Каждый класс имеет свою собственную функцию Main, что является хорошей практикой. Однако, стоит рассмотреть возможность вынесения логики в отдельные методы для повышения модульности и повторного использования кода. + +*Читаемость* + +Читаемость кода можно улучшить, добавив комментарии, объясняющие логику работы программы. Это поможет другим разработчикам быстрее понять, что делает код. + +*Производительность* + +Код не содержит явных проблем с производительностью, однако, использование Int32.Parse и double.Parse без предварительной проверки входных данных может привести к исключениям, что негативно скажется на производительности в случае частых ошибок ввода. + +*Масштабируемость* + +Код не очень масштабируемый, так как каждая программа выполняет только одну задачу. Для более сложных приложений стоит рассмотреть использование классов и методов для разделения логики. + +*Безопасность* + +Обработка исключений в коде присутствует, но стоит добавить более специфическую обработку для DivideByZeroException в классе DivideIt. Это поможет избежать потенциальных проблем при делении на ноль. + +*Обработка ошибок* + +Обработка ошибок реализована, но стоит улучшить сообщения об ошибках, чтобы они были более информативными. Например, можно указать, что именно было введено неверно. + +*Заключение* + +В целом, код выполняет свои функции, но требует доработки для повышения надежности, читаемости и масштабируемости. Рекомендуется внести предложенные изменения, чтобы улучшить качество кода и сделать его более устойчивым к ошибкам. diff --git a/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/.gitignore b/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/.gitignore new file mode 100644 index 0000000..cc042f5 --- /dev/null +++ b/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/contentModel.xml +/projectSettingsUpdater.xml +/.idea.BankAccount.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/encodings.xml b/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/indexLayout.xml b/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/vcs.xml b/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/vcs.xml new file mode 100644 index 0000000..c2365ab --- /dev/null +++ b/labs/lab2/BankAccount/.idea/.idea.BankAccount.dir/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/labs/lab2/BankAccount/BankAccount.csproj b/labs/lab2/BankAccount/BankAccount.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab2/BankAccount/BankAccount.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab2/BankAccount/Enum.cs b/labs/lab2/BankAccount/Enum.cs new file mode 100644 index 0000000..6d51a09 --- /dev/null +++ b/labs/lab2/BankAccount/Enum.cs @@ -0,0 +1,16 @@ +public enum AccountType { Checking, Deposit } + +public class Enum +{ + public static void Main(string[] args) + { + AccountType goldAccount; + AccountType platinumAccount; + + goldAccount = AccountType.Checking; + platinumAccount = AccountType.Deposit; + + Console.WriteLine("The Customer Account Type is {0}", goldAccount); + Console.WriteLine("The Customer Account Type is {0}", platinumAccount); + } +} \ No newline at end of file diff --git a/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount new file mode 100755 index 0000000..811f29e Binary files /dev/null and b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount differ diff --git a/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.deps.json b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.deps.json new file mode 100644 index 0000000..abf8bac --- /dev/null +++ b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "BankAccount/1.0.0": { + "runtime": { + "BankAccount.dll": {} + } + } + } + }, + "libraries": { + "BankAccount/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.dll b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.dll new file mode 100644 index 0000000..d8ed0a7 Binary files /dev/null and b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.dll differ diff --git a/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.pdb b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.pdb new file mode 100644 index 0000000..cf20edf Binary files /dev/null and b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.pdb differ diff --git a/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.runtimeconfig.json b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab2/BankAccount/obj/BankAccount.csproj.nuget.dgspec.json b/labs/lab2/BankAccount/obj/BankAccount.csproj.nuget.dgspec.json new file mode 100644 index 0000000..2c08c8a --- /dev/null +++ b/labs/lab2/BankAccount/obj/BankAccount.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab2/BankAccount/BankAccount.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab2/BankAccount/BankAccount.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab2/BankAccount/BankAccount.csproj", + "projectName": "BankAccount", + "projectPath": "/home/nik/oop/labs/lab2/BankAccount/BankAccount.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab2/BankAccount/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab2/BankAccount/obj/BankAccount.csproj.nuget.g.props b/labs/lab2/BankAccount/obj/BankAccount.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab2/BankAccount/obj/BankAccount.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab2/BankAccount/obj/BankAccount.csproj.nuget.g.targets b/labs/lab2/BankAccount/obj/BankAccount.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab2/BankAccount/obj/BankAccount.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab2/BankAccount/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab2/BankAccount/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.AssemblyInfo.cs b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.AssemblyInfo.cs new file mode 100644 index 0000000..1d40d33 --- /dev/null +++ b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("BankAccount")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("BankAccount")] +[assembly: System.Reflection.AssemblyTitleAttribute("BankAccount")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.AssemblyInfoInputs.cache b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.AssemblyInfoInputs.cache new file mode 100644 index 0000000..2449d8f --- /dev/null +++ b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +4867eff31ff80b84c57a524a0a6e749e8a0454aa752db5a876c3983b2cbadaee diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..be7eebd --- /dev/null +++ b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = BankAccount +build_property.ProjectDir = /home/nik/oop/labs/lab2/BankAccount/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.GlobalUsings.g.cs b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.assets.cache b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.assets.cache new file mode 100644 index 0000000..ee0608f Binary files /dev/null and b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.assets.cache differ diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.csproj.CoreCompileInputs.cache b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..50b4bca --- /dev/null +++ b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +2eb8d99d04da0c06ac51f6a1cc403f963d4b76d46a8c62b8760eb82d624567ea diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.csproj.FileListAbsolute.txt b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..e5fcca7 --- /dev/null +++ b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount +/home/nik/oop/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.deps.json +/home/nik/oop/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.runtimeconfig.json +/home/nik/oop/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.dll +/home/nik/oop/labs/lab2/BankAccount/bin/Debug/net9.0/BankAccount.pdb +/home/nik/oop/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.AssemblyInfo.cs +/home/nik/oop/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.dll +/home/nik/oop/labs/lab2/BankAccount/obj/Debug/net9.0/refint/BankAccount.dll +/home/nik/oop/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.pdb +/home/nik/oop/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.genruntimeconfig.cache +/home/nik/oop/labs/lab2/BankAccount/obj/Debug/net9.0/ref/BankAccount.dll diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.dll b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.dll new file mode 100644 index 0000000..d8ed0a7 Binary files /dev/null and b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.dll differ diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.genruntimeconfig.cache b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.genruntimeconfig.cache new file mode 100644 index 0000000..a8ca658 --- /dev/null +++ b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.genruntimeconfig.cache @@ -0,0 +1 @@ +d4e8dfe422bd02918055e12e3c30a4424b6c9dff76b38c963a27775688f7cb63 diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.pdb b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.pdb new file mode 100644 index 0000000..cf20edf Binary files /dev/null and b/labs/lab2/BankAccount/obj/Debug/net9.0/BankAccount.pdb differ diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/apphost b/labs/lab2/BankAccount/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..811f29e Binary files /dev/null and b/labs/lab2/BankAccount/obj/Debug/net9.0/apphost differ diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/ref/BankAccount.dll b/labs/lab2/BankAccount/obj/Debug/net9.0/ref/BankAccount.dll new file mode 100644 index 0000000..c8fe174 Binary files /dev/null and b/labs/lab2/BankAccount/obj/Debug/net9.0/ref/BankAccount.dll differ diff --git a/labs/lab2/BankAccount/obj/Debug/net9.0/refint/BankAccount.dll b/labs/lab2/BankAccount/obj/Debug/net9.0/refint/BankAccount.dll new file mode 100644 index 0000000..c8fe174 Binary files /dev/null and b/labs/lab2/BankAccount/obj/Debug/net9.0/refint/BankAccount.dll differ diff --git a/labs/lab2/BankAccount/obj/project.assets.json b/labs/lab2/BankAccount/obj/project.assets.json new file mode 100644 index 0000000..f91f1c1 --- /dev/null +++ b/labs/lab2/BankAccount/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab2/BankAccount/BankAccount.csproj", + "projectName": "BankAccount", + "projectPath": "/home/nik/oop/labs/lab2/BankAccount/BankAccount.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab2/BankAccount/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab2/BankAccount/obj/project.nuget.cache b/labs/lab2/BankAccount/obj/project.nuget.cache new file mode 100644 index 0000000..0ade30c --- /dev/null +++ b/labs/lab2/BankAccount/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "RbJOLZTYaW0=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab2/BankAccount/BankAccount.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab2/BankAccount/obj/project.packagespec.json b/labs/lab2/BankAccount/obj/project.packagespec.json new file mode 100644 index 0000000..1991497 --- /dev/null +++ b/labs/lab2/BankAccount/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"/home/nik/oop/labs/lab2/BankAccount/BankAccount.csproj","projectName":"BankAccount","projectPath":"/home/nik/oop/labs/lab2/BankAccount/BankAccount.csproj","outputPath":"/home/nik/oop/labs/lab2/BankAccount/obj/","projectStyle":"PackageReference","originalTargetFrameworks":["net9.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"targetAlias":"net9.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.100"}"frameworks":{"net9.0":{"targetAlias":"net9.0","imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"downloadDependencies":[{"name":"Microsoft.AspNetCore.App.Ref","version":"[9.0.9, 9.0.9]"}],"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/labs/lab2/BankAccount/obj/rider.project.model.nuget.info b/labs/lab2/BankAccount/obj/rider.project.model.nuget.info new file mode 100644 index 0000000..bb96567 --- /dev/null +++ b/labs/lab2/BankAccount/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17583465165360554 \ No newline at end of file diff --git a/labs/lab2/BankAccount/obj/rider.project.restore.info b/labs/lab2/BankAccount/obj/rider.project.restore.info new file mode 100644 index 0000000..bb96567 --- /dev/null +++ b/labs/lab2/BankAccount/obj/rider.project.restore.info @@ -0,0 +1 @@ +17583465165360554 \ No newline at end of file diff --git a/labs/lab2/EnglishDist/EnglishDist.csproj b/labs/lab2/EnglishDist/EnglishDist.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab2/EnglishDist/EnglishDist.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab2/EnglishDist/Program.cs b/labs/lab2/EnglishDist/Program.cs new file mode 100644 index 0000000..1abe98a --- /dev/null +++ b/labs/lab2/EnglishDist/Program.cs @@ -0,0 +1,39 @@ +using System; + +struct Distance +{ + public int feet; + public int inches; + + public void Print() + { + Console.WriteLine("{0}' - {1}''", feet, inches); + } +} + +public class Program +{ + public static void Main(string[] args) + { + Distance d1, d2, d3; + + Console.Write("Input the first distance (feet): "); + d1.feet = int.Parse(Console.ReadLine()); + Console.Write("Input the first distance (inches): "); + d1.inches = int.Parse(Console.ReadLine()); + + Console.Write("Input the second distance (feet): "); + d2.feet = int.Parse(Console.ReadLine()); + Console.Write("Input the second distance (inches): "); + d2.inches = int.Parse(Console.ReadLine()); + + d3.feet = d1.feet + d2.feet; + d3.inches = d1.inches + d2.inches; + + d3.feet += d3.inches % 12; + d3.inches = d3.inches / 12; + + d3.Print(); + + } +} diff --git a/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist new file mode 100755 index 0000000..ba70eb1 Binary files /dev/null and b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist differ diff --git a/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.deps.json b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.deps.json new file mode 100644 index 0000000..273b269 --- /dev/null +++ b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "EnglishDist/1.0.0": { + "runtime": { + "EnglishDist.dll": {} + } + } + } + }, + "libraries": { + "EnglishDist/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.dll b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.dll new file mode 100644 index 0000000..65fc8e9 Binary files /dev/null and b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.dll differ diff --git a/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.pdb b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.pdb new file mode 100644 index 0000000..dacf0de Binary files /dev/null and b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.pdb differ diff --git a/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.runtimeconfig.json b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab2/EnglishDist/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab2/EnglishDist/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.AssemblyInfo.cs b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.AssemblyInfo.cs new file mode 100644 index 0000000..a3556ff --- /dev/null +++ b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("EnglishDist")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("EnglishDist")] +[assembly: System.Reflection.AssemblyTitleAttribute("EnglishDist")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.AssemblyInfoInputs.cache b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.AssemblyInfoInputs.cache new file mode 100644 index 0000000..2b764f1 --- /dev/null +++ b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +957cb979d6a1e37afea57e379557bb968348213eca8e9a5568e301b9159139ff diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..9c7067f --- /dev/null +++ b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = EnglishDist +build_property.ProjectDir = /home/nik/oop/labs/lab2/EnglishDist/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.GlobalUsings.g.cs b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.assets.cache b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.assets.cache new file mode 100644 index 0000000..179cf66 Binary files /dev/null and b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.assets.cache differ diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.csproj.CoreCompileInputs.cache b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..87fadc3 --- /dev/null +++ b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +cae6c7a27e4a395c2151e3222efe594e7415ac119bd8ccc6f408f094be55f509 diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.csproj.FileListAbsolute.txt b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..68cd3d5 --- /dev/null +++ b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.AssemblyInfo.cs +/home/nik/oop/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist +/home/nik/oop/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.deps.json +/home/nik/oop/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.runtimeconfig.json +/home/nik/oop/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.dll +/home/nik/oop/labs/lab2/EnglishDist/bin/Debug/net9.0/EnglishDist.pdb +/home/nik/oop/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.dll +/home/nik/oop/labs/lab2/EnglishDist/obj/Debug/net9.0/refint/EnglishDist.dll +/home/nik/oop/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.pdb +/home/nik/oop/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.genruntimeconfig.cache +/home/nik/oop/labs/lab2/EnglishDist/obj/Debug/net9.0/ref/EnglishDist.dll diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.dll b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.dll new file mode 100644 index 0000000..65fc8e9 Binary files /dev/null and b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.dll differ diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.genruntimeconfig.cache b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.genruntimeconfig.cache new file mode 100644 index 0000000..8c9e87f --- /dev/null +++ b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.genruntimeconfig.cache @@ -0,0 +1 @@ +4d67ba85762d57a69def13271f8557918e09a31f5980be1189368d8150ec2d11 diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.pdb b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.pdb new file mode 100644 index 0000000..dacf0de Binary files /dev/null and b/labs/lab2/EnglishDist/obj/Debug/net9.0/EnglishDist.pdb differ diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/apphost b/labs/lab2/EnglishDist/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..ba70eb1 Binary files /dev/null and b/labs/lab2/EnglishDist/obj/Debug/net9.0/apphost differ diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/ref/EnglishDist.dll b/labs/lab2/EnglishDist/obj/Debug/net9.0/ref/EnglishDist.dll new file mode 100644 index 0000000..7ce5a37 Binary files /dev/null and b/labs/lab2/EnglishDist/obj/Debug/net9.0/ref/EnglishDist.dll differ diff --git a/labs/lab2/EnglishDist/obj/Debug/net9.0/refint/EnglishDist.dll b/labs/lab2/EnglishDist/obj/Debug/net9.0/refint/EnglishDist.dll new file mode 100644 index 0000000..7ce5a37 Binary files /dev/null and b/labs/lab2/EnglishDist/obj/Debug/net9.0/refint/EnglishDist.dll differ diff --git a/labs/lab2/EnglishDist/obj/EnglishDist.csproj.nuget.dgspec.json b/labs/lab2/EnglishDist/obj/EnglishDist.csproj.nuget.dgspec.json new file mode 100644 index 0000000..120d9e3 --- /dev/null +++ b/labs/lab2/EnglishDist/obj/EnglishDist.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab2/EnglishDist/EnglishDist.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab2/EnglishDist/EnglishDist.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab2/EnglishDist/EnglishDist.csproj", + "projectName": "EnglishDist", + "projectPath": "/home/nik/oop/labs/lab2/EnglishDist/EnglishDist.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab2/EnglishDist/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab2/EnglishDist/obj/EnglishDist.csproj.nuget.g.props b/labs/lab2/EnglishDist/obj/EnglishDist.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab2/EnglishDist/obj/EnglishDist.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab2/EnglishDist/obj/EnglishDist.csproj.nuget.g.targets b/labs/lab2/EnglishDist/obj/EnglishDist.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab2/EnglishDist/obj/EnglishDist.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab2/EnglishDist/obj/project.assets.json b/labs/lab2/EnglishDist/obj/project.assets.json new file mode 100644 index 0000000..14acccf --- /dev/null +++ b/labs/lab2/EnglishDist/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab2/EnglishDist/EnglishDist.csproj", + "projectName": "EnglishDist", + "projectPath": "/home/nik/oop/labs/lab2/EnglishDist/EnglishDist.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab2/EnglishDist/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab2/EnglishDist/obj/project.nuget.cache b/labs/lab2/EnglishDist/obj/project.nuget.cache new file mode 100644 index 0000000..82c8280 --- /dev/null +++ b/labs/lab2/EnglishDist/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "lf7NTUB/PoM=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab2/EnglishDist/EnglishDist.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab2/StructType/Struct.cs b/labs/lab2/StructType/Struct.cs new file mode 100644 index 0000000..660b188 --- /dev/null +++ b/labs/lab2/StructType/Struct.cs @@ -0,0 +1,27 @@ +public enum AccountType { Checking, Deposit } + +public struct BankAccount +{ + public long accNo; + public decimal accBal; + public AccountType accType; +} + +public class Struct +{ + public static void Main(string[] args) + { + BankAccount goldAccount; + + + goldAccount.accType = AccountType.Checking; + goldAccount.accBal = (decimal)3200.00; + Console.Write("Enter account number: "); + goldAccount.accNo = long.Parse(Console.ReadLine()); + + Console.WriteLine("*** Account Summary ***"); + Console.WriteLine("Acct Number {0}", goldAccount.accNo); + Console.WriteLine("Acct Type {0}", goldAccount.accType); + Console.WriteLine("Acct Balance ${0}", goldAccount.accBal); + } +} diff --git a/labs/lab2/StructType/StructType.csproj b/labs/lab2/StructType/StructType.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab2/StructType/StructType.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab2/StructType/bin/Debug/net9.0/StructType b/labs/lab2/StructType/bin/Debug/net9.0/StructType new file mode 100755 index 0000000..3bb9ff3 Binary files /dev/null and b/labs/lab2/StructType/bin/Debug/net9.0/StructType differ diff --git a/labs/lab2/StructType/bin/Debug/net9.0/StructType.deps.json b/labs/lab2/StructType/bin/Debug/net9.0/StructType.deps.json new file mode 100644 index 0000000..e859969 --- /dev/null +++ b/labs/lab2/StructType/bin/Debug/net9.0/StructType.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "StructType/1.0.0": { + "runtime": { + "StructType.dll": {} + } + } + } + }, + "libraries": { + "StructType/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab2/StructType/bin/Debug/net9.0/StructType.dll b/labs/lab2/StructType/bin/Debug/net9.0/StructType.dll new file mode 100644 index 0000000..71ccbc0 Binary files /dev/null and b/labs/lab2/StructType/bin/Debug/net9.0/StructType.dll differ diff --git a/labs/lab2/StructType/bin/Debug/net9.0/StructType.pdb b/labs/lab2/StructType/bin/Debug/net9.0/StructType.pdb new file mode 100644 index 0000000..f1c750c Binary files /dev/null and b/labs/lab2/StructType/bin/Debug/net9.0/StructType.pdb differ diff --git a/labs/lab2/StructType/bin/Debug/net9.0/StructType.runtimeconfig.json b/labs/lab2/StructType/bin/Debug/net9.0/StructType.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab2/StructType/bin/Debug/net9.0/StructType.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab2/StructType/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab2/StructType/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab2/StructType/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.AssemblyInfo.cs b/labs/lab2/StructType/obj/Debug/net9.0/StructType.AssemblyInfo.cs new file mode 100644 index 0000000..ca9aeb9 --- /dev/null +++ b/labs/lab2/StructType/obj/Debug/net9.0/StructType.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("StructType")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("StructType")] +[assembly: System.Reflection.AssemblyTitleAttribute("StructType")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.AssemblyInfoInputs.cache b/labs/lab2/StructType/obj/Debug/net9.0/StructType.AssemblyInfoInputs.cache new file mode 100644 index 0000000..c5adea9 --- /dev/null +++ b/labs/lab2/StructType/obj/Debug/net9.0/StructType.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +23efcf46e828abbd5b9d4ca4c747e4db7e7653e34baaff9c955dd55a4930efbb diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab2/StructType/obj/Debug/net9.0/StructType.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..90c5039 --- /dev/null +++ b/labs/lab2/StructType/obj/Debug/net9.0/StructType.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = StructType +build_property.ProjectDir = /home/nik/oop/labs/lab2/StructType/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.GlobalUsings.g.cs b/labs/lab2/StructType/obj/Debug/net9.0/StructType.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab2/StructType/obj/Debug/net9.0/StructType.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.assets.cache b/labs/lab2/StructType/obj/Debug/net9.0/StructType.assets.cache new file mode 100644 index 0000000..24c0f20 Binary files /dev/null and b/labs/lab2/StructType/obj/Debug/net9.0/StructType.assets.cache differ diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.csproj.CoreCompileInputs.cache b/labs/lab2/StructType/obj/Debug/net9.0/StructType.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..4cd41c5 --- /dev/null +++ b/labs/lab2/StructType/obj/Debug/net9.0/StructType.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +694e7fb4c0dbb8dfc911b1f7753d0a690594b252d77fd14376819f1511d074b4 diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.csproj.FileListAbsolute.txt b/labs/lab2/StructType/obj/Debug/net9.0/StructType.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..99343f3 --- /dev/null +++ b/labs/lab2/StructType/obj/Debug/net9.0/StructType.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab2/StructType/bin/Debug/net9.0/StructType +/home/nik/oop/labs/lab2/StructType/bin/Debug/net9.0/StructType.deps.json +/home/nik/oop/labs/lab2/StructType/bin/Debug/net9.0/StructType.runtimeconfig.json +/home/nik/oop/labs/lab2/StructType/bin/Debug/net9.0/StructType.dll +/home/nik/oop/labs/lab2/StructType/bin/Debug/net9.0/StructType.pdb +/home/nik/oop/labs/lab2/StructType/obj/Debug/net9.0/StructType.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab2/StructType/obj/Debug/net9.0/StructType.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab2/StructType/obj/Debug/net9.0/StructType.AssemblyInfo.cs +/home/nik/oop/labs/lab2/StructType/obj/Debug/net9.0/StructType.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab2/StructType/obj/Debug/net9.0/StructType.dll +/home/nik/oop/labs/lab2/StructType/obj/Debug/net9.0/refint/StructType.dll +/home/nik/oop/labs/lab2/StructType/obj/Debug/net9.0/StructType.pdb +/home/nik/oop/labs/lab2/StructType/obj/Debug/net9.0/StructType.genruntimeconfig.cache +/home/nik/oop/labs/lab2/StructType/obj/Debug/net9.0/ref/StructType.dll diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.dll b/labs/lab2/StructType/obj/Debug/net9.0/StructType.dll new file mode 100644 index 0000000..71ccbc0 Binary files /dev/null and b/labs/lab2/StructType/obj/Debug/net9.0/StructType.dll differ diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.genruntimeconfig.cache b/labs/lab2/StructType/obj/Debug/net9.0/StructType.genruntimeconfig.cache new file mode 100644 index 0000000..b196f7f --- /dev/null +++ b/labs/lab2/StructType/obj/Debug/net9.0/StructType.genruntimeconfig.cache @@ -0,0 +1 @@ +832b291bc2dab5102850df6d66b6b28db841ae6072fdc3e24e247dd4e776f238 diff --git a/labs/lab2/StructType/obj/Debug/net9.0/StructType.pdb b/labs/lab2/StructType/obj/Debug/net9.0/StructType.pdb new file mode 100644 index 0000000..f1c750c Binary files /dev/null and b/labs/lab2/StructType/obj/Debug/net9.0/StructType.pdb differ diff --git a/labs/lab2/StructType/obj/Debug/net9.0/apphost b/labs/lab2/StructType/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..3bb9ff3 Binary files /dev/null and b/labs/lab2/StructType/obj/Debug/net9.0/apphost differ diff --git a/labs/lab2/StructType/obj/Debug/net9.0/ref/StructType.dll b/labs/lab2/StructType/obj/Debug/net9.0/ref/StructType.dll new file mode 100644 index 0000000..87df2c5 Binary files /dev/null and b/labs/lab2/StructType/obj/Debug/net9.0/ref/StructType.dll differ diff --git a/labs/lab2/StructType/obj/Debug/net9.0/refint/StructType.dll b/labs/lab2/StructType/obj/Debug/net9.0/refint/StructType.dll new file mode 100644 index 0000000..87df2c5 Binary files /dev/null and b/labs/lab2/StructType/obj/Debug/net9.0/refint/StructType.dll differ diff --git a/labs/lab2/StructType/obj/StructType.csproj.nuget.dgspec.json b/labs/lab2/StructType/obj/StructType.csproj.nuget.dgspec.json new file mode 100644 index 0000000..efc4e34 --- /dev/null +++ b/labs/lab2/StructType/obj/StructType.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab2/StructType/StructType.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab2/StructType/StructType.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab2/StructType/StructType.csproj", + "projectName": "StructType", + "projectPath": "/home/nik/oop/labs/lab2/StructType/StructType.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab2/StructType/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab2/StructType/obj/StructType.csproj.nuget.g.props b/labs/lab2/StructType/obj/StructType.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab2/StructType/obj/StructType.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab2/StructType/obj/StructType.csproj.nuget.g.targets b/labs/lab2/StructType/obj/StructType.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab2/StructType/obj/StructType.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab2/StructType/obj/project.assets.json b/labs/lab2/StructType/obj/project.assets.json new file mode 100644 index 0000000..b84ce2d --- /dev/null +++ b/labs/lab2/StructType/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab2/StructType/StructType.csproj", + "projectName": "StructType", + "projectPath": "/home/nik/oop/labs/lab2/StructType/StructType.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab2/StructType/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab2/StructType/obj/project.nuget.cache b/labs/lab2/StructType/obj/project.nuget.cache new file mode 100644 index 0000000..e842507 --- /dev/null +++ b/labs/lab2/StructType/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "t1oLKu9XqIc=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab2/StructType/StructType.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab2/assets/1.png b/labs/lab2/assets/1.png new file mode 100644 index 0000000..c693d35 Binary files /dev/null and b/labs/lab2/assets/1.png differ diff --git a/labs/lab2/assets/2.png b/labs/lab2/assets/2.png new file mode 100644 index 0000000..afc55dc Binary files /dev/null and b/labs/lab2/assets/2.png differ diff --git a/labs/lab2/assets/3.png b/labs/lab2/assets/3.png new file mode 100644 index 0000000..3bec507 Binary files /dev/null and b/labs/lab2/assets/3.png differ diff --git a/labs/lab2/report.pdf b/labs/lab2/report.pdf new file mode 100644 index 0000000..a4c2a30 Binary files /dev/null and b/labs/lab2/report.pdf differ diff --git a/labs/lab2/report.typ b/labs/lab2/report.typ new file mode 100644 index 0000000..266230a --- /dev/null +++ b/labs/lab2/report.typ @@ -0,0 +1,219 @@ +#set text(size: 1.3em) + +#show raw.where(block: false): box.with( + fill: luma(240), + inset: (x: 3pt, y: 0pt), + outset: (y: 3pt), + radius: 2pt, +) + +#show raw.where(block: true): block.with( + fill: luma(240), + inset: 10pt, + radius: 4pt, +) + +// title + +#align(center)[Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики] +\ +\ +\ +#align(center)[Факультет инфокоммуникационных технологий] +#align(center)[Направление подготовки 11.03.02] +\ +\ +#align(center)[Лабораторная работа №2] +#align(center)[Создание и использование размерных типов данных] +\ +\ +\ //#align(center)[Вариант 19] +\ +\ +\ +\ +\ +\ +\ +#align(right)[Выполнил:] +#align(right)[Дощенников Никита Андреевич] +#align(right)[Группа: К3221] +#align(right)[Проверил:] +#align(right)[Иванов Сергей Евгеньевич] +\ +\ +#align(center)[Санкт-Петербург] +#align(center)[2025] + +#pagebreak() + +=== Цель работы: + +Изучить размерные типы данных и приобрести навыки работы со структурными типами. + +=== Упражнение 1. Создание перечисления. + +Я создал перечисление для представления различных типов банковских счетов и использовал его для создания двух переменных, которым присвоил значения `Checking` и `Deposit`. Затем я вывел значения этих переменных при помощи функции `Console.WriteLine()`. + +```cs +using System; + +public enum AccountType { Checking, Deposit } + +public class Enum +{ + public static void Main(string[] args) + { + AccountType goldAccount; + AccountType platinumAccount; + + goldAccount = AccountType.Checking; + platinumAccount = AccountType.Deposit; + + Console.WriteLine("The Customer Account Type is {0}", goldAccount); + Console.WriteLine("The Customer Account Type is {0}", platinumAccount); + } +} +``` + +Пример работы: + +#align(center)[#image("assets/1.png")] + +=== Упражнение 2. Создание и использование структуры. + +Я создал структуру, которую можно использовать для представления банковских счетов. Для хранения номеров счетов (`long`), балансов счетов (`decimal`) и типов счетов (`AccountType`). Затем создал переменную типа структуры, заполнил ее данными и вывел результаты на консоль. + +```cs +using System; + +public enum AccountType { Checking, Deposit } + +public struct BankAccount +{ + public long accNo; + public decimal accBal; + public AccountType accType; +} + +public class Struct +{ + public static void Main(string[] args) + { + BankAccount goldAccount; + + + goldAccount.accType = AccountType.Checking; + goldAccount.accBal = (decimal)3200.00; + Console.Write("Enter account number: "); + goldAccount.accNo = long.Parse(Console.ReadLine()); + + Console.WriteLine("*** Account Summary ***"); + Console.WriteLine("Acct Number {0}", goldAccount.accNo); + Console.WriteLine("Acct Type {0}", goldAccount.accType); + Console.WriteLine("Acct Balance ${0}", goldAccount.accBal); + } +} +``` + +Пример работы: + +#align(center)[#image("assets/2.png")] + +=== Упражнение 3. Реализация структуры Distance. + +Создал структуру Distance, определяющую длину в английской системе мер. + +```cs +using System; + +struct Distance +{ + public int feet; + public int inches; + + public void Print() + { + Console.WriteLine("{0}' - {1}''", feet, inches); + } +} + +public class Program +{ + public static void Main(string[] args) + { + Distance d1, d2, d3; + + Console.Write("Input the first distance (feet): "); + d1.feet = int.Parse(Console.ReadLine()); + Console.Write("Input the first distance (inches): "); + d1.inches = int.Parse(Console.ReadLine()); + + Console.Write("Input the second distance (feet): "); + d2.feet = int.Parse(Console.ReadLine()); + Console.Write("Input the second distance (inches): "); + d2.inches = int.Parse(Console.ReadLine()); + + d3.feet = d1.feet + d2.feet; + d3.inches = d1.inches + d2.inches; + + d3.feet += d3.inches % 12; + d3.inches = d3.inches / 12; + + d3.Print(); + + } +} +``` + +Пример работы: + +#align(center)[#image("assets/3.png")] + +=== Выводы. + +В ходе выполнения лабораторной работе я изучил размерные типы данных и приобрел навыки работы со структурными типами. + +=== Code Review. (by #link("https://zzzcode.ai/")[zzzcode.ai]) + +*Резюме* + +Код, представленный выше, демонстрирует использование перечислений, структур и базовых операций ввода-вывода в C\#. Однако, он содержит несколько недостатков, которые могут повлиять на его читаемость, производительность и безопасность. + +*Ошибка* + +В коде есть несколько потенциальных ошибок, связанных с обработкой ввода. Например, если пользователь введет некорректные данные (нечисловые значения), программа вызовет исключение. Рекомендуется использовать `TryParse` для безопасного парсинга. + +*Стиль кода* + +Стиль кода в целом соответствует стандартам C\#. Однако, использование имен классов Enum и Struct не является удачным, так как они могут вызвать путаницу с встроенными типами. Рекомендуется использовать более описательные имена, такие как `AccountEnum` и `BankAccountStruct`. + +*Структура кода* + +Код разбит на три отдельных класса, что хорошо для организации, но может быть улучшено. Например, можно объединить функциональность в один класс с методами, чтобы избежать дублирования кода. + +*Читаемость* + +Читаемость кода можно улучшить, добавив комментарии и более четкие имена переменных. Например, вместо `d1`, `d2`, `d3` можно использовать `firstDistance`, `secondDistance`, `resultDistance`. + +*Производительность* + +Производительность кода не вызывает серьезных проблем, однако, использование `Console.ReadLine()` в цикле может быть оптимизировано, если ввод данных будет обрабатываться в одном методе. + +*Масштабируемость* + +Код не очень масштабируемый, так как добавление новых типов счетов или новых единиц измерения потребует значительных изменений. Рекомендуется использовать более гибкие структуры данных, такие как классы или коллекции. + +*Безопасность* + +Безопасность кода может быть улучшена путем добавления обработки исключений и проверки ввода. Это поможет избежать сбоев программы при некорректном вводе данных. + +*Обработка ошибок* + +Обработка ошибок в текущем коде отсутствует. Рекомендуется добавить блоки *try-catch* для обработки возможных исключений, особенно при работе с вводом пользователя. + +*Заключение* + +Код демонстрирует базовые концепции C\#, но требует доработки для повышения его надежности, читаемости и безопасности. Рекомендуется внести изменения, чтобы улучшить структуру и обработку ошибок, а также использовать более описательные имена для классов и переменных. + + diff --git a/labs/lab3/Calc_switch/Calc_switch.csproj b/labs/lab3/Calc_switch/Calc_switch.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab3/Calc_switch/Calc_switch.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab3/Calc_switch/Program.cs b/labs/lab3/Calc_switch/Program.cs new file mode 100644 index 0000000..15044e9 --- /dev/null +++ b/labs/lab3/Calc_switch/Program.cs @@ -0,0 +1,40 @@ +using System; + +public class Program +{ + static void Main(string[] args) + { + Console.Write("A = "); + double a = double.Parse(Console.ReadLine()); + Console.Write("OP = "); + char op = char.Parse(Console.ReadLine()); + Console.Write("B = "); + double b = double.Parse(Console.ReadLine()); + + + bool ok = true; + double res = 0; + + switch (op) + { + case '+': res = a + b; break; + case '-': res = a - b; break; + case '*': res = a * b; break; + case '/': + case ':': + res = a / b; break; + default: ok = false; break; + } + + if (ok) + { + Console.WriteLine("{0} {1} {2} = {3}", a, op, b, res); + } + else + { + Console.WriteLine("Операция не определена"); + } + + + } +} diff --git a/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch new file mode 100755 index 0000000..77fc690 Binary files /dev/null and b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch differ diff --git a/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.deps.json b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.deps.json new file mode 100644 index 0000000..f4b027e --- /dev/null +++ b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Calc_switch/1.0.0": { + "runtime": { + "Calc_switch.dll": {} + } + } + } + }, + "libraries": { + "Calc_switch/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.dll b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.dll new file mode 100644 index 0000000..efbb5d4 Binary files /dev/null and b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.dll differ diff --git a/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.pdb b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.pdb new file mode 100644 index 0000000..d555bbd Binary files /dev/null and b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.pdb differ diff --git a/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.runtimeconfig.json b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab3/Calc_switch/obj/Calc_switch.csproj.nuget.dgspec.json b/labs/lab3/Calc_switch/obj/Calc_switch.csproj.nuget.dgspec.json new file mode 100644 index 0000000..1de5822 --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Calc_switch.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab3/Calc_switch/Calc_switch.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab3/Calc_switch/Calc_switch.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Calc_switch/Calc_switch.csproj", + "projectName": "Calc_switch", + "projectPath": "/home/nik/oop/labs/lab3/Calc_switch/Calc_switch.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Calc_switch/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Calc_switch/obj/Calc_switch.csproj.nuget.g.props b/labs/lab3/Calc_switch/obj/Calc_switch.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Calc_switch.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab3/Calc_switch/obj/Calc_switch.csproj.nuget.g.targets b/labs/lab3/Calc_switch/obj/Calc_switch.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Calc_switch.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab3/Calc_switch/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.AssemblyInfo.cs b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.AssemblyInfo.cs new file mode 100644 index 0000000..62d41e4 --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Calc_switch")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("Calc_switch")] +[assembly: System.Reflection.AssemblyTitleAttribute("Calc_switch")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.AssemblyInfoInputs.cache b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.AssemblyInfoInputs.cache new file mode 100644 index 0000000..7e6f1c2 --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +bdc7ef3b738fa31478566bc46d5a1796bb0e371c39f067fc5de1812987ccca32 diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..c3ad48a --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Calc_switch +build_property.ProjectDir = /home/nik/oop/labs/lab3/Calc_switch/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.GlobalUsings.g.cs b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.assets.cache b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.assets.cache new file mode 100644 index 0000000..f65743b Binary files /dev/null and b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.assets.cache differ diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.csproj.CoreCompileInputs.cache b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..d88a1f3 --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +72e0fd76bdd4fbbaa2b7fc61e9ae9c365a1e5320c90e0d6b58bffdb5435ba591 diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.csproj.FileListAbsolute.txt b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..fb30f0e --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch +/home/nik/oop/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.deps.json +/home/nik/oop/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.runtimeconfig.json +/home/nik/oop/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.dll +/home/nik/oop/labs/lab3/Calc_switch/bin/Debug/net9.0/Calc_switch.pdb +/home/nik/oop/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.AssemblyInfo.cs +/home/nik/oop/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.dll +/home/nik/oop/labs/lab3/Calc_switch/obj/Debug/net9.0/refint/Calc_switch.dll +/home/nik/oop/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.pdb +/home/nik/oop/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.genruntimeconfig.cache +/home/nik/oop/labs/lab3/Calc_switch/obj/Debug/net9.0/ref/Calc_switch.dll diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.dll b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.dll new file mode 100644 index 0000000..efbb5d4 Binary files /dev/null and b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.dll differ diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.genruntimeconfig.cache b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.genruntimeconfig.cache new file mode 100644 index 0000000..0df3b86 --- /dev/null +++ b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.genruntimeconfig.cache @@ -0,0 +1 @@ +20e1d20fbd0f80e4eae1e8a6bc447b0f012b96726355b654aa2a8cb08d1b7858 diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.pdb b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.pdb new file mode 100644 index 0000000..d555bbd Binary files /dev/null and b/labs/lab3/Calc_switch/obj/Debug/net9.0/Calc_switch.pdb differ diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/apphost b/labs/lab3/Calc_switch/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..77fc690 Binary files /dev/null and b/labs/lab3/Calc_switch/obj/Debug/net9.0/apphost differ diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/ref/Calc_switch.dll b/labs/lab3/Calc_switch/obj/Debug/net9.0/ref/Calc_switch.dll new file mode 100644 index 0000000..646ec4d Binary files /dev/null and b/labs/lab3/Calc_switch/obj/Debug/net9.0/ref/Calc_switch.dll differ diff --git a/labs/lab3/Calc_switch/obj/Debug/net9.0/refint/Calc_switch.dll b/labs/lab3/Calc_switch/obj/Debug/net9.0/refint/Calc_switch.dll new file mode 100644 index 0000000..646ec4d Binary files /dev/null and b/labs/lab3/Calc_switch/obj/Debug/net9.0/refint/Calc_switch.dll differ diff --git a/labs/lab3/Calc_switch/obj/project.assets.json b/labs/lab3/Calc_switch/obj/project.assets.json new file mode 100644 index 0000000..a2fd1f6 --- /dev/null +++ b/labs/lab3/Calc_switch/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Calc_switch/Calc_switch.csproj", + "projectName": "Calc_switch", + "projectPath": "/home/nik/oop/labs/lab3/Calc_switch/Calc_switch.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Calc_switch/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Calc_switch/obj/project.nuget.cache b/labs/lab3/Calc_switch/obj/project.nuget.cache new file mode 100644 index 0000000..eb1e823 --- /dev/null +++ b/labs/lab3/Calc_switch/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "CGW2XdbYpzY=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab3/Calc_switch/Calc_switch.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab3/Comp/Comp.csproj b/labs/lab3/Comp/Comp.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab3/Comp/Comp.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab3/Comp/Program.cs b/labs/lab3/Comp/Program.cs new file mode 100644 index 0000000..f159cd7 --- /dev/null +++ b/labs/lab3/Comp/Program.cs @@ -0,0 +1,83 @@ +using System; +using System.Globalization; + +class Program +{ + static void FuncWhile() + { + var ci = CultureInfo.InvariantCulture; + double x1 = double.Parse(Console.ReadLine(), ci); + double x2 = double.Parse(Console.ReadLine(), ci); + double h = double.Parse(Console.ReadLine(), ci); + double x = x1; + while (x <= x2 + 1e-12) + { + double y = Math.Sin(x); + Console.WriteLine($"while: {x.ToString(ci)} {y.ToString(ci)}"); + x += h; + } + } + + static void FuncDoWhile() + { + var ci = CultureInfo.InvariantCulture; + double x1 = double.Parse(Console.ReadLine(), ci); + double x2 = double.Parse(Console.ReadLine(), ci); + double h = double.Parse(Console.ReadLine(), ci); + double x = x1; + if (h <= 0) return; + do + { + double y = Math.Sin(x); + Console.WriteLine($"do-while: {x.ToString(ci)} {y.ToString(ci)}"); + x += h; + } while (x - h < x2 + 1e-12); + } + + static int GcdWhile(int a, int b) + { + a = Math.Abs(a); + b = Math.Abs(b); + while (b != 0) + { + int temp = a % b; + a = b; + b = temp; + } + return a; + } + + static int GcdDoWhile(int a, int b) + { + a = Math.Abs(a); + b = Math.Abs(b); + int temp; + if (b == 0) return a; + do + { + temp = a % b; + a = b; + b = temp; + } while (b != 0); + return a; + } + + static void Main() + { + Console.WriteLine("=== Функция с while ==="); + FuncWhile(); + + Console.WriteLine("=== Функция с do-while ==="); + FuncDoWhile(); + + Console.WriteLine("Введите два числа для НОД (while):"); + int a = int.Parse(Console.ReadLine()); + int b = int.Parse(Console.ReadLine()); + Console.WriteLine($"НОД (while): {GcdWhile(a, b)}"); + + Console.WriteLine("Введите два числа для НОД (do-while):"); + a = int.Parse(Console.ReadLine()); + b = int.Parse(Console.ReadLine()); + Console.WriteLine($"НОД (do-while): {GcdDoWhile(a, b)}"); + } +} diff --git a/labs/lab3/Comp/bin/Debug/net9.0/Comp b/labs/lab3/Comp/bin/Debug/net9.0/Comp new file mode 100755 index 0000000..766c6df Binary files /dev/null and b/labs/lab3/Comp/bin/Debug/net9.0/Comp differ diff --git a/labs/lab3/Comp/bin/Debug/net9.0/Comp.deps.json b/labs/lab3/Comp/bin/Debug/net9.0/Comp.deps.json new file mode 100644 index 0000000..aefce9e --- /dev/null +++ b/labs/lab3/Comp/bin/Debug/net9.0/Comp.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Comp/1.0.0": { + "runtime": { + "Comp.dll": {} + } + } + } + }, + "libraries": { + "Comp/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab3/Comp/bin/Debug/net9.0/Comp.dll b/labs/lab3/Comp/bin/Debug/net9.0/Comp.dll new file mode 100644 index 0000000..041280c Binary files /dev/null and b/labs/lab3/Comp/bin/Debug/net9.0/Comp.dll differ diff --git a/labs/lab3/Comp/bin/Debug/net9.0/Comp.pdb b/labs/lab3/Comp/bin/Debug/net9.0/Comp.pdb new file mode 100644 index 0000000..e03000b Binary files /dev/null and b/labs/lab3/Comp/bin/Debug/net9.0/Comp.pdb differ diff --git a/labs/lab3/Comp/bin/Debug/net9.0/Comp.runtimeconfig.json b/labs/lab3/Comp/bin/Debug/net9.0/Comp.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab3/Comp/bin/Debug/net9.0/Comp.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab3/Comp/obj/Comp.csproj.nuget.dgspec.json b/labs/lab3/Comp/obj/Comp.csproj.nuget.dgspec.json new file mode 100644 index 0000000..10d5f18 --- /dev/null +++ b/labs/lab3/Comp/obj/Comp.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab3/Comp/Comp.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab3/Comp/Comp.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Comp/Comp.csproj", + "projectName": "Comp", + "projectPath": "/home/nik/oop/labs/lab3/Comp/Comp.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Comp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Comp/obj/Comp.csproj.nuget.g.props b/labs/lab3/Comp/obj/Comp.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab3/Comp/obj/Comp.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab3/Comp/obj/Comp.csproj.nuget.g.targets b/labs/lab3/Comp/obj/Comp.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab3/Comp/obj/Comp.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab3/Comp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab3/Comp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab3/Comp/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.AssemblyInfo.cs b/labs/lab3/Comp/obj/Debug/net9.0/Comp.AssemblyInfo.cs new file mode 100644 index 0000000..e9f3507 --- /dev/null +++ b/labs/lab3/Comp/obj/Debug/net9.0/Comp.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Comp")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("Comp")] +[assembly: System.Reflection.AssemblyTitleAttribute("Comp")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.AssemblyInfoInputs.cache b/labs/lab3/Comp/obj/Debug/net9.0/Comp.AssemblyInfoInputs.cache new file mode 100644 index 0000000..7bd60d7 --- /dev/null +++ b/labs/lab3/Comp/obj/Debug/net9.0/Comp.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +677cf42b4bab56d254af3cedf70d8b33a1cd8655b77b844cda69688062236d4c diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab3/Comp/obj/Debug/net9.0/Comp.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..70adf07 --- /dev/null +++ b/labs/lab3/Comp/obj/Debug/net9.0/Comp.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Comp +build_property.ProjectDir = /home/nik/oop/labs/lab3/Comp/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.GlobalUsings.g.cs b/labs/lab3/Comp/obj/Debug/net9.0/Comp.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab3/Comp/obj/Debug/net9.0/Comp.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.assets.cache b/labs/lab3/Comp/obj/Debug/net9.0/Comp.assets.cache new file mode 100644 index 0000000..6cd6a13 Binary files /dev/null and b/labs/lab3/Comp/obj/Debug/net9.0/Comp.assets.cache differ diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.csproj.CoreCompileInputs.cache b/labs/lab3/Comp/obj/Debug/net9.0/Comp.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..823e498 --- /dev/null +++ b/labs/lab3/Comp/obj/Debug/net9.0/Comp.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +4738ae1d639521aa06fcc6e9f50bf7555361be46ea0813aeaae0849ff0d8dda5 diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.csproj.FileListAbsolute.txt b/labs/lab3/Comp/obj/Debug/net9.0/Comp.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..eeeb109 --- /dev/null +++ b/labs/lab3/Comp/obj/Debug/net9.0/Comp.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab3/Comp/bin/Debug/net9.0/Comp +/home/nik/oop/labs/lab3/Comp/bin/Debug/net9.0/Comp.deps.json +/home/nik/oop/labs/lab3/Comp/bin/Debug/net9.0/Comp.runtimeconfig.json +/home/nik/oop/labs/lab3/Comp/bin/Debug/net9.0/Comp.dll +/home/nik/oop/labs/lab3/Comp/bin/Debug/net9.0/Comp.pdb +/home/nik/oop/labs/lab3/Comp/obj/Debug/net9.0/Comp.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab3/Comp/obj/Debug/net9.0/Comp.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab3/Comp/obj/Debug/net9.0/Comp.AssemblyInfo.cs +/home/nik/oop/labs/lab3/Comp/obj/Debug/net9.0/Comp.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab3/Comp/obj/Debug/net9.0/Comp.dll +/home/nik/oop/labs/lab3/Comp/obj/Debug/net9.0/refint/Comp.dll +/home/nik/oop/labs/lab3/Comp/obj/Debug/net9.0/Comp.pdb +/home/nik/oop/labs/lab3/Comp/obj/Debug/net9.0/Comp.genruntimeconfig.cache +/home/nik/oop/labs/lab3/Comp/obj/Debug/net9.0/ref/Comp.dll diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.dll b/labs/lab3/Comp/obj/Debug/net9.0/Comp.dll new file mode 100644 index 0000000..041280c Binary files /dev/null and b/labs/lab3/Comp/obj/Debug/net9.0/Comp.dll differ diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.genruntimeconfig.cache b/labs/lab3/Comp/obj/Debug/net9.0/Comp.genruntimeconfig.cache new file mode 100644 index 0000000..8b1a050 --- /dev/null +++ b/labs/lab3/Comp/obj/Debug/net9.0/Comp.genruntimeconfig.cache @@ -0,0 +1 @@ +1c1d8aa99bad15c1419b15147aa809a187ce4df48a3ea49619a2b8366bd03c85 diff --git a/labs/lab3/Comp/obj/Debug/net9.0/Comp.pdb b/labs/lab3/Comp/obj/Debug/net9.0/Comp.pdb new file mode 100644 index 0000000..e03000b Binary files /dev/null and b/labs/lab3/Comp/obj/Debug/net9.0/Comp.pdb differ diff --git a/labs/lab3/Comp/obj/Debug/net9.0/apphost b/labs/lab3/Comp/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..766c6df Binary files /dev/null and b/labs/lab3/Comp/obj/Debug/net9.0/apphost differ diff --git a/labs/lab3/Comp/obj/Debug/net9.0/ref/Comp.dll b/labs/lab3/Comp/obj/Debug/net9.0/ref/Comp.dll new file mode 100644 index 0000000..91456a3 Binary files /dev/null and b/labs/lab3/Comp/obj/Debug/net9.0/ref/Comp.dll differ diff --git a/labs/lab3/Comp/obj/Debug/net9.0/refint/Comp.dll b/labs/lab3/Comp/obj/Debug/net9.0/refint/Comp.dll new file mode 100644 index 0000000..91456a3 Binary files /dev/null and b/labs/lab3/Comp/obj/Debug/net9.0/refint/Comp.dll differ diff --git a/labs/lab3/Comp/obj/project.assets.json b/labs/lab3/Comp/obj/project.assets.json new file mode 100644 index 0000000..08877c8 --- /dev/null +++ b/labs/lab3/Comp/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Comp/Comp.csproj", + "projectName": "Comp", + "projectPath": "/home/nik/oop/labs/lab3/Comp/Comp.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Comp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Comp/obj/project.nuget.cache b/labs/lab3/Comp/obj/project.nuget.cache new file mode 100644 index 0000000..56baff6 --- /dev/null +++ b/labs/lab3/Comp/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "vi8SeANFTxY=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab3/Comp/Comp.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab3/Euclid/Euclid.csproj b/labs/lab3/Euclid/Euclid.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab3/Euclid/Euclid.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab3/Euclid/Program.cs b/labs/lab3/Euclid/Program.cs new file mode 100644 index 0000000..802bd5d --- /dev/null +++ b/labs/lab3/Euclid/Program.cs @@ -0,0 +1,29 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + int a, b, temp; + + Console.Write("input a:"); + a = int.Parse(Console.ReadLine()); + Console.Write("input b:"); + b = int.Parse(Console.ReadLine()); + + temp = a; + while (temp != b) + { + a = temp; + if (a < b) + { + temp = a; + a = b; + b = temp; + } + temp = a - b; + a = b; + + } + } +} diff --git a/labs/lab3/Euclid/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab3/Euclid/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab3/Euclid/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.AssemblyInfo.cs b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.AssemblyInfo.cs new file mode 100644 index 0000000..127022e --- /dev/null +++ b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Euclid")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6643fa5a40ce2f8d59e947612957e6f98be0fc14")] +[assembly: System.Reflection.AssemblyProductAttribute("Euclid")] +[assembly: System.Reflection.AssemblyTitleAttribute("Euclid")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.AssemblyInfoInputs.cache b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.AssemblyInfoInputs.cache new file mode 100644 index 0000000..3fa6df7 --- /dev/null +++ b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +f7830e0aba6c81b9b3395da547faa38c5d32674275cb9544fcd3300fe273345e diff --git a/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..f9063ab --- /dev/null +++ b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Euclid +build_property.ProjectDir = /home/nik/oop/labs/lab3/Euclid/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.GlobalUsings.g.cs b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.assets.cache b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.assets.cache new file mode 100644 index 0000000..5138f65 Binary files /dev/null and b/labs/lab3/Euclid/obj/Debug/net9.0/Euclid.assets.cache differ diff --git a/labs/lab3/Euclid/obj/Euclid.csproj.nuget.dgspec.json b/labs/lab3/Euclid/obj/Euclid.csproj.nuget.dgspec.json new file mode 100644 index 0000000..b03c282 --- /dev/null +++ b/labs/lab3/Euclid/obj/Euclid.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab3/Euclid/Euclid.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab3/Euclid/Euclid.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Euclid/Euclid.csproj", + "projectName": "Euclid", + "projectPath": "/home/nik/oop/labs/lab3/Euclid/Euclid.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Euclid/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Euclid/obj/Euclid.csproj.nuget.g.props b/labs/lab3/Euclid/obj/Euclid.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab3/Euclid/obj/Euclid.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab3/Euclid/obj/Euclid.csproj.nuget.g.targets b/labs/lab3/Euclid/obj/Euclid.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab3/Euclid/obj/Euclid.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab3/Euclid/obj/project.assets.json b/labs/lab3/Euclid/obj/project.assets.json new file mode 100644 index 0000000..c48d689 --- /dev/null +++ b/labs/lab3/Euclid/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Euclid/Euclid.csproj", + "projectName": "Euclid", + "projectPath": "/home/nik/oop/labs/lab3/Euclid/Euclid.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Euclid/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Euclid/obj/project.nuget.cache b/labs/lab3/Euclid/obj/project.nuget.cache new file mode 100644 index 0000000..5dd2456 --- /dev/null +++ b/labs/lab3/Euclid/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "LKMJ2E6KA3k=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab3/Euclid/Euclid.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab3/IsLeapYear/IsLeapYear.csproj b/labs/lab3/IsLeapYear/IsLeapYear.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab3/IsLeapYear/IsLeapYear.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab3/IsLeapYear/Program.cs b/labs/lab3/IsLeapYear/Program.cs new file mode 100644 index 0000000..038fa86 --- /dev/null +++ b/labs/lab3/IsLeapYear/Program.cs @@ -0,0 +1,19 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + Console.WriteLine("input a year: "); + int year = int.Parse(Console.ReadLine()); + + if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) + { + Console.WriteLine("YES"); + } + else + { + Console.WriteLine("NO"); + } + } +} diff --git a/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear new file mode 100755 index 0000000..db70a5b Binary files /dev/null and b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear differ diff --git a/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.deps.json b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.deps.json new file mode 100644 index 0000000..3d58324 --- /dev/null +++ b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "IsLeapYear/1.0.0": { + "runtime": { + "IsLeapYear.dll": {} + } + } + } + }, + "libraries": { + "IsLeapYear/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.dll b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.dll new file mode 100644 index 0000000..1834d41 Binary files /dev/null and b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.dll differ diff --git a/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.pdb b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.pdb new file mode 100644 index 0000000..3a9e292 Binary files /dev/null and b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.pdb differ diff --git a/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.runtimeconfig.json b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab3/IsLeapYear/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.AssemblyInfo.cs b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.AssemblyInfo.cs new file mode 100644 index 0000000..b82e0db --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("IsLeapYear")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("IsLeapYear")] +[assembly: System.Reflection.AssemblyTitleAttribute("IsLeapYear")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.AssemblyInfoInputs.cache b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.AssemblyInfoInputs.cache new file mode 100644 index 0000000..8e0f5e2 --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +60073248f2e72a410758d2cc334f2df45c4e1b928c7d10106e1f0d0985acbdd8 diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..d1d4060 --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = IsLeapYear +build_property.ProjectDir = /home/nik/oop/labs/lab3/IsLeapYear/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.GlobalUsings.g.cs b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.assets.cache b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.assets.cache new file mode 100644 index 0000000..b88664c Binary files /dev/null and b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.assets.cache differ diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.csproj.CoreCompileInputs.cache b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..2aadf1a --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +3e32f3e5469fa7ae4d4f6575879ce0b088bed58b037e048fde6d3046b571ffa2 diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.csproj.FileListAbsolute.txt b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..7c6154b --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear +/home/nik/oop/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.deps.json +/home/nik/oop/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.runtimeconfig.json +/home/nik/oop/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.dll +/home/nik/oop/labs/lab3/IsLeapYear/bin/Debug/net9.0/IsLeapYear.pdb +/home/nik/oop/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.AssemblyInfo.cs +/home/nik/oop/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.dll +/home/nik/oop/labs/lab3/IsLeapYear/obj/Debug/net9.0/refint/IsLeapYear.dll +/home/nik/oop/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.pdb +/home/nik/oop/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.genruntimeconfig.cache +/home/nik/oop/labs/lab3/IsLeapYear/obj/Debug/net9.0/ref/IsLeapYear.dll diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.dll b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.dll new file mode 100644 index 0000000..1834d41 Binary files /dev/null and b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.dll differ diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.genruntimeconfig.cache b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.genruntimeconfig.cache new file mode 100644 index 0000000..dabe66e --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.genruntimeconfig.cache @@ -0,0 +1 @@ +d8e6b743770e775cc3dd410d6f7406fcf6c428e911ed12953f3cfc04caa010f4 diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.pdb b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.pdb new file mode 100644 index 0000000..3a9e292 Binary files /dev/null and b/labs/lab3/IsLeapYear/obj/Debug/net9.0/IsLeapYear.pdb differ diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/apphost b/labs/lab3/IsLeapYear/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..db70a5b Binary files /dev/null and b/labs/lab3/IsLeapYear/obj/Debug/net9.0/apphost differ diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/ref/IsLeapYear.dll b/labs/lab3/IsLeapYear/obj/Debug/net9.0/ref/IsLeapYear.dll new file mode 100644 index 0000000..e3fb02b Binary files /dev/null and b/labs/lab3/IsLeapYear/obj/Debug/net9.0/ref/IsLeapYear.dll differ diff --git a/labs/lab3/IsLeapYear/obj/Debug/net9.0/refint/IsLeapYear.dll b/labs/lab3/IsLeapYear/obj/Debug/net9.0/refint/IsLeapYear.dll new file mode 100644 index 0000000..e3fb02b Binary files /dev/null and b/labs/lab3/IsLeapYear/obj/Debug/net9.0/refint/IsLeapYear.dll differ diff --git a/labs/lab3/IsLeapYear/obj/IsLeapYear.csproj.nuget.dgspec.json b/labs/lab3/IsLeapYear/obj/IsLeapYear.csproj.nuget.dgspec.json new file mode 100644 index 0000000..406800d --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/IsLeapYear.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab3/IsLeapYear/IsLeapYear.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab3/IsLeapYear/IsLeapYear.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/IsLeapYear/IsLeapYear.csproj", + "projectName": "IsLeapYear", + "projectPath": "/home/nik/oop/labs/lab3/IsLeapYear/IsLeapYear.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/IsLeapYear/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/IsLeapYear/obj/IsLeapYear.csproj.nuget.g.props b/labs/lab3/IsLeapYear/obj/IsLeapYear.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/IsLeapYear.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab3/IsLeapYear/obj/IsLeapYear.csproj.nuget.g.targets b/labs/lab3/IsLeapYear/obj/IsLeapYear.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/IsLeapYear.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab3/IsLeapYear/obj/project.assets.json b/labs/lab3/IsLeapYear/obj/project.assets.json new file mode 100644 index 0000000..6d4dcd7 --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/IsLeapYear/IsLeapYear.csproj", + "projectName": "IsLeapYear", + "projectPath": "/home/nik/oop/labs/lab3/IsLeapYear/IsLeapYear.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/IsLeapYear/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/IsLeapYear/obj/project.nuget.cache b/labs/lab3/IsLeapYear/obj/project.nuget.cache new file mode 100644 index 0000000..88ef84f --- /dev/null +++ b/labs/lab3/IsLeapYear/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "ctq/+qcVpDY=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab3/IsLeapYear/IsLeapYear.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab3/Loop/Loop.csproj b/labs/lab3/Loop/Loop.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab3/Loop/Loop.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab3/Loop/Program.cs b/labs/lab3/Loop/Program.cs new file mode 100644 index 0000000..cbd4ad4 --- /dev/null +++ b/labs/lab3/Loop/Program.cs @@ -0,0 +1,36 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + Console.Write("n = "); + int n = int.Parse(Console.ReadLine()); + + // while + Console.Write("\nwhile: \t\t"); + int i = 1; + while (i <= n) + { + Console.Write(" " + i); + i += 2; + } + + // do-while + Console.Write("\ndo while: \t"); + i = 1; + do + { + Console.Write(" " + i); + i += 2; + } + while (i <= n); + + // for: + Console.Write("\nfor: \t\t"); + for (i = 1; i<=n; i+=2) + { + Console.Write(" " + i); + } + } +} diff --git a/labs/lab3/Loop/bin/Debug/net9.0/Loop b/labs/lab3/Loop/bin/Debug/net9.0/Loop new file mode 100755 index 0000000..42539d9 Binary files /dev/null and b/labs/lab3/Loop/bin/Debug/net9.0/Loop differ diff --git a/labs/lab3/Loop/bin/Debug/net9.0/Loop.deps.json b/labs/lab3/Loop/bin/Debug/net9.0/Loop.deps.json new file mode 100644 index 0000000..5d2161c --- /dev/null +++ b/labs/lab3/Loop/bin/Debug/net9.0/Loop.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Loop/1.0.0": { + "runtime": { + "Loop.dll": {} + } + } + } + }, + "libraries": { + "Loop/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab3/Loop/bin/Debug/net9.0/Loop.dll b/labs/lab3/Loop/bin/Debug/net9.0/Loop.dll new file mode 100644 index 0000000..7ba0f35 Binary files /dev/null and b/labs/lab3/Loop/bin/Debug/net9.0/Loop.dll differ diff --git a/labs/lab3/Loop/bin/Debug/net9.0/Loop.pdb b/labs/lab3/Loop/bin/Debug/net9.0/Loop.pdb new file mode 100644 index 0000000..b000452 Binary files /dev/null and b/labs/lab3/Loop/bin/Debug/net9.0/Loop.pdb differ diff --git a/labs/lab3/Loop/bin/Debug/net9.0/Loop.runtimeconfig.json b/labs/lab3/Loop/bin/Debug/net9.0/Loop.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab3/Loop/bin/Debug/net9.0/Loop.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab3/Loop/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab3/Loop/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab3/Loop/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.AssemblyInfo.cs b/labs/lab3/Loop/obj/Debug/net9.0/Loop.AssemblyInfo.cs new file mode 100644 index 0000000..3cfab04 --- /dev/null +++ b/labs/lab3/Loop/obj/Debug/net9.0/Loop.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Loop")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("Loop")] +[assembly: System.Reflection.AssemblyTitleAttribute("Loop")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.AssemblyInfoInputs.cache b/labs/lab3/Loop/obj/Debug/net9.0/Loop.AssemblyInfoInputs.cache new file mode 100644 index 0000000..9e426cb --- /dev/null +++ b/labs/lab3/Loop/obj/Debug/net9.0/Loop.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +bf2f7185f2e3e0f986e4aea4b7390617005ba66252e8944ac1d9f630942ad797 diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab3/Loop/obj/Debug/net9.0/Loop.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..d9438cb --- /dev/null +++ b/labs/lab3/Loop/obj/Debug/net9.0/Loop.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Loop +build_property.ProjectDir = /home/nik/oop/labs/lab3/Loop/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.GlobalUsings.g.cs b/labs/lab3/Loop/obj/Debug/net9.0/Loop.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab3/Loop/obj/Debug/net9.0/Loop.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.assets.cache b/labs/lab3/Loop/obj/Debug/net9.0/Loop.assets.cache new file mode 100644 index 0000000..9e764e6 Binary files /dev/null and b/labs/lab3/Loop/obj/Debug/net9.0/Loop.assets.cache differ diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.csproj.CoreCompileInputs.cache b/labs/lab3/Loop/obj/Debug/net9.0/Loop.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..1ceefba --- /dev/null +++ b/labs/lab3/Loop/obj/Debug/net9.0/Loop.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +eb652d3648ca123ec0f2e76e9ac62039c34b354d5c7aa7386f7cb989ddbaddae diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.csproj.FileListAbsolute.txt b/labs/lab3/Loop/obj/Debug/net9.0/Loop.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..be5949f --- /dev/null +++ b/labs/lab3/Loop/obj/Debug/net9.0/Loop.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab3/Loop/bin/Debug/net9.0/Loop +/home/nik/oop/labs/lab3/Loop/bin/Debug/net9.0/Loop.deps.json +/home/nik/oop/labs/lab3/Loop/bin/Debug/net9.0/Loop.runtimeconfig.json +/home/nik/oop/labs/lab3/Loop/bin/Debug/net9.0/Loop.dll +/home/nik/oop/labs/lab3/Loop/bin/Debug/net9.0/Loop.pdb +/home/nik/oop/labs/lab3/Loop/obj/Debug/net9.0/Loop.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab3/Loop/obj/Debug/net9.0/Loop.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab3/Loop/obj/Debug/net9.0/Loop.AssemblyInfo.cs +/home/nik/oop/labs/lab3/Loop/obj/Debug/net9.0/Loop.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab3/Loop/obj/Debug/net9.0/Loop.dll +/home/nik/oop/labs/lab3/Loop/obj/Debug/net9.0/refint/Loop.dll +/home/nik/oop/labs/lab3/Loop/obj/Debug/net9.0/Loop.pdb +/home/nik/oop/labs/lab3/Loop/obj/Debug/net9.0/Loop.genruntimeconfig.cache +/home/nik/oop/labs/lab3/Loop/obj/Debug/net9.0/ref/Loop.dll diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.dll b/labs/lab3/Loop/obj/Debug/net9.0/Loop.dll new file mode 100644 index 0000000..7ba0f35 Binary files /dev/null and b/labs/lab3/Loop/obj/Debug/net9.0/Loop.dll differ diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.genruntimeconfig.cache b/labs/lab3/Loop/obj/Debug/net9.0/Loop.genruntimeconfig.cache new file mode 100644 index 0000000..ada95a0 --- /dev/null +++ b/labs/lab3/Loop/obj/Debug/net9.0/Loop.genruntimeconfig.cache @@ -0,0 +1 @@ +cb6cee412323f6c8ce04660d6787b0f7c32124eeef738762ed1e4f9b19111dca diff --git a/labs/lab3/Loop/obj/Debug/net9.0/Loop.pdb b/labs/lab3/Loop/obj/Debug/net9.0/Loop.pdb new file mode 100644 index 0000000..b000452 Binary files /dev/null and b/labs/lab3/Loop/obj/Debug/net9.0/Loop.pdb differ diff --git a/labs/lab3/Loop/obj/Debug/net9.0/apphost b/labs/lab3/Loop/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..42539d9 Binary files /dev/null and b/labs/lab3/Loop/obj/Debug/net9.0/apphost differ diff --git a/labs/lab3/Loop/obj/Debug/net9.0/ref/Loop.dll b/labs/lab3/Loop/obj/Debug/net9.0/ref/Loop.dll new file mode 100644 index 0000000..c9f8ec1 Binary files /dev/null and b/labs/lab3/Loop/obj/Debug/net9.0/ref/Loop.dll differ diff --git a/labs/lab3/Loop/obj/Debug/net9.0/refint/Loop.dll b/labs/lab3/Loop/obj/Debug/net9.0/refint/Loop.dll new file mode 100644 index 0000000..c9f8ec1 Binary files /dev/null and b/labs/lab3/Loop/obj/Debug/net9.0/refint/Loop.dll differ diff --git a/labs/lab3/Loop/obj/Loop.csproj.nuget.dgspec.json b/labs/lab3/Loop/obj/Loop.csproj.nuget.dgspec.json new file mode 100644 index 0000000..f71a2ec --- /dev/null +++ b/labs/lab3/Loop/obj/Loop.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab3/Loop/Loop.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab3/Loop/Loop.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Loop/Loop.csproj", + "projectName": "Loop", + "projectPath": "/home/nik/oop/labs/lab3/Loop/Loop.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Loop/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Loop/obj/Loop.csproj.nuget.g.props b/labs/lab3/Loop/obj/Loop.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab3/Loop/obj/Loop.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab3/Loop/obj/Loop.csproj.nuget.g.targets b/labs/lab3/Loop/obj/Loop.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab3/Loop/obj/Loop.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab3/Loop/obj/project.assets.json b/labs/lab3/Loop/obj/project.assets.json new file mode 100644 index 0000000..0fed014 --- /dev/null +++ b/labs/lab3/Loop/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Loop/Loop.csproj", + "projectName": "Loop", + "projectPath": "/home/nik/oop/labs/lab3/Loop/Loop.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Loop/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Loop/obj/project.nuget.cache b/labs/lab3/Loop/obj/project.nuget.cache new file mode 100644 index 0000000..fa03cba --- /dev/null +++ b/labs/lab3/Loop/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "fGLV8BdpHsk=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab3/Loop/Loop.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab3/Shapeifelse/Program.cs b/labs/lab3/Shapeifelse/Program.cs new file mode 100644 index 0000000..492e864 --- /dev/null +++ b/labs/lab3/Shapeifelse/Program.cs @@ -0,0 +1,27 @@ +using System; + +public class Program +{ + static void Main(string[] args) + { + Console.Write("x = "); + float x = float.Parse(Console.ReadLine()); + + Console.Write("y = "); + float y = float.Parse(Console.ReadLine()); + + if (x * x + y * y < 9 && y > 0) + { + Console.WriteLine("Внутри"); + } + else if (x * x + y * y > 9 || y < 0) + { + Console.WriteLine("вне"); + } + else + { + Console.WriteLine("на границе"); + } + + } +} diff --git a/labs/lab3/Shapeifelse/Shapeifelse.csproj b/labs/lab3/Shapeifelse/Shapeifelse.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab3/Shapeifelse/Shapeifelse.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse new file mode 100755 index 0000000..10f579b Binary files /dev/null and b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse differ diff --git a/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.deps.json b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.deps.json new file mode 100644 index 0000000..26437ce --- /dev/null +++ b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Shapeifelse/1.0.0": { + "runtime": { + "Shapeifelse.dll": {} + } + } + } + }, + "libraries": { + "Shapeifelse/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.dll b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.dll new file mode 100644 index 0000000..b51860b Binary files /dev/null and b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.dll differ diff --git a/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.pdb b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.pdb new file mode 100644 index 0000000..0fd63e0 Binary files /dev/null and b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.pdb differ diff --git a/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.runtimeconfig.json b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab3/Shapeifelse/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.AssemblyInfo.cs b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.AssemblyInfo.cs new file mode 100644 index 0000000..8ab39cc --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Shapeifelse")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("Shapeifelse")] +[assembly: System.Reflection.AssemblyTitleAttribute("Shapeifelse")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.AssemblyInfoInputs.cache b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.AssemblyInfoInputs.cache new file mode 100644 index 0000000..0a84681 --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +f64955ae5939592a7529395d0114018e1df9c13e2f49ca76230518be20a602a5 diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..0415af0 --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Shapeifelse +build_property.ProjectDir = /home/nik/oop/labs/lab3/Shapeifelse/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.GlobalUsings.g.cs b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.assets.cache b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.assets.cache new file mode 100644 index 0000000..990b023 Binary files /dev/null and b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.assets.cache differ diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.csproj.CoreCompileInputs.cache b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..d5afe7c --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +4ede08bcf34b7d14008e02eeca529db616dfbbfee8c4f19d1dbbae8490bb69b8 diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.csproj.FileListAbsolute.txt b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..bd0355b --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse +/home/nik/oop/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.deps.json +/home/nik/oop/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.runtimeconfig.json +/home/nik/oop/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.dll +/home/nik/oop/labs/lab3/Shapeifelse/bin/Debug/net9.0/Shapeifelse.pdb +/home/nik/oop/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.AssemblyInfo.cs +/home/nik/oop/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.dll +/home/nik/oop/labs/lab3/Shapeifelse/obj/Debug/net9.0/refint/Shapeifelse.dll +/home/nik/oop/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.pdb +/home/nik/oop/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.genruntimeconfig.cache +/home/nik/oop/labs/lab3/Shapeifelse/obj/Debug/net9.0/ref/Shapeifelse.dll diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.dll b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.dll new file mode 100644 index 0000000..b51860b Binary files /dev/null and b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.dll differ diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.genruntimeconfig.cache b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.genruntimeconfig.cache new file mode 100644 index 0000000..cf1a97e --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.genruntimeconfig.cache @@ -0,0 +1 @@ +ee1ee96e4e259916b44ef61c304411f463e1ddef9407f0cb8ba0bb7c8b8a03be diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.pdb b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.pdb new file mode 100644 index 0000000..0fd63e0 Binary files /dev/null and b/labs/lab3/Shapeifelse/obj/Debug/net9.0/Shapeifelse.pdb differ diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/apphost b/labs/lab3/Shapeifelse/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..10f579b Binary files /dev/null and b/labs/lab3/Shapeifelse/obj/Debug/net9.0/apphost differ diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/ref/Shapeifelse.dll b/labs/lab3/Shapeifelse/obj/Debug/net9.0/ref/Shapeifelse.dll new file mode 100644 index 0000000..8ab9230 Binary files /dev/null and b/labs/lab3/Shapeifelse/obj/Debug/net9.0/ref/Shapeifelse.dll differ diff --git a/labs/lab3/Shapeifelse/obj/Debug/net9.0/refint/Shapeifelse.dll b/labs/lab3/Shapeifelse/obj/Debug/net9.0/refint/Shapeifelse.dll new file mode 100644 index 0000000..8ab9230 Binary files /dev/null and b/labs/lab3/Shapeifelse/obj/Debug/net9.0/refint/Shapeifelse.dll differ diff --git a/labs/lab3/Shapeifelse/obj/Shapeifelse.csproj.nuget.dgspec.json b/labs/lab3/Shapeifelse/obj/Shapeifelse.csproj.nuget.dgspec.json new file mode 100644 index 0000000..27747e4 --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Shapeifelse.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab3/Shapeifelse/Shapeifelse.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab3/Shapeifelse/Shapeifelse.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Shapeifelse/Shapeifelse.csproj", + "projectName": "Shapeifelse", + "projectPath": "/home/nik/oop/labs/lab3/Shapeifelse/Shapeifelse.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Shapeifelse/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Shapeifelse/obj/Shapeifelse.csproj.nuget.g.props b/labs/lab3/Shapeifelse/obj/Shapeifelse.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Shapeifelse.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab3/Shapeifelse/obj/Shapeifelse.csproj.nuget.g.targets b/labs/lab3/Shapeifelse/obj/Shapeifelse.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/Shapeifelse.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab3/Shapeifelse/obj/project.assets.json b/labs/lab3/Shapeifelse/obj/project.assets.json new file mode 100644 index 0000000..fedbf11 --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Shapeifelse/Shapeifelse.csproj", + "projectName": "Shapeifelse", + "projectPath": "/home/nik/oop/labs/lab3/Shapeifelse/Shapeifelse.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Shapeifelse/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Shapeifelse/obj/project.nuget.cache b/labs/lab3/Shapeifelse/obj/project.nuget.cache new file mode 100644 index 0000000..0022b10 --- /dev/null +++ b/labs/lab3/Shapeifelse/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "nHYhD1IduO8=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab3/Shapeifelse/Shapeifelse.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab3/Shooting/Program.cs b/labs/lab3/Shooting/Program.cs new file mode 100644 index 0000000..c299ba7 --- /dev/null +++ b/labs/lab3/Shooting/Program.cs @@ -0,0 +1,81 @@ +using System; + +class Program +{ + static int VariantFromStudentNumber(int n) => (n % 2 != 0) ? 1 : 2; + + static int ScoreVariant1(double x, double y) + { + var r = Math.Sqrt(x * x + y * y); + if (r <= 1) return 10; + if (r <= 2) return 5; + if (r <= 3) return 2; + return 0; + } + + static int Sector(double x, double y) + { + var a = Math.Atan2(y, x); + if (a > Math.PI / 4 && a <= 3 * Math.PI / 4) return 1; + if (a > -Math.PI / 4 && a <= Math.PI / 4) return 5; + if (a > -3 * Math.PI / 4 && a <= -Math.PI / 4) return 2; + return 3; + } + + static int ScoreVariant2(double x, double y) + { + var r = Math.Sqrt(x * x + y * y); + if (r <= 1) return 10; + if (r <= 3) return Sector(x, y); + return 0; + } + + static void Main() + { + Console.Write("Номер по списку: "); + int student = int.Parse(Console.ReadLine()); + int variant = VariantFromStudentNumber(student); + + Console.Write("Сколько выстрелов: "); + int n = int.Parse(Console.ReadLine()); + + Console.Write("Случайный центр? (y/n): "); + bool rndCenter = Console.ReadLine().Trim().ToLower() == "y"; + + Console.Write("Случайная помеха? (y/n): "); + bool noise = Console.ReadLine().Trim().ToLower() == "y"; + + var rnd = new Random(); + double cx = 0, cy = 0; + if (rndCenter) + { + cx = rnd.NextDouble() * 2 - 1; + cy = rnd.NextDouble() * 2 - 1; + } + + int sum = 0; + for (int i = 0; i < n; i++) + { + Console.Write($"Выстрел {i + 1} (x y): "); + var parts = Console.ReadLine().Trim().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); + double x = double.Parse(parts[0]); + double y = double.Parse(parts[1]); + + if (noise) + { + x += (rnd.NextDouble() * 0.2 - 0.1); + y += (rnd.NextDouble() * 0.2 - 0.1); + } + + x -= cx; + y -= cy; + + int s = variant == 1 ? ScoreVariant1(x, y) : ScoreVariant2(x, y); + sum += s; + Console.WriteLine($"Очки: {s}, сумма: {sum}"); + } + + Console.WriteLine($"Итоговая сумма: {sum}"); + } +} + diff --git a/labs/lab3/Shooting/Shooting.csproj b/labs/lab3/Shooting/Shooting.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab3/Shooting/Shooting.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab3/Shooting/bin/Debug/net9.0/Shooting b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting new file mode 100755 index 0000000..daa0a60 Binary files /dev/null and b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting differ diff --git a/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.deps.json b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.deps.json new file mode 100644 index 0000000..2efa1ac --- /dev/null +++ b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Shooting/1.0.0": { + "runtime": { + "Shooting.dll": {} + } + } + } + }, + "libraries": { + "Shooting/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.dll b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.dll new file mode 100644 index 0000000..8d2d5ef Binary files /dev/null and b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.dll differ diff --git a/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.pdb b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.pdb new file mode 100644 index 0000000..92ddda3 Binary files /dev/null and b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.pdb differ diff --git a/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.runtimeconfig.json b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab3/Shooting/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab3/Shooting/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.AssemblyInfo.cs b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.AssemblyInfo.cs new file mode 100644 index 0000000..d494075 --- /dev/null +++ b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Shooting")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("Shooting")] +[assembly: System.Reflection.AssemblyTitleAttribute("Shooting")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.AssemblyInfoInputs.cache b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.AssemblyInfoInputs.cache new file mode 100644 index 0000000..7aabe72 --- /dev/null +++ b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +079bf14f3b2824897280441d17e72a5dca1231939654bf4c76c42830a9d33c55 diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..0d8dc17 --- /dev/null +++ b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Shooting +build_property.ProjectDir = /home/nik/oop/labs/lab3/Shooting/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.GlobalUsings.g.cs b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.assets.cache b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.assets.cache new file mode 100644 index 0000000..a6f3ba9 Binary files /dev/null and b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.assets.cache differ diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.csproj.CoreCompileInputs.cache b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..999b4b5 --- /dev/null +++ b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +1f058371143e7a656a4e91083a01ae42a1518a348edd2f420f7d145069e5cc8e diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.csproj.FileListAbsolute.txt b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..f1af59a --- /dev/null +++ b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab3/Shooting/bin/Debug/net9.0/Shooting +/home/nik/oop/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.deps.json +/home/nik/oop/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.runtimeconfig.json +/home/nik/oop/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.dll +/home/nik/oop/labs/lab3/Shooting/bin/Debug/net9.0/Shooting.pdb +/home/nik/oop/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.AssemblyInfo.cs +/home/nik/oop/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.dll +/home/nik/oop/labs/lab3/Shooting/obj/Debug/net9.0/refint/Shooting.dll +/home/nik/oop/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.pdb +/home/nik/oop/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.genruntimeconfig.cache +/home/nik/oop/labs/lab3/Shooting/obj/Debug/net9.0/ref/Shooting.dll diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.dll b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.dll new file mode 100644 index 0000000..8d2d5ef Binary files /dev/null and b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.dll differ diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.genruntimeconfig.cache b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.genruntimeconfig.cache new file mode 100644 index 0000000..fdc43b7 --- /dev/null +++ b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.genruntimeconfig.cache @@ -0,0 +1 @@ +0c4df3c05762219e4c1640c530fa82db089504fe3599a3b04c6d6d7b86c2589e diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.pdb b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.pdb new file mode 100644 index 0000000..92ddda3 Binary files /dev/null and b/labs/lab3/Shooting/obj/Debug/net9.0/Shooting.pdb differ diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/apphost b/labs/lab3/Shooting/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..daa0a60 Binary files /dev/null and b/labs/lab3/Shooting/obj/Debug/net9.0/apphost differ diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/ref/Shooting.dll b/labs/lab3/Shooting/obj/Debug/net9.0/ref/Shooting.dll new file mode 100644 index 0000000..58be6d8 Binary files /dev/null and b/labs/lab3/Shooting/obj/Debug/net9.0/ref/Shooting.dll differ diff --git a/labs/lab3/Shooting/obj/Debug/net9.0/refint/Shooting.dll b/labs/lab3/Shooting/obj/Debug/net9.0/refint/Shooting.dll new file mode 100644 index 0000000..58be6d8 Binary files /dev/null and b/labs/lab3/Shooting/obj/Debug/net9.0/refint/Shooting.dll differ diff --git a/labs/lab3/Shooting/obj/Shooting.csproj.nuget.dgspec.json b/labs/lab3/Shooting/obj/Shooting.csproj.nuget.dgspec.json new file mode 100644 index 0000000..fac2b32 --- /dev/null +++ b/labs/lab3/Shooting/obj/Shooting.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab3/Shooting/Shooting.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab3/Shooting/Shooting.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Shooting/Shooting.csproj", + "projectName": "Shooting", + "projectPath": "/home/nik/oop/labs/lab3/Shooting/Shooting.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Shooting/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Shooting/obj/Shooting.csproj.nuget.g.props b/labs/lab3/Shooting/obj/Shooting.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab3/Shooting/obj/Shooting.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab3/Shooting/obj/Shooting.csproj.nuget.g.targets b/labs/lab3/Shooting/obj/Shooting.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab3/Shooting/obj/Shooting.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab3/Shooting/obj/project.assets.json b/labs/lab3/Shooting/obj/project.assets.json new file mode 100644 index 0000000..e6d0947 --- /dev/null +++ b/labs/lab3/Shooting/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Shooting/Shooting.csproj", + "projectName": "Shooting", + "projectPath": "/home/nik/oop/labs/lab3/Shooting/Shooting.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Shooting/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Shooting/obj/project.nuget.cache b/labs/lab3/Shooting/obj/project.nuget.cache new file mode 100644 index 0000000..d0eed30 --- /dev/null +++ b/labs/lab3/Shooting/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "hu2JUhn5aQk=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab3/Shooting/Shooting.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab3/Sin/Program.cs b/labs/lab3/Sin/Program.cs new file mode 100644 index 0000000..d787d9f --- /dev/null +++ b/labs/lab3/Sin/Program.cs @@ -0,0 +1,27 @@ +using System; + +public class Program +{ + static void Main(string[] args) + { + double x, x1, x2, y; + + Console.WriteLine("input x1:"); + x1 = double.Parse(Console.ReadLine()); + Console.WriteLine("input x2:"); + x2 = double.Parse(Console.ReadLine()); + + Console.WriteLine("x\t\t sin(x)"); + Console.WriteLine("--------------------------"); + + x = x1; + do + { + y = Math.Sin(x); + Console.WriteLine($"{x:F2}\t {y:F6}"); + x = x + 0.01; + } + while (x <= x2); + } +} + diff --git a/labs/lab3/Sin/Sin.csproj b/labs/lab3/Sin/Sin.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab3/Sin/Sin.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab3/Sin/bin/Debug/net9.0/Sin b/labs/lab3/Sin/bin/Debug/net9.0/Sin new file mode 100755 index 0000000..5fc8d1f Binary files /dev/null and b/labs/lab3/Sin/bin/Debug/net9.0/Sin differ diff --git a/labs/lab3/Sin/bin/Debug/net9.0/Sin.deps.json b/labs/lab3/Sin/bin/Debug/net9.0/Sin.deps.json new file mode 100644 index 0000000..55095ff --- /dev/null +++ b/labs/lab3/Sin/bin/Debug/net9.0/Sin.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Sin/1.0.0": { + "runtime": { + "Sin.dll": {} + } + } + } + }, + "libraries": { + "Sin/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab3/Sin/bin/Debug/net9.0/Sin.dll b/labs/lab3/Sin/bin/Debug/net9.0/Sin.dll new file mode 100644 index 0000000..ba01237 Binary files /dev/null and b/labs/lab3/Sin/bin/Debug/net9.0/Sin.dll differ diff --git a/labs/lab3/Sin/bin/Debug/net9.0/Sin.pdb b/labs/lab3/Sin/bin/Debug/net9.0/Sin.pdb new file mode 100644 index 0000000..663d775 Binary files /dev/null and b/labs/lab3/Sin/bin/Debug/net9.0/Sin.pdb differ diff --git a/labs/lab3/Sin/bin/Debug/net9.0/Sin.runtimeconfig.json b/labs/lab3/Sin/bin/Debug/net9.0/Sin.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab3/Sin/bin/Debug/net9.0/Sin.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab3/Sin/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab3/Sin/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab3/Sin/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.AssemblyInfo.cs b/labs/lab3/Sin/obj/Debug/net9.0/Sin.AssemblyInfo.cs new file mode 100644 index 0000000..77480d9 --- /dev/null +++ b/labs/lab3/Sin/obj/Debug/net9.0/Sin.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Sin")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("Sin")] +[assembly: System.Reflection.AssemblyTitleAttribute("Sin")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.AssemblyInfoInputs.cache b/labs/lab3/Sin/obj/Debug/net9.0/Sin.AssemblyInfoInputs.cache new file mode 100644 index 0000000..f9ca43c --- /dev/null +++ b/labs/lab3/Sin/obj/Debug/net9.0/Sin.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +8041214acb2216cdfa9a9c10a250361965b385656095e3aae4216a7d8c27db7a diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab3/Sin/obj/Debug/net9.0/Sin.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..f7578b9 --- /dev/null +++ b/labs/lab3/Sin/obj/Debug/net9.0/Sin.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Sin +build_property.ProjectDir = /home/nik/oop/labs/lab3/Sin/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.GlobalUsings.g.cs b/labs/lab3/Sin/obj/Debug/net9.0/Sin.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab3/Sin/obj/Debug/net9.0/Sin.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.assets.cache b/labs/lab3/Sin/obj/Debug/net9.0/Sin.assets.cache new file mode 100644 index 0000000..408baa7 Binary files /dev/null and b/labs/lab3/Sin/obj/Debug/net9.0/Sin.assets.cache differ diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.csproj.CoreCompileInputs.cache b/labs/lab3/Sin/obj/Debug/net9.0/Sin.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..433b4f5 --- /dev/null +++ b/labs/lab3/Sin/obj/Debug/net9.0/Sin.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +2301e90df57fd2540b2233c88ef46fdc7e853c76be8a4d384b1ecaf22b71a558 diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.csproj.FileListAbsolute.txt b/labs/lab3/Sin/obj/Debug/net9.0/Sin.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..66768e7 --- /dev/null +++ b/labs/lab3/Sin/obj/Debug/net9.0/Sin.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab3/Sin/obj/Debug/net9.0/Sin.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab3/Sin/obj/Debug/net9.0/Sin.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab3/Sin/obj/Debug/net9.0/Sin.AssemblyInfo.cs +/home/nik/oop/labs/lab3/Sin/obj/Debug/net9.0/Sin.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab3/Sin/bin/Debug/net9.0/Sin +/home/nik/oop/labs/lab3/Sin/bin/Debug/net9.0/Sin.deps.json +/home/nik/oop/labs/lab3/Sin/bin/Debug/net9.0/Sin.runtimeconfig.json +/home/nik/oop/labs/lab3/Sin/bin/Debug/net9.0/Sin.dll +/home/nik/oop/labs/lab3/Sin/bin/Debug/net9.0/Sin.pdb +/home/nik/oop/labs/lab3/Sin/obj/Debug/net9.0/Sin.dll +/home/nik/oop/labs/lab3/Sin/obj/Debug/net9.0/refint/Sin.dll +/home/nik/oop/labs/lab3/Sin/obj/Debug/net9.0/Sin.pdb +/home/nik/oop/labs/lab3/Sin/obj/Debug/net9.0/Sin.genruntimeconfig.cache +/home/nik/oop/labs/lab3/Sin/obj/Debug/net9.0/ref/Sin.dll diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.dll b/labs/lab3/Sin/obj/Debug/net9.0/Sin.dll new file mode 100644 index 0000000..ba01237 Binary files /dev/null and b/labs/lab3/Sin/obj/Debug/net9.0/Sin.dll differ diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.genruntimeconfig.cache b/labs/lab3/Sin/obj/Debug/net9.0/Sin.genruntimeconfig.cache new file mode 100644 index 0000000..896ced7 --- /dev/null +++ b/labs/lab3/Sin/obj/Debug/net9.0/Sin.genruntimeconfig.cache @@ -0,0 +1 @@ +efb38499e77a4b7a54db07c352c70795921887de91f29f1429fdf2245490cfcf diff --git a/labs/lab3/Sin/obj/Debug/net9.0/Sin.pdb b/labs/lab3/Sin/obj/Debug/net9.0/Sin.pdb new file mode 100644 index 0000000..663d775 Binary files /dev/null and b/labs/lab3/Sin/obj/Debug/net9.0/Sin.pdb differ diff --git a/labs/lab3/Sin/obj/Debug/net9.0/apphost b/labs/lab3/Sin/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..5fc8d1f Binary files /dev/null and b/labs/lab3/Sin/obj/Debug/net9.0/apphost differ diff --git a/labs/lab3/Sin/obj/Debug/net9.0/ref/Sin.dll b/labs/lab3/Sin/obj/Debug/net9.0/ref/Sin.dll new file mode 100644 index 0000000..795bcd9 Binary files /dev/null and b/labs/lab3/Sin/obj/Debug/net9.0/ref/Sin.dll differ diff --git a/labs/lab3/Sin/obj/Debug/net9.0/refint/Sin.dll b/labs/lab3/Sin/obj/Debug/net9.0/refint/Sin.dll new file mode 100644 index 0000000..795bcd9 Binary files /dev/null and b/labs/lab3/Sin/obj/Debug/net9.0/refint/Sin.dll differ diff --git a/labs/lab3/Sin/obj/Sin.csproj.nuget.dgspec.json b/labs/lab3/Sin/obj/Sin.csproj.nuget.dgspec.json new file mode 100644 index 0000000..30b999c --- /dev/null +++ b/labs/lab3/Sin/obj/Sin.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab3/Sin/Sin.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab3/Sin/Sin.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Sin/Sin.csproj", + "projectName": "Sin", + "projectPath": "/home/nik/oop/labs/lab3/Sin/Sin.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Sin/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Sin/obj/Sin.csproj.nuget.g.props b/labs/lab3/Sin/obj/Sin.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab3/Sin/obj/Sin.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab3/Sin/obj/Sin.csproj.nuget.g.targets b/labs/lab3/Sin/obj/Sin.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab3/Sin/obj/Sin.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab3/Sin/obj/project.assets.json b/labs/lab3/Sin/obj/project.assets.json new file mode 100644 index 0000000..567cc31 --- /dev/null +++ b/labs/lab3/Sin/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Sin/Sin.csproj", + "projectName": "Sin", + "projectPath": "/home/nik/oop/labs/lab3/Sin/Sin.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Sin/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Sin/obj/project.nuget.cache b/labs/lab3/Sin/obj/project.nuget.cache new file mode 100644 index 0000000..113068c --- /dev/null +++ b/labs/lab3/Sin/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "QPYsKsvKnhI=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab3/Sin/Sin.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab3/Sum/Program.cs b/labs/lab3/Sum/Program.cs new file mode 100644 index 0000000..9c0e021 --- /dev/null +++ b/labs/lab3/Sum/Program.cs @@ -0,0 +1,22 @@ +using System; + +class Program +{ + static void Main() + { + Console.Write("Введите k: "); + int k = int.Parse(Console.ReadLine()); + Console.Write("Введите m: "); + int m = int.Parse(Console.ReadLine()); + + int s = 0; + for (int i = 1; i <= 100; i++) + { + if (i > k && i < m) continue; + s += i; + } + + Console.WriteLine("Сумма = " + s); + } +} + diff --git a/labs/lab3/Sum/Sum.csproj b/labs/lab3/Sum/Sum.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab3/Sum/Sum.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab3/Sum/bin/Debug/net9.0/Sum b/labs/lab3/Sum/bin/Debug/net9.0/Sum new file mode 100755 index 0000000..7c4da0f Binary files /dev/null and b/labs/lab3/Sum/bin/Debug/net9.0/Sum differ diff --git a/labs/lab3/Sum/bin/Debug/net9.0/Sum.deps.json b/labs/lab3/Sum/bin/Debug/net9.0/Sum.deps.json new file mode 100644 index 0000000..9500236 --- /dev/null +++ b/labs/lab3/Sum/bin/Debug/net9.0/Sum.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Sum/1.0.0": { + "runtime": { + "Sum.dll": {} + } + } + } + }, + "libraries": { + "Sum/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab3/Sum/bin/Debug/net9.0/Sum.dll b/labs/lab3/Sum/bin/Debug/net9.0/Sum.dll new file mode 100644 index 0000000..b25bce5 Binary files /dev/null and b/labs/lab3/Sum/bin/Debug/net9.0/Sum.dll differ diff --git a/labs/lab3/Sum/bin/Debug/net9.0/Sum.pdb b/labs/lab3/Sum/bin/Debug/net9.0/Sum.pdb new file mode 100644 index 0000000..3f5da8d Binary files /dev/null and b/labs/lab3/Sum/bin/Debug/net9.0/Sum.pdb differ diff --git a/labs/lab3/Sum/bin/Debug/net9.0/Sum.runtimeconfig.json b/labs/lab3/Sum/bin/Debug/net9.0/Sum.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab3/Sum/bin/Debug/net9.0/Sum.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab3/Sum/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab3/Sum/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab3/Sum/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.AssemblyInfo.cs b/labs/lab3/Sum/obj/Debug/net9.0/Sum.AssemblyInfo.cs new file mode 100644 index 0000000..7ac6095 --- /dev/null +++ b/labs/lab3/Sum/obj/Debug/net9.0/Sum.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Sum")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36606926b9d67f78c473de632eed3cf6c4ed12c7")] +[assembly: System.Reflection.AssemblyProductAttribute("Sum")] +[assembly: System.Reflection.AssemblyTitleAttribute("Sum")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.AssemblyInfoInputs.cache b/labs/lab3/Sum/obj/Debug/net9.0/Sum.AssemblyInfoInputs.cache new file mode 100644 index 0000000..57ae557 --- /dev/null +++ b/labs/lab3/Sum/obj/Debug/net9.0/Sum.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +0236af8bd544b7260772b16928bfd8b1904c2e0c983f3e3cf2a819fbabe24197 diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab3/Sum/obj/Debug/net9.0/Sum.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..6e21d68 --- /dev/null +++ b/labs/lab3/Sum/obj/Debug/net9.0/Sum.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Sum +build_property.ProjectDir = /home/nik/oop/labs/lab3/Sum/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.GlobalUsings.g.cs b/labs/lab3/Sum/obj/Debug/net9.0/Sum.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab3/Sum/obj/Debug/net9.0/Sum.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.assets.cache b/labs/lab3/Sum/obj/Debug/net9.0/Sum.assets.cache new file mode 100644 index 0000000..c4fd2dd Binary files /dev/null and b/labs/lab3/Sum/obj/Debug/net9.0/Sum.assets.cache differ diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.csproj.CoreCompileInputs.cache b/labs/lab3/Sum/obj/Debug/net9.0/Sum.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..3647d60 --- /dev/null +++ b/labs/lab3/Sum/obj/Debug/net9.0/Sum.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +f739db5c9dbe2b0c3199ca7e7148f15c63e94deb149db43a7aef1c287f4e3b97 diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.csproj.FileListAbsolute.txt b/labs/lab3/Sum/obj/Debug/net9.0/Sum.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..70cc0c7 --- /dev/null +++ b/labs/lab3/Sum/obj/Debug/net9.0/Sum.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab3/Sum/bin/Debug/net9.0/Sum +/home/nik/oop/labs/lab3/Sum/bin/Debug/net9.0/Sum.deps.json +/home/nik/oop/labs/lab3/Sum/bin/Debug/net9.0/Sum.runtimeconfig.json +/home/nik/oop/labs/lab3/Sum/bin/Debug/net9.0/Sum.dll +/home/nik/oop/labs/lab3/Sum/bin/Debug/net9.0/Sum.pdb +/home/nik/oop/labs/lab3/Sum/obj/Debug/net9.0/Sum.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab3/Sum/obj/Debug/net9.0/Sum.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab3/Sum/obj/Debug/net9.0/Sum.AssemblyInfo.cs +/home/nik/oop/labs/lab3/Sum/obj/Debug/net9.0/Sum.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab3/Sum/obj/Debug/net9.0/Sum.dll +/home/nik/oop/labs/lab3/Sum/obj/Debug/net9.0/refint/Sum.dll +/home/nik/oop/labs/lab3/Sum/obj/Debug/net9.0/Sum.pdb +/home/nik/oop/labs/lab3/Sum/obj/Debug/net9.0/Sum.genruntimeconfig.cache +/home/nik/oop/labs/lab3/Sum/obj/Debug/net9.0/ref/Sum.dll diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.dll b/labs/lab3/Sum/obj/Debug/net9.0/Sum.dll new file mode 100644 index 0000000..b25bce5 Binary files /dev/null and b/labs/lab3/Sum/obj/Debug/net9.0/Sum.dll differ diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.genruntimeconfig.cache b/labs/lab3/Sum/obj/Debug/net9.0/Sum.genruntimeconfig.cache new file mode 100644 index 0000000..e56ff8f --- /dev/null +++ b/labs/lab3/Sum/obj/Debug/net9.0/Sum.genruntimeconfig.cache @@ -0,0 +1 @@ +b8637bef9e6f4480c6e6aa0cb68d9bf92ed6af94760ef46d717b845cca124892 diff --git a/labs/lab3/Sum/obj/Debug/net9.0/Sum.pdb b/labs/lab3/Sum/obj/Debug/net9.0/Sum.pdb new file mode 100644 index 0000000..3f5da8d Binary files /dev/null and b/labs/lab3/Sum/obj/Debug/net9.0/Sum.pdb differ diff --git a/labs/lab3/Sum/obj/Debug/net9.0/apphost b/labs/lab3/Sum/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..7c4da0f Binary files /dev/null and b/labs/lab3/Sum/obj/Debug/net9.0/apphost differ diff --git a/labs/lab3/Sum/obj/Debug/net9.0/ref/Sum.dll b/labs/lab3/Sum/obj/Debug/net9.0/ref/Sum.dll new file mode 100644 index 0000000..153118e Binary files /dev/null and b/labs/lab3/Sum/obj/Debug/net9.0/ref/Sum.dll differ diff --git a/labs/lab3/Sum/obj/Debug/net9.0/refint/Sum.dll b/labs/lab3/Sum/obj/Debug/net9.0/refint/Sum.dll new file mode 100644 index 0000000..153118e Binary files /dev/null and b/labs/lab3/Sum/obj/Debug/net9.0/refint/Sum.dll differ diff --git a/labs/lab3/Sum/obj/Sum.csproj.nuget.dgspec.json b/labs/lab3/Sum/obj/Sum.csproj.nuget.dgspec.json new file mode 100644 index 0000000..4d9e34e --- /dev/null +++ b/labs/lab3/Sum/obj/Sum.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab3/Sum/Sum.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab3/Sum/Sum.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Sum/Sum.csproj", + "projectName": "Sum", + "projectPath": "/home/nik/oop/labs/lab3/Sum/Sum.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Sum/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Sum/obj/Sum.csproj.nuget.g.props b/labs/lab3/Sum/obj/Sum.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab3/Sum/obj/Sum.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab3/Sum/obj/Sum.csproj.nuget.g.targets b/labs/lab3/Sum/obj/Sum.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab3/Sum/obj/Sum.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab3/Sum/obj/project.assets.json b/labs/lab3/Sum/obj/project.assets.json new file mode 100644 index 0000000..c1949f6 --- /dev/null +++ b/labs/lab3/Sum/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab3/Sum/Sum.csproj", + "projectName": "Sum", + "projectPath": "/home/nik/oop/labs/lab3/Sum/Sum.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab3/Sum/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab3/Sum/obj/project.nuget.cache b/labs/lab3/Sum/obj/project.nuget.cache new file mode 100644 index 0000000..bf1bed0 --- /dev/null +++ b/labs/lab3/Sum/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "yMEo251zo5U=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab3/Sum/Sum.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab3/assets/1.png b/labs/lab3/assets/1.png new file mode 100644 index 0000000..a4fb3a8 Binary files /dev/null and b/labs/lab3/assets/1.png differ diff --git a/labs/lab3/assets/10.png b/labs/lab3/assets/10.png new file mode 100644 index 0000000..d23fed2 Binary files /dev/null and b/labs/lab3/assets/10.png differ diff --git a/labs/lab3/assets/11.png b/labs/lab3/assets/11.png new file mode 100644 index 0000000..b57caf9 Binary files /dev/null and b/labs/lab3/assets/11.png differ diff --git a/labs/lab3/assets/12.png b/labs/lab3/assets/12.png new file mode 100644 index 0000000..438637a Binary files /dev/null and b/labs/lab3/assets/12.png differ diff --git a/labs/lab3/assets/13.png b/labs/lab3/assets/13.png new file mode 100644 index 0000000..5c33543 Binary files /dev/null and b/labs/lab3/assets/13.png differ diff --git a/labs/lab3/assets/14.png b/labs/lab3/assets/14.png new file mode 100644 index 0000000..607cac2 Binary files /dev/null and b/labs/lab3/assets/14.png differ diff --git a/labs/lab3/assets/2.png b/labs/lab3/assets/2.png new file mode 100644 index 0000000..89c4718 Binary files /dev/null and b/labs/lab3/assets/2.png differ diff --git a/labs/lab3/assets/3.png b/labs/lab3/assets/3.png new file mode 100644 index 0000000..39e57b7 Binary files /dev/null and b/labs/lab3/assets/3.png differ diff --git a/labs/lab3/assets/4.png b/labs/lab3/assets/4.png new file mode 100644 index 0000000..8365d35 Binary files /dev/null and b/labs/lab3/assets/4.png differ diff --git a/labs/lab3/assets/5.png b/labs/lab3/assets/5.png new file mode 100644 index 0000000..48d725b Binary files /dev/null and b/labs/lab3/assets/5.png differ diff --git a/labs/lab3/assets/6.png b/labs/lab3/assets/6.png new file mode 100644 index 0000000..849be7b Binary files /dev/null and b/labs/lab3/assets/6.png differ diff --git a/labs/lab3/assets/7.png b/labs/lab3/assets/7.png new file mode 100644 index 0000000..eb12f22 Binary files /dev/null and b/labs/lab3/assets/7.png differ diff --git a/labs/lab3/assets/8.png b/labs/lab3/assets/8.png new file mode 100644 index 0000000..ba009a5 Binary files /dev/null and b/labs/lab3/assets/8.png differ diff --git a/labs/lab3/assets/9.png b/labs/lab3/assets/9.png new file mode 100644 index 0000000..a5a982a Binary files /dev/null and b/labs/lab3/assets/9.png differ diff --git a/labs/lab3/report.pdf b/labs/lab3/report.pdf new file mode 100644 index 0000000..230321d Binary files /dev/null and b/labs/lab3/report.pdf differ diff --git a/labs/lab3/report.typ b/labs/lab3/report.typ new file mode 100644 index 0000000..7b20ccf --- /dev/null +++ b/labs/lab3/report.typ @@ -0,0 +1,549 @@ +#set text(size: 1.3em) + +#show raw.where(block: false): box.with( + fill: luma(240), + inset: (x: 3pt, y: 0pt), + outset: (y: 3pt), + radius: 2pt, +) + +#show raw.where(block: true): block.with( + fill: luma(240), + inset: 10pt, + radius: 4pt, +) + +// title + +#align(center)[Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики] +\ +\ +\ +#align(center)[Факультет инфокоммуникационных технологий] +#align(center)[Направление подготовки 11.03.02] +\ +\ +#align(center)[Лабораторная работа №3] +#align(center)[Использование выражений] +\ +\ +\ //#align(center)[Вариант 19] +\ +\ +\ +\ +\ +\ +\ +#align(right)[Выполнил:] +#align(right)[Дощенников Никита Андреевич] +#align(right)[Группа: К3221] +#align(right)[Проверил:] +#align(right)[Иванов Сергей Евгеньевич] +\ +\ +#align(center)[Санкт-Петербург] +#align(center)[2025] + +#pagebreak() + +=== Цель работы: + +Изучить и приобрести навыки использования управляющих конструкций для организации вычислений. + +=== Упражнение 1. Реализация операторов выбора. + +==== Задание 1. Применение конструкции if-else-if. + +В этом задании я составил программу, которая выдает одно из сообщений "внутри", "вне" или "на границе" в зависимости от положения точки относительно заштрихованной области на графике, представленном на рисунке. + +#align(center)[#image("assets/1.png")] + +```cs +using System; + +public class Program +{ + static void Main(string[] args) + { + Console.Write("x = "); + float x = float.Parse(Console.ReadLine()); + + Console.Write("y = "); + float y = float.Parse(Console.ReadLine()); + + if (x * x + y * y < 9 && y > 0) + { + Console.WriteLine("внутри"); + } + else if (x * x + y * y > 9 || y < 0) + { + Console.WriteLine("вне"); + } + else + { + Console.WriteLine("на границе"); + } + + } +} +``` + +Пример работы: + +#align(center)[#image("assets/2.png")] +#align(center)[#image("assets/3.png")] +#align(center)[#image("assets/4.png")] + +==== Задание 2. Применение оператора switch. + +Я создал программу моделирующую работу калькулятора. Пользователем вводится первый операнд, требуемую операцию и второй операнд. Затем производится расчет результата. + +```cs +using System; + +public class Program +{ + static void Main(string[] args) + { + Console.Write("A = "); + double a = double.Parse(Console.ReadLine()); + Console.Write("OP = "); + char op = char.Parse(Console.ReadLine()); + Console.Write("B = "); + double b = double.Parse(Console.ReadLine()); + + + bool ok = true; + double res = 0; + + switch (op) + { + case '+': res = a + b; break; + case '-': res = a - b; break; + case '*': res = a * b; break; + case '/': + case ':': + res = a / b; break; + default: ok = false; break; + } + + if (ok) + { + Console.WriteLine("{0} {1} {2} = {3}", a, op, b, res); + } + else + { + Console.WriteLine("Операция не определена"); + } + } +} +``` + +Пример работы: + +1) c правильными значениями: + +#align(center)[#image("assets/5.png")] + +2) при делении на нуль: + +#align(center)[#image("assets/6.png")] + +Бесконечность, так как в стандарте IEEE-754 прописан такой результат. + +3) при делении нуль на нуль: + +#align(center)[#image("assets/7.png")] + +NaN, опять же в соответствии со стандартом. + +4) при неправильной операции: + +#align(center)[#image("assets/8.png")] + +Мы проваливаемся к значению по умолчанию. + +==== Задание 3. Определение високосного года. + +Программа, по введенному натуральному числу, определяет, является ли год с номером, равным этому числу, високосным. + +```cs +using System; + +public class Program +{ + public static void Main(string[] args) + { + Console.WriteLine("input a year: "); + int year = int.Parse(Console.ReadLine()); + + if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) + { + Console.WriteLine("YES"); + } + else + { + Console.WriteLine("NO"); + } + } +} +``` + +Пример работы: + +#align(center)[#image("assets/9.png")] +#align(center)[#image("assets/10.png")] + +=== Упражнение 2. Реализация циклов при работе с данными размерных типов. + +==== Задание 1. Использование операторов цикла while, do while и for. + +Я написал программу, которая выводит на экран последовательность целых нечетных чисел в строчку через пробел с помощью трех операторов цикла `while`, `do while` и `for`. + +```cs +using System; + +public class Program +{ + public static void Main(string[] args) + { + Console.Write("n = "); + int n = int.Parse(Console.ReadLine()); + + // while + Console.Write("\nwhile: \t\t"); + int i = 1; + while (i <= n) + { + Console.Write(" " + i); + i += 2; + } + + // do-while + Console.Write("\ndo while: \t"); + i = 1; + do + { + Console.Write(" " + i); + i += 2; + } + while (i <= n); + + // for: + Console.Write("\nfor: \t\t"); + for (i = 1; i<=n; i+=2) + { + Console.Write(" " + i); + } + } +} +``` + +Пример работы: + +#align(center)[#image("assets/11.png")] + +Была написана программа, которая печатает таблицу синусов и их аргументов с периодом 0.01 от `x1` до `x2`. + +```cs +using System; + +public class Program +{ + static void Main(string[] args) + { + double x, x1, x2, y; + + Console.WriteLine("input x1:"); + x1 = double.Parse(Console.ReadLine()); + Console.WriteLine("input x2:"); + x2 = double.Parse(Console.ReadLine()); + + Console.WriteLine("x\t\t sin(x)"); + Console.WriteLine("--------------------------"); + + x = x1; + do + { + y = Math.Sin(x); + Console.WriteLine($"{x:F2}\t {y:F6}"); + x = x + 0.01; + } + while (x <= x2); + } +} +``` + +Пример работы: + +#align(center)[#image("assets/12.png")] + +```cs +using System; +using System.Globalization; + +class Program +{ + static void FuncWhile() + { + var ci = CultureInfo.InvariantCulture; + double x1 = double.Parse(Console.ReadLine(), ci); + double x2 = double.Parse(Console.ReadLine(), ci); + double h = double.Parse(Console.ReadLine(), ci); + double x = x1; + while (x <= x2 + 1e-12) + { + double y = Math.Sin(x); + Console.WriteLine($"while: {x.ToString(ci)} {y.ToString(ci)}"); + x += h; + } + } + + static void FuncDoWhile() + { + var ci = CultureInfo.InvariantCulture; + double x1 = double.Parse(Console.ReadLine(), ci); + double x2 = double.Parse(Console.ReadLine(), ci); + double h = double.Parse(Console.ReadLine(), ci); + double x = x1; + if (h <= 0) return; + do + { + double y = Math.Sin(x); + Console.WriteLine($"do-while: {x.ToString(ci)} {y.ToString(ci)}"); + x += h; + } while (x - h < x2 + 1e-12); + } + + static int GcdWhile(int a, int b) + { + a = Math.Abs(a); + b = Math.Abs(b); + while (b != 0) + { + int temp = a % b; + a = b; + b = temp; + } + return a; + } + + static int GcdDoWhile(int a, int b) + { + a = Math.Abs(a); + b = Math.Abs(b); + int temp; + if (b == 0) return a; + do + { + temp = a % b; + a = b; + b = temp; + } while (b != 0); + return a; + } + + static void Main() + { + Console.WriteLine("=== Функция с while ==="); + FuncWhile(); + + Console.WriteLine("=== Функция с do-while ==="); + FuncDoWhile(); + + Console.WriteLine("Введите два числа для НОД (while):"); + int a = int.Parse(Console.ReadLine()); + int b = int.Parse(Console.ReadLine()); + Console.WriteLine($"НОД (while): {GcdWhile(a, b)}"); + + Console.WriteLine("Введите два числа для НОД (do-while):"); + a = int.Parse(Console.ReadLine()); + b = int.Parse(Console.ReadLine()); + Console.WriteLine($"НОД (do-while): {GcdDoWhile(a, b)}"); + } +} +``` + +- *while* подходит, когда важно проверять условие до входа в цикл (может выполниться 0 раз). + +- *do…while* удобен, когда тело должно выполниться минимум один раз. + +- Для функций на интервале *do…while* проще гарантирует вывод крайней точки. + +- Для алгоритма Евклида оба варианта дают одинаковый результат; *while* короче, *do…while* более наглядно выражает шаг алгоритма. + +==== Задание 2. Расчет суммы, используя операторы перехода. + +Составлена программа, которая реализует сумму + +$ +s = sum_(i = 1)^(100) i, +$ + +для $i$, находящихся от $1$ до $k$ и от $m$ до $100$. + +```cs +using System; + +class Program +{ + static void Main() + { + Console.Write("Введите k: "); + int k = int.Parse(Console.ReadLine()); + Console.Write("Введите m: "); + int m = int.Parse(Console.ReadLine()); + + int s = 0; + for (int i = 1; i <= 100; i++) + { + if (i > k && i < m) continue; + s += i; + } + + Console.WriteLine("Сумма = " + s); + } +} +``` + +Пример работы: + +#align(center)[#image("assets/13.png")] + +==== Задание 3. Стрельба по мишени. + +Разработа программа, имитирующая стрельбу по мишени. + +```cs +using System; + +class Program +{ + static int VariantFromStudentNumber(int n) => (n % 2 != 0) ? 1 : 2; + + static int ScoreVariant1(double x, double y) + { + var r = Math.Sqrt(x * x + y * y); + if (r <= 1) return 10; + if (r <= 2) return 5; + if (r <= 3) return 2; + return 0; + } + + static int Sector(double x, double y) + { + var a = Math.Atan2(y, x); + if (a > Math.PI / 4 && a <= 3 * Math.PI / 4) return 1; + if (a > -Math.PI / 4 && a <= Math.PI / 4) return 5; + if (a > -3 * Math.PI / 4 && a <= -Math.PI / 4) return 2; + return 3; + } + + static int ScoreVariant2(double x, double y) + { + var r = Math.Sqrt(x * x + y * y); + if (r <= 1) return 10; + if (r <= 3) return Sector(x, y); + return 0; + } + + static void Main() + { + Console.Write("Номер по списку: "); + int student = int.Parse(Console.ReadLine()); + int variant = VariantFromStudentNumber(student); + + Console.Write("Сколько выстрелов: "); + int n = int.Parse(Console.ReadLine()); + + Console.Write("Случайный центр? (y/n): "); + bool rndCenter = Console.ReadLine().Trim().ToLower() == "y"; + + Console.Write("Случайная помеха? (y/n): "); + bool noise = Console.ReadLine().Trim().ToLower() == "y"; + + var rnd = new Random(); + double cx = 0, cy = 0; + if (rndCenter) + { + cx = rnd.NextDouble() * 2 - 1; + cy = rnd.NextDouble() * 2 - 1; + } + + int sum = 0; + for (int i = 0; i < n; i++) + { + Console.Write($"Выстрел {i + 1} (x y): "); + var parts = Console.ReadLine().Trim().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); + double x = double.Parse(parts[0]); + double y = double.Parse(parts[1]); + + if (noise) + { + x += (rnd.NextDouble() * 0.2 - 0.1); + y += (rnd.NextDouble() * 0.2 - 0.1); + } + + x -= cx; + y -= cy; + + int s = variant == 1 ? ScoreVariant1(x, y) : ScoreVariant2(x, y); + sum += s; + Console.WriteLine($"Очки: {s}, сумма: {sum}"); + } + + Console.WriteLine($"Итоговая сумма: {sum}"); + } +} +``` + +Пример работы: + +#align(center)[#image("assets/14.png")] + +=== Code review. (by #link("https://zzzcode.ai")[zzzcode.ai]) + +*Резюме* + +Код выполняет несколько задач, включая определение положения точки относительно круга, выполнение арифметических операций, проверку високосного года, вывод чисел и вычисление НОД. Однако, в коде присутствуют некоторые недостатки, которые могут быть улучшены для повышения его качества и удобства использования. + +*Ошибка* + +В коде отсутствует обработка исключений при парсинге пользовательского ввода. Это может привести к сбоям программы, если пользователь введет некорректные данные. Рекомендуется использовать TryParse для безопасного парсинга. + +*Стиль кода* + +Стиль кода в целом соответствует стандартам C\#. Однако, в некоторых местах можно улучшить читаемость, добавив комментарии и более описательные имена переменных. Например, вместо `x1`, `x2` можно использовать `startX`, `endX`. + +*Структура кода* + +Код разбит на несколько классов, что хорошо для организации. Однако, каждый класс содержит метод `Main`, что не является хорошей практикой. Рекомендуется создать один класс с единственным методом `Main`, а остальные функции вынести в отдельные методы. + +`Читаемость` + +Читаемость кода можно улучшить, добавив комментарии, объясняющие логику выполнения. Также стоит использовать более понятные имена переменных и методов, чтобы другие разработчики могли быстрее понять, что делает код. + +`Производительность` + +Код выполняется достаточно быстро для небольших входных данных. Однако, в случае больших объемов данных, стоит рассмотреть возможность оптимизации, например, путем использования более эффективных алгоритмов. +Масштабируемость + +Код не очень масштабируем, так как он жестко привязан к конкретным задачам. Рекомендуется использовать более модульный подход, чтобы можно было легко добавлять новые функции без изменения существующего кода. + +`Безопасность` + +Безопасность кода можно улучшить, добавив обработку исключений и проверку входных данных. Это поможет избежать потенциальных уязвимостей, связанных с некорректным вводом. + +`Обработка ошибок` + +Обработка ошибок в коде отсутствует. Рекомендуется использовать конструкции `try-catch` для обработки возможных исключений, особенно при работе с пользовательским вводом и парсингом данных. + +*Заключение* + +В целом, код выполняет свои функции, но требует улучшений в области обработки ошибок, читаемости и структуры. Рекомендуется внести изменения, чтобы сделать код более безопасным, масштабируемым и удобным для чтения. + +=== Выводы. + +В ходе проделанной работы, я изучил и приобрел навыки использования управляющих конструкций для организации вычислений. + diff --git a/labs/lab4/Utils/Operation.cs b/labs/lab4/Utils/Operation.cs new file mode 100644 index 0000000..6c74420 --- /dev/null +++ b/labs/lab4/Utils/Operation.cs @@ -0,0 +1,53 @@ +using System; + +public class Operation +{ + public static double TriangleArea(double a, double b, double c) + { + double p = (a + b + c) / 2; + bool exists = CheckTriangle(a, b, c); + if (!exists) + return -1; + + return Math.Sqrt(p * (p - a) * (p - b) * (p - c)); + } + + public static double TriangleArea(double a) + { + return TriangleArea(a, a, a); + } + + + public static bool CheckTriangle(double a, double b, double c) + { + if (a <= 0 || b <= 0 || c <= 0) return false; + + double maxSide = Math.Max(Math.Max(a, b), Math.Max(b, c)); + + if (maxSide >= a + b + c - maxSide) return false; + + return true; + } + + public static int SolveQuadratic(int a, int b, int c, out double x1, out double x2) + { + double d = b * b - 4 * a * c; + if (d > 0) + { + x1 = (-b + Math.Sqrt(d)) / (2 * a); + x2 = (-b - Math.Sqrt(d)) / (2 * a); + return 1; + } + else if (d == 0) + { + x1 = x2 = -b / (2 * a); + return 0; + } + else + { + x1 = x2 = -1; + return -1; + } + } + +} diff --git a/labs/lab4/Utils/Program.cs b/labs/lab4/Utils/Program.cs new file mode 100644 index 0000000..9887b40 --- /dev/null +++ b/labs/lab4/Utils/Program.cs @@ -0,0 +1,86 @@ +using System; + +public class Program +{ + static void Main(string[] args) + { + int x, y; + + Console.WriteLine("Введите первое число: "); + x = int.Parse(Console.ReadLine()); + Console.WriteLine("Введите второе число: "); + y = int.Parse(Console.ReadLine()); + + int greater = Utils.Greater(x, y); + + Console.WriteLine("Большим из чисел {0} и {1} является {2} ", x, y, greater); + + Console.WriteLine("До swap: \t" + x + " " + y); + Utils.Swap(ref x, ref y); + Console.WriteLine("После swap: \t" + x + " " + y); + + int f; + bool ok; + + Console.WriteLine("Number for factorial:"); + x = int.Parse(Console.ReadLine()); + + ok = Utils.Factorial(x, out f); + + if (ok) + Console.WriteLine("Factorial(" + x + ") = " + f); + else + Console.WriteLine("Cannot compute this factorial"); + + Console.WriteLine("choose the type of the triangle. type 1 for equilateral else 2: "); + int triangleType = int.Parse(Console.ReadLine()); + + switch (triangleType) + { + + + case 1: + Console.WriteLine("input side length: "); + double a = double.Parse(Console.ReadLine()); + Console.WriteLine("area = {0}", Operation.TriangleArea(a)); + break; + case 2: + Console.WriteLine("input first side length: "); + double sideA = double.Parse(Console.ReadLine()); + Console.WriteLine("input second side length: "); + double sideB = double.Parse(Console.ReadLine()); + Console.WriteLine("input third side length: "); + double sideC = double.Parse(Console.ReadLine()); + Console.WriteLine("area = {0}", Operation.TriangleArea(sideA, sideB, sideC)); + break; + default: + Console.WriteLine("invalid triangle type"); + break; + } + + + Console.WriteLine("input coefficient a: "); + int coef_a = int.Parse(Console.ReadLine()); + Console.WriteLine("input coefficient b: "); + int coef_b = int.Parse(Console.ReadLine()); + Console.WriteLine("input coefficient c: "); + int coef_c = int.Parse(Console.ReadLine()); + + double x1, x2; + int res = Operation.SolveQuadratic(coef_a, coef_b, coef_c, out x1, out x2); + + if (res == 1) + { + Console.WriteLine("Корни уравнения с коэффициентами a = {0}, b = {1}, c = {2} равны x1 = {3}, x2 = {4}.", coef_a, coef_b, coef_c, x1, x2); + } + else if (res == 0) + { + Console.WriteLine("Корень уравнения с коэффициентами a = {0}, b = {1}, c = {2} равны один x1 = x2 = {0}", coef_a, coef_b, coef_c, x1); + } + else + { + Console.WriteLine("Корней уравнения с коэффициентами a = {0}, b = {1}, c = {2} нет.", coef_a, coef_b, coef_c); + } + + } +} diff --git a/labs/lab4/Utils/Utils.cs b/labs/lab4/Utils/Utils.cs new file mode 100644 index 0000000..611e7bc --- /dev/null +++ b/labs/lab4/Utils/Utils.cs @@ -0,0 +1,44 @@ +class Utils +{ + public static int Greater(int a, int b) + { + if (a > b) + return a; + else + return b; + } + + public static void Swap(ref int a, ref int b) + { + int temp = a; + a = b; + b = temp; + } + + public static bool Factorial(int n, out int answer) + { + int k; + int f = 1; + bool ok = true; + + try + { + checked + { + for (k = 2; k <= n; ++k) + { + f = f * k; + } + } + } + catch (Exception) + { + f = 0; + ok = false; + } + + answer = f; + return ok; + } + +} diff --git a/labs/lab4/Utils/Utils.csproj b/labs/lab4/Utils/Utils.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab4/Utils/Utils.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab4/Utils/bin/Debug/net9.0/Utils b/labs/lab4/Utils/bin/Debug/net9.0/Utils new file mode 100755 index 0000000..e60fa7b Binary files /dev/null and b/labs/lab4/Utils/bin/Debug/net9.0/Utils differ diff --git a/labs/lab4/Utils/bin/Debug/net9.0/Utils.deps.json b/labs/lab4/Utils/bin/Debug/net9.0/Utils.deps.json new file mode 100644 index 0000000..f340108 --- /dev/null +++ b/labs/lab4/Utils/bin/Debug/net9.0/Utils.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Utils/1.0.0": { + "runtime": { + "Utils.dll": {} + } + } + } + }, + "libraries": { + "Utils/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab4/Utils/bin/Debug/net9.0/Utils.dll b/labs/lab4/Utils/bin/Debug/net9.0/Utils.dll new file mode 100644 index 0000000..6bf1bba Binary files /dev/null and b/labs/lab4/Utils/bin/Debug/net9.0/Utils.dll differ diff --git a/labs/lab4/Utils/bin/Debug/net9.0/Utils.pdb b/labs/lab4/Utils/bin/Debug/net9.0/Utils.pdb new file mode 100644 index 0000000..a4e1836 Binary files /dev/null and b/labs/lab4/Utils/bin/Debug/net9.0/Utils.pdb differ diff --git a/labs/lab4/Utils/bin/Debug/net9.0/Utils.runtimeconfig.json b/labs/lab4/Utils/bin/Debug/net9.0/Utils.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab4/Utils/bin/Debug/net9.0/Utils.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab4/Utils/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab4/Utils/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab4/Utils/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.AssemblyInfo.cs b/labs/lab4/Utils/obj/Debug/net9.0/Utils.AssemblyInfo.cs new file mode 100644 index 0000000..deaac21 --- /dev/null +++ b/labs/lab4/Utils/obj/Debug/net9.0/Utils.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Utils")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3a99124ecb2908fafc9602658ef92948c0982366")] +[assembly: System.Reflection.AssemblyProductAttribute("Utils")] +[assembly: System.Reflection.AssemblyTitleAttribute("Utils")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.AssemblyInfoInputs.cache b/labs/lab4/Utils/obj/Debug/net9.0/Utils.AssemblyInfoInputs.cache new file mode 100644 index 0000000..59ffc55 --- /dev/null +++ b/labs/lab4/Utils/obj/Debug/net9.0/Utils.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +d9a0f86e152d85ac94c64d207d25d9e28a1d26a5f639b47c191b315b50d0343b diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab4/Utils/obj/Debug/net9.0/Utils.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..b211a9b --- /dev/null +++ b/labs/lab4/Utils/obj/Debug/net9.0/Utils.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Utils +build_property.ProjectDir = /home/nik/oop/labs/lab4/Utils/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.GlobalUsings.g.cs b/labs/lab4/Utils/obj/Debug/net9.0/Utils.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab4/Utils/obj/Debug/net9.0/Utils.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.assets.cache b/labs/lab4/Utils/obj/Debug/net9.0/Utils.assets.cache new file mode 100644 index 0000000..6971818 Binary files /dev/null and b/labs/lab4/Utils/obj/Debug/net9.0/Utils.assets.cache differ diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.csproj.CoreCompileInputs.cache b/labs/lab4/Utils/obj/Debug/net9.0/Utils.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..dd8c86c --- /dev/null +++ b/labs/lab4/Utils/obj/Debug/net9.0/Utils.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +6085c8efa71b7fcbc87826f6ffc190d4c6caed39809ad47b380e6cbe090d21f2 diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.csproj.FileListAbsolute.txt b/labs/lab4/Utils/obj/Debug/net9.0/Utils.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..1bd0bf7 --- /dev/null +++ b/labs/lab4/Utils/obj/Debug/net9.0/Utils.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab4/Utils/bin/Debug/net9.0/Utils +/home/nik/oop/labs/lab4/Utils/bin/Debug/net9.0/Utils.deps.json +/home/nik/oop/labs/lab4/Utils/bin/Debug/net9.0/Utils.runtimeconfig.json +/home/nik/oop/labs/lab4/Utils/bin/Debug/net9.0/Utils.dll +/home/nik/oop/labs/lab4/Utils/bin/Debug/net9.0/Utils.pdb +/home/nik/oop/labs/lab4/Utils/obj/Debug/net9.0/Utils.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab4/Utils/obj/Debug/net9.0/Utils.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab4/Utils/obj/Debug/net9.0/Utils.AssemblyInfo.cs +/home/nik/oop/labs/lab4/Utils/obj/Debug/net9.0/Utils.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab4/Utils/obj/Debug/net9.0/Utils.dll +/home/nik/oop/labs/lab4/Utils/obj/Debug/net9.0/refint/Utils.dll +/home/nik/oop/labs/lab4/Utils/obj/Debug/net9.0/Utils.pdb +/home/nik/oop/labs/lab4/Utils/obj/Debug/net9.0/Utils.genruntimeconfig.cache +/home/nik/oop/labs/lab4/Utils/obj/Debug/net9.0/ref/Utils.dll diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.dll b/labs/lab4/Utils/obj/Debug/net9.0/Utils.dll new file mode 100644 index 0000000..6bf1bba Binary files /dev/null and b/labs/lab4/Utils/obj/Debug/net9.0/Utils.dll differ diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.genruntimeconfig.cache b/labs/lab4/Utils/obj/Debug/net9.0/Utils.genruntimeconfig.cache new file mode 100644 index 0000000..0e90858 --- /dev/null +++ b/labs/lab4/Utils/obj/Debug/net9.0/Utils.genruntimeconfig.cache @@ -0,0 +1 @@ +f03924812c89729fd31a52bd93ecb6618a58cbe375ba94dee7d99a52e7f3cade diff --git a/labs/lab4/Utils/obj/Debug/net9.0/Utils.pdb b/labs/lab4/Utils/obj/Debug/net9.0/Utils.pdb new file mode 100644 index 0000000..a4e1836 Binary files /dev/null and b/labs/lab4/Utils/obj/Debug/net9.0/Utils.pdb differ diff --git a/labs/lab4/Utils/obj/Debug/net9.0/apphost b/labs/lab4/Utils/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..e60fa7b Binary files /dev/null and b/labs/lab4/Utils/obj/Debug/net9.0/apphost differ diff --git a/labs/lab4/Utils/obj/Debug/net9.0/ref/Utils.dll b/labs/lab4/Utils/obj/Debug/net9.0/ref/Utils.dll new file mode 100644 index 0000000..964e94e Binary files /dev/null and b/labs/lab4/Utils/obj/Debug/net9.0/ref/Utils.dll differ diff --git a/labs/lab4/Utils/obj/Debug/net9.0/refint/Utils.dll b/labs/lab4/Utils/obj/Debug/net9.0/refint/Utils.dll new file mode 100644 index 0000000..964e94e Binary files /dev/null and b/labs/lab4/Utils/obj/Debug/net9.0/refint/Utils.dll differ diff --git a/labs/lab4/Utils/obj/Utils.csproj.nuget.dgspec.json b/labs/lab4/Utils/obj/Utils.csproj.nuget.dgspec.json new file mode 100644 index 0000000..9c887ed --- /dev/null +++ b/labs/lab4/Utils/obj/Utils.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab4/Utils/Utils.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab4/Utils/Utils.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab4/Utils/Utils.csproj", + "projectName": "Utils", + "projectPath": "/home/nik/oop/labs/lab4/Utils/Utils.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab4/Utils/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab4/Utils/obj/Utils.csproj.nuget.g.props b/labs/lab4/Utils/obj/Utils.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab4/Utils/obj/Utils.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab4/Utils/obj/Utils.csproj.nuget.g.targets b/labs/lab4/Utils/obj/Utils.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab4/Utils/obj/Utils.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab4/Utils/obj/project.assets.json b/labs/lab4/Utils/obj/project.assets.json new file mode 100644 index 0000000..6dae410 --- /dev/null +++ b/labs/lab4/Utils/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab4/Utils/Utils.csproj", + "projectName": "Utils", + "projectPath": "/home/nik/oop/labs/lab4/Utils/Utils.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab4/Utils/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab4/Utils/obj/project.nuget.cache b/labs/lab4/Utils/obj/project.nuget.cache new file mode 100644 index 0000000..b940a9c --- /dev/null +++ b/labs/lab4/Utils/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "322eHXCW/NQ=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab4/Utils/Utils.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab4/assets/1.png b/labs/lab4/assets/1.png new file mode 100644 index 0000000..fc56a82 Binary files /dev/null and b/labs/lab4/assets/1.png differ diff --git a/labs/lab4/assets/2.png b/labs/lab4/assets/2.png new file mode 100644 index 0000000..e60497c Binary files /dev/null and b/labs/lab4/assets/2.png differ diff --git a/labs/lab4/assets/3.png b/labs/lab4/assets/3.png new file mode 100644 index 0000000..b44dcd1 Binary files /dev/null and b/labs/lab4/assets/3.png differ diff --git a/labs/lab4/assets/4.png b/labs/lab4/assets/4.png new file mode 100644 index 0000000..5cc65bd Binary files /dev/null and b/labs/lab4/assets/4.png differ diff --git a/labs/lab4/assets/5.png b/labs/lab4/assets/5.png new file mode 100644 index 0000000..d26d2e2 Binary files /dev/null and b/labs/lab4/assets/5.png differ diff --git a/labs/lab4/assets/6.png b/labs/lab4/assets/6.png new file mode 100644 index 0000000..6f965c0 Binary files /dev/null and b/labs/lab4/assets/6.png differ diff --git a/labs/lab4/assets/7.png b/labs/lab4/assets/7.png new file mode 100644 index 0000000..eb37947 Binary files /dev/null and b/labs/lab4/assets/7.png differ diff --git a/labs/lab4/report.pdf b/labs/lab4/report.pdf new file mode 100644 index 0000000..5ae10f2 Binary files /dev/null and b/labs/lab4/report.pdf differ diff --git a/labs/lab4/report.typ b/labs/lab4/report.typ new file mode 100644 index 0000000..b47b4d7 --- /dev/null +++ b/labs/lab4/report.typ @@ -0,0 +1,373 @@ +#set text(size: 1.3em) + +#show raw.where(block: false): box.with( + fill: luma(240), + inset: (x: 3pt, y: 0pt), + outset: (y: 3pt), + radius: 2pt, +) + +#show raw.where(block: true): block.with( + fill: luma(240), + inset: 10pt, + radius: 4pt, +) + +// title + +#align(center)[Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики] +\ +\ +\ +#align(center)[Факультет инфокоммуникационных технологий] +#align(center)[Направление подготовки 11.03.02] +\ +\ +#align(center)[Лабораторная работа №4] +#align(center)[Создание и использование методов] +\ +\ +\ //#align(center)[Вариант 19] +\ +\ +\ +\ +\ +\ +\ +#align(right)[Выполнил:] +#align(right)[Дощенников Никита Андреевич] +#align(right)[Группа: К3221] +#align(right)[Проверил:] +#align(right)[Иванов Сергей Евгеньевич] +\ +\ +#align(center)[Санкт-Петербург] +#align(center)[2025] + +#pagebreak() + +=== Цель работы: + +Изучить и приобрести навыки работы с методами класса. + +=== Упражнение 1. Использование параметров в методах, возвращающих значения. + +Я создал класс `Utils` и определил в нем метод `Greater`, который принимает 2 целочисленных параметра и возвращает больший из них. + +Тело метода: + +```cs +public static int Greater(int a, int b) +{ + if (a > b) + return a; + else + return b; +} +``` + +Тест: + +```cs +static void Main(string[] args) +{ + int x, y; + + Console.WriteLine("Введите первое число: "); + x = int.Parse(Console.ReadLine()); + Console.WriteLine("Введите второе число: "); + y = int.Parse(Console.ReadLine()); + + int greater = Utils.Greater(x, y); + + Console.WriteLine("Большим из чисел {0} и {1} является {2} ", x, y, greater); +} +``` + +Пример: + +#align(center)[#image("assets/1.png")] + +=== Упражнение 2. Использование в методах параметров, передаваемых по ссылке + +Я создал метод `Swap`, который меняет местами значения параметров. При этом использовались параметры, передаваемые по ссылке: + +```cs +public static void Swap(ref int a, ref int b) +{ + int temp = a; + a = b; + b = temp; +} +``` + +Тест: + +```cs +Console.WriteLine("До swap: \t" + x + " " + y); +Utils.Swap(ref x, ref y); +Console.WriteLine("После swap: \t" + x + " " + y); +``` + +Пример: + +#align(center)[#image("assets/2.png")] + +=== Упражнение 3. Использование возвращаемых параметров в методах. + +В этом упражнении я создал метод `Factorial`, принимающий целочисленную переменную и рассчитывающий ее факториал по итерационному алгоритму. + +```cs +public static bool Factorial(int n, out int answer) +{ + int k; + int f = 1; + bool ok = true; + + try + { + checked + { + for (k = 2; k <= n; ++k) + { + f = f * k; + } + } + } + catch (Exception) + { + f = 0; + ok = false; + } + + answer = f; + return ok; +} +``` + +Тест: + +```cs +int f; +bool ok; + +Console.WriteLine("Number for factorial:"); +x = int.Parse(Console.ReadLine()); + +ok = Utils.Factorial(x, out f); + +if (ok) + Console.WriteLine("Factorial(" + x + ") = " + f); +else + Console.WriteLine("Cannot compute this factorial"); +``` + +Пример: + +#align(center)[#image("assets/3.png")] + +=== Упражнение 4. Расчет площади треугольника с помощью метода. + +В этом упражнении я создал класс `Operation` который умеет считать площадь треугольника, проверять треугольник на существование и считать площадь для равностороннего треугольника. + +```cs +using System; + +public class Operation +{ + public static double TriangleArea(double a, double b, double c) + { + double p = (a + b + c) / 2; + bool exists = CheckTriangle(a, b, c); + if (!exists) + return -1; + + return Math.Sqrt(p * (p - a) * (p - b) * (p - c)); + } + + public static double TriangleArea(double a) + { + return TriangleArea(a, a, a); + } + + + public static bool CheckTriangle(double a, double b, double c) + { + if (a <= 0 || b <= 0 || c <= 0) return false; + + double maxSide = Math.Max(Math.Max(a, b), Math.Max(b, c)); + + if (maxSide >= a + b + c - maxSide) return false; + + return true; + } + + public static int SolveQuadratic(int a, int b, int c, out double x1, out double x2) + { + double d = b * b - 4 * a * c; + if (d > 0) + { + x1 = (-b + Math.Sqrt(d)) / (2 * a); + x2 = (-b - Math.Sqrt(d)) / (2 * a); + return 1; + } + else if (d == 0) + { + x1 = x2 = -b / (2 * a); + return 0; + } + else + { + x1 = x2 = -1; + return -1; + } + } +} +``` + +Тесты: + +```cs +Console.WriteLine("choose the type of the triangle. type 1 for equilateral else 2: "); +int triangleType = int.Parse(Console.ReadLine()); + +switch (triangleType) +{ + + +case 1: + Console.WriteLine("input side length: "); + double a = double.Parse(Console.ReadLine()); + Console.WriteLine("area = {0}", Operation.TriangleArea(a)); + break; +case 2: + Console.WriteLine("input first side length: "); + double sideA = double.Parse(Console.ReadLine()); + Console.WriteLine("input second side length: "); + double sideB = double.Parse(Console.ReadLine()); + Console.WriteLine("input third side length: "); + double sideC = double.Parse(Console.ReadLine()); + Console.WriteLine("area = {0}", Operation.TriangleArea(sideA, sideB, sideC)); + break; +default: + Console.WriteLine("invalid triangle type"); + break; +} +``` + +Пример: + +#align(center)[#image("assets/4.png")] + +=== Упражнение 5. Вычисление корней квадратного уравнения. + +В этом упражнении я реализовал метод вычисления квадратного уравнения. + +```cs +public static int SolveQuadratic(int a, int b, int c, out double x1, out double x2) +{ + double d = b * b - 4 * a * c; + if (d > 0) + { + x1 = (-b + Math.Sqrt(d)) / (2 * a); + x2 = (-b - Math.Sqrt(d)) / (2 * a); + return 1; + } + else if (d == 0) + { + x1 = x2 = -b / (2 * a); + return 0; + } + else + { + x1 = x2 = -1; + return -1; + } +} +``` + +Тесты: + +```cs +Console.WriteLine("input coefficient a: "); +int coef_a = int.Parse(Console.ReadLine()); +Console.WriteLine("input coefficient b: "); +int coef_b = int.Parse(Console.ReadLine()); +Console.WriteLine("input coefficient c: "); +int coef_c = int.Parse(Console.ReadLine()); + +double x1, x2; +int res = Operation.SolveQuadratic(coef_a, coef_b, coef_c, out x1, out x2); + +if (res == 1) +{ + Console.WriteLine("Корни уравнения с коэффициентами a = результат, b = результат, c = результат равны x1 = {0}, x2 = {1}.", x1, x2); +} +else if (res == 0) +{ + Console.WriteLine("Корень уравнения с коэффициентами a = результат, b = результат, c = результат равны один x1 = x2 = {0}", x1); +} +else +{ + Console.WriteLine("Корней уравнения с коэффициентами a = результат, b = результат, c = результат нет."); +} +``` + +Пример: + +#align(center)[#image("assets/5.png")] +#align(center)[#image("assets/6.png")] +#align(center)[#image("assets/7.png")] + +=== Вывод. + +В ходе проделанной работы, я изучил и приобрел навыки работы с методами класса. + +=== Code review. (by #link("https://zzzcode.ai")[zzzcode.ai]) + +*Резюме* + +Данный код реализует несколько математических операций, включая вычисление площади треугольника, решение квадратного уравнения и вычисление факториала. Код написан на C\# и включает в себя классы `Operation`, `Program` и `Utils`. В целом, код выполняет свои функции, но требует улучшений в области обработки ошибок, читаемости и структуры. + +*Ошибка* + +В методе `TriangleArea` возвращается -1 в случае, если треугольник не существует. Это может вызвать путаницу, так как -1 может быть интерпретировано как валидное значение площади. Рекомендуется использовать исключения для обработки ошибок. + +*Стиль кода* + +Код в целом следует стандартам C\#, однако есть некоторые моменты, которые можно улучшить: + + Использование var для переменных, где тип очевиден. + Избегание магических чисел, таких как -1, для обозначения ошибок. + +*Структура кода* + +Классы и методы организованы логически, однако стоит рассмотреть возможность разделения функциональности на более мелкие классы или модули для улучшения поддержки и тестирования. + +*Читаемость* + +Код читаем, но можно улучшить его с помощью: + + Добавления комментариев для сложных участков кода. + Использования более описательных имен переменных и методов. + +*Производительность* + +Код работает эффективно для небольших входных данных. Однако, для больших значений, особенно в методе `Factorial`, стоит рассмотреть использование более эффективных алгоритмов или библиотек. + +*Масштабируемость* + +Код может быть масштабирован, но для этого потребуется рефакторинг. Например, можно использовать интерфейсы и абстракции для улучшения гибкости. + +*Безопасность* + +Код не содержит явных уязвимостей, но стоит добавить проверки на вводимые данные, чтобы избежать исключений при некорректном вводе. + +*Обработка ошибок* + +Обработка ошибок в коде минимальна. Рекомендуется использовать исключения для более четкой обработки ошибок, а также добавлять проверки на вводимые данные. + +*Заключение* + +Код выполняет свои функции, но требует улучшений в области обработки ошибок, читаемости и структуры. Рекомендуется провести рефакторинг для повышения качества кода и его поддержки в будущем. diff --git a/labs/lab5/ArrayProcess/ArrayProcess.csproj b/labs/lab5/ArrayProcess/ArrayProcess.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab5/ArrayProcess/ArrayProcess.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab5/ArrayProcess/Program.cs b/labs/lab5/ArrayProcess/Program.cs new file mode 100644 index 0000000..fb0afc9 --- /dev/null +++ b/labs/lab5/ArrayProcess/Program.cs @@ -0,0 +1,87 @@ +using System; + +public class Program +{ + static int SumPos(int[] a) + { + int r = 0; + foreach (int x in a) if (x > 0) r += x; + return r; + } + + static int SumNeg(int[] a) + { + int r = 0; + foreach (int x in a) if (x < 0) r += x; + return r; + } + + static int SumArr(int[] a) => SumPos(a) + SumNeg(a); + + static double AvgArr(int[] a) => a.Length == 0 ? double.NaN : (double)SumArr(a) / a.Length; + + static int SumEvenPos(int[] a) + { + int r = 0; + for (int i = 0; i < a.Length; i += 2) r += a[i]; + return r; + } + + static int SumOddPos(int[] a) + { + int r = 0; + for (int i = 1; i < a.Length; i += 2) r += a[i]; + return r; + } + + static int MaxIdx(int[] a) + { + if (a.Length == 0) return -1; + int idx = 0, m = a[0]; + for (int i = 1; i < a.Length; i++) + if (a[i] > m) { m = a[i]; idx = i; } + return idx; + } + + static int MinIdx(int[] a) + { + if (a.Length == 0) return -1; + int idx = 0, m = a[0]; + for (int i = 1; i < a.Length; i++) + if (a[i] < m) { m = a[i]; idx = i; } + return idx; + } + + static int ProductBetweenMinMax(int[] a) + { + int start = MinIdx(a), end = MaxIdx(a); + if (start == -1 || end == -1) return -1; + if (start > end) { int t = start; start = end; end = t; } + if (end - start <= 1) return -1; + int r = 1; + for (int i = start + 1; i < end; i++) r *= a[i]; + return r; + } + + public static void Main(string[] args) + { + Console.Write("input an arr length: "); + int n = int.Parse(Console.ReadLine()); + int[] arr = new int[n]; + + for (int i = 0; i < arr.Length; i++) + { + Console.Write("arr[{0}] = ", i); + arr[i] = int.Parse(Console.ReadLine()); + } + + Console.WriteLine("sum of the array's elements is {0}", SumArr(arr)); + Console.WriteLine("avg value of the array is {0}", AvgArr(arr)); + Console.WriteLine("sum of positive array values is {0}, sum of negative array values is {1}", SumPos(arr), SumNeg(arr)); + Console.WriteLine("sum of elements on even positions is {0}, sum of elements on odd positions is {1}", SumEvenPos(arr), SumOddPos(arr)); + Console.WriteLine("index of max array element is {0}", MaxIdx(arr)); + Console.WriteLine("index of min array element is {0}", MinIdx(arr)); + Console.WriteLine("product of numbers between min and max is {0}", ProductBetweenMinMax(arr)); + } +} + diff --git a/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess new file mode 100755 index 0000000..e07f5f0 Binary files /dev/null and b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess differ diff --git a/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.deps.json b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.deps.json new file mode 100644 index 0000000..ba86e16 --- /dev/null +++ b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "ArrayProcess/1.0.0": { + "runtime": { + "ArrayProcess.dll": {} + } + } + } + }, + "libraries": { + "ArrayProcess/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.dll b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.dll new file mode 100644 index 0000000..458e685 Binary files /dev/null and b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.dll differ diff --git a/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.pdb b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.pdb new file mode 100644 index 0000000..6d2097e Binary files /dev/null and b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.pdb differ diff --git a/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.runtimeconfig.json b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab5/ArrayProcess/obj/ArrayProcess.csproj.nuget.dgspec.json b/labs/lab5/ArrayProcess/obj/ArrayProcess.csproj.nuget.dgspec.json new file mode 100644 index 0000000..377c4dd --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/ArrayProcess.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab5/ArrayProcess/ArrayProcess.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab5/ArrayProcess/ArrayProcess.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab5/ArrayProcess/ArrayProcess.csproj", + "projectName": "ArrayProcess", + "projectPath": "/home/nik/oop/labs/lab5/ArrayProcess/ArrayProcess.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab5/ArrayProcess/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab5/ArrayProcess/obj/ArrayProcess.csproj.nuget.g.props b/labs/lab5/ArrayProcess/obj/ArrayProcess.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/ArrayProcess.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab5/ArrayProcess/obj/ArrayProcess.csproj.nuget.g.targets b/labs/lab5/ArrayProcess/obj/ArrayProcess.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/ArrayProcess.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab5/ArrayProcess/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.AssemblyInfo.cs b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.AssemblyInfo.cs new file mode 100644 index 0000000..ea082fe --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("ArrayProcess")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1c467e61be36ba28401de8950c829e3f753a634c")] +[assembly: System.Reflection.AssemblyProductAttribute("ArrayProcess")] +[assembly: System.Reflection.AssemblyTitleAttribute("ArrayProcess")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.AssemblyInfoInputs.cache b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.AssemblyInfoInputs.cache new file mode 100644 index 0000000..f323c9d --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +bc1a894a07e31dbe1db6119b8c6b5279570fae72bc5f8b74a790bdc4b9be740a diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..b7daeac --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = ArrayProcess +build_property.ProjectDir = /home/nik/oop/labs/lab5/ArrayProcess/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.GlobalUsings.g.cs b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.assets.cache b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.assets.cache new file mode 100644 index 0000000..636e9be Binary files /dev/null and b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.assets.cache differ diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.csproj.CoreCompileInputs.cache b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..fec903e --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +f938326882807c5adf4897670d20ed14ffc9ca82b09145183737ae80fdead58f diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.csproj.FileListAbsolute.txt b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..db46c2e --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess +/home/nik/oop/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.deps.json +/home/nik/oop/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.runtimeconfig.json +/home/nik/oop/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.dll +/home/nik/oop/labs/lab5/ArrayProcess/bin/Debug/net9.0/ArrayProcess.pdb +/home/nik/oop/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.AssemblyInfo.cs +/home/nik/oop/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.dll +/home/nik/oop/labs/lab5/ArrayProcess/obj/Debug/net9.0/refint/ArrayProcess.dll +/home/nik/oop/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.pdb +/home/nik/oop/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.genruntimeconfig.cache +/home/nik/oop/labs/lab5/ArrayProcess/obj/Debug/net9.0/ref/ArrayProcess.dll diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.dll b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.dll new file mode 100644 index 0000000..458e685 Binary files /dev/null and b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.dll differ diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.genruntimeconfig.cache b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.genruntimeconfig.cache new file mode 100644 index 0000000..8f2a6ac --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.genruntimeconfig.cache @@ -0,0 +1 @@ +1c60a15cf2f24d58cb1e6ea8e943d82b4a6455334a8d210a750368ceb6e13d26 diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.pdb b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.pdb new file mode 100644 index 0000000..6d2097e Binary files /dev/null and b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ArrayProcess.pdb differ diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/apphost b/labs/lab5/ArrayProcess/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..e07f5f0 Binary files /dev/null and b/labs/lab5/ArrayProcess/obj/Debug/net9.0/apphost differ diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/ref/ArrayProcess.dll b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ref/ArrayProcess.dll new file mode 100644 index 0000000..8d0aa44 Binary files /dev/null and b/labs/lab5/ArrayProcess/obj/Debug/net9.0/ref/ArrayProcess.dll differ diff --git a/labs/lab5/ArrayProcess/obj/Debug/net9.0/refint/ArrayProcess.dll b/labs/lab5/ArrayProcess/obj/Debug/net9.0/refint/ArrayProcess.dll new file mode 100644 index 0000000..8d0aa44 Binary files /dev/null and b/labs/lab5/ArrayProcess/obj/Debug/net9.0/refint/ArrayProcess.dll differ diff --git a/labs/lab5/ArrayProcess/obj/project.assets.json b/labs/lab5/ArrayProcess/obj/project.assets.json new file mode 100644 index 0000000..7eb6a0a --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab5/ArrayProcess/ArrayProcess.csproj", + "projectName": "ArrayProcess", + "projectPath": "/home/nik/oop/labs/lab5/ArrayProcess/ArrayProcess.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab5/ArrayProcess/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab5/ArrayProcess/obj/project.nuget.cache b/labs/lab5/ArrayProcess/obj/project.nuget.cache new file mode 100644 index 0000000..a550f87 --- /dev/null +++ b/labs/lab5/ArrayProcess/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "eoTf7zVqGRY=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab5/ArrayProcess/ArrayProcess.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab5/Loop/Loop.csproj b/labs/lab5/Loop/Loop.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab5/Loop/Loop.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab5/Loop/Program.cs b/labs/lab5/Loop/Program.cs new file mode 100644 index 0000000..b4e8966 --- /dev/null +++ b/labs/lab5/Loop/Program.cs @@ -0,0 +1,16 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + int[] myArray = {100, 1, 32, 3, 14, 25, 6, 17, 8, 99}; + int n = 10; + for (int i = 0; i < n; i++) + { + if (myArray[i] % 2 == 0) myArray[i] = 0; + + Console.Write(myArray[i] + " "); + } + } +} diff --git a/labs/lab5/Loop/bin/Debug/net9.0/Loop b/labs/lab5/Loop/bin/Debug/net9.0/Loop new file mode 100755 index 0000000..42539d9 Binary files /dev/null and b/labs/lab5/Loop/bin/Debug/net9.0/Loop differ diff --git a/labs/lab5/Loop/bin/Debug/net9.0/Loop.deps.json b/labs/lab5/Loop/bin/Debug/net9.0/Loop.deps.json new file mode 100644 index 0000000..5d2161c --- /dev/null +++ b/labs/lab5/Loop/bin/Debug/net9.0/Loop.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Loop/1.0.0": { + "runtime": { + "Loop.dll": {} + } + } + } + }, + "libraries": { + "Loop/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab5/Loop/bin/Debug/net9.0/Loop.dll b/labs/lab5/Loop/bin/Debug/net9.0/Loop.dll new file mode 100644 index 0000000..5f9109d Binary files /dev/null and b/labs/lab5/Loop/bin/Debug/net9.0/Loop.dll differ diff --git a/labs/lab5/Loop/bin/Debug/net9.0/Loop.pdb b/labs/lab5/Loop/bin/Debug/net9.0/Loop.pdb new file mode 100644 index 0000000..a2aac06 Binary files /dev/null and b/labs/lab5/Loop/bin/Debug/net9.0/Loop.pdb differ diff --git a/labs/lab5/Loop/bin/Debug/net9.0/Loop.runtimeconfig.json b/labs/lab5/Loop/bin/Debug/net9.0/Loop.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab5/Loop/bin/Debug/net9.0/Loop.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab5/Loop/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab5/Loop/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab5/Loop/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.AssemblyInfo.cs b/labs/lab5/Loop/obj/Debug/net9.0/Loop.AssemblyInfo.cs new file mode 100644 index 0000000..32f6518 --- /dev/null +++ b/labs/lab5/Loop/obj/Debug/net9.0/Loop.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Loop")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1c467e61be36ba28401de8950c829e3f753a634c")] +[assembly: System.Reflection.AssemblyProductAttribute("Loop")] +[assembly: System.Reflection.AssemblyTitleAttribute("Loop")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.AssemblyInfoInputs.cache b/labs/lab5/Loop/obj/Debug/net9.0/Loop.AssemblyInfoInputs.cache new file mode 100644 index 0000000..d6e0b16 --- /dev/null +++ b/labs/lab5/Loop/obj/Debug/net9.0/Loop.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +1070bb8c4c9a8f6f529c7a07fc0f64d121b3b127848afda335954ff51143bd26 diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab5/Loop/obj/Debug/net9.0/Loop.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..2cc117e --- /dev/null +++ b/labs/lab5/Loop/obj/Debug/net9.0/Loop.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Loop +build_property.ProjectDir = /home/nik/oop/labs/lab5/Loop/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.GlobalUsings.g.cs b/labs/lab5/Loop/obj/Debug/net9.0/Loop.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab5/Loop/obj/Debug/net9.0/Loop.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.assets.cache b/labs/lab5/Loop/obj/Debug/net9.0/Loop.assets.cache new file mode 100644 index 0000000..7d253a4 Binary files /dev/null and b/labs/lab5/Loop/obj/Debug/net9.0/Loop.assets.cache differ diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.csproj.CoreCompileInputs.cache b/labs/lab5/Loop/obj/Debug/net9.0/Loop.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..1ceefba --- /dev/null +++ b/labs/lab5/Loop/obj/Debug/net9.0/Loop.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +eb652d3648ca123ec0f2e76e9ac62039c34b354d5c7aa7386f7cb989ddbaddae diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.csproj.FileListAbsolute.txt b/labs/lab5/Loop/obj/Debug/net9.0/Loop.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..ec8435e --- /dev/null +++ b/labs/lab5/Loop/obj/Debug/net9.0/Loop.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab5/Loop/bin/Debug/net9.0/Loop +/home/nik/oop/labs/lab5/Loop/bin/Debug/net9.0/Loop.deps.json +/home/nik/oop/labs/lab5/Loop/bin/Debug/net9.0/Loop.runtimeconfig.json +/home/nik/oop/labs/lab5/Loop/bin/Debug/net9.0/Loop.dll +/home/nik/oop/labs/lab5/Loop/bin/Debug/net9.0/Loop.pdb +/home/nik/oop/labs/lab5/Loop/obj/Debug/net9.0/Loop.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab5/Loop/obj/Debug/net9.0/Loop.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab5/Loop/obj/Debug/net9.0/Loop.AssemblyInfo.cs +/home/nik/oop/labs/lab5/Loop/obj/Debug/net9.0/Loop.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab5/Loop/obj/Debug/net9.0/Loop.dll +/home/nik/oop/labs/lab5/Loop/obj/Debug/net9.0/refint/Loop.dll +/home/nik/oop/labs/lab5/Loop/obj/Debug/net9.0/Loop.pdb +/home/nik/oop/labs/lab5/Loop/obj/Debug/net9.0/Loop.genruntimeconfig.cache +/home/nik/oop/labs/lab5/Loop/obj/Debug/net9.0/ref/Loop.dll diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.dll b/labs/lab5/Loop/obj/Debug/net9.0/Loop.dll new file mode 100644 index 0000000..5f9109d Binary files /dev/null and b/labs/lab5/Loop/obj/Debug/net9.0/Loop.dll differ diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.genruntimeconfig.cache b/labs/lab5/Loop/obj/Debug/net9.0/Loop.genruntimeconfig.cache new file mode 100644 index 0000000..88f1c45 --- /dev/null +++ b/labs/lab5/Loop/obj/Debug/net9.0/Loop.genruntimeconfig.cache @@ -0,0 +1 @@ +80d5336fbae4a9a2b9356312372910c8de9cd2c606670952ed72d8a4f9121ba3 diff --git a/labs/lab5/Loop/obj/Debug/net9.0/Loop.pdb b/labs/lab5/Loop/obj/Debug/net9.0/Loop.pdb new file mode 100644 index 0000000..a2aac06 Binary files /dev/null and b/labs/lab5/Loop/obj/Debug/net9.0/Loop.pdb differ diff --git a/labs/lab5/Loop/obj/Debug/net9.0/apphost b/labs/lab5/Loop/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..42539d9 Binary files /dev/null and b/labs/lab5/Loop/obj/Debug/net9.0/apphost differ diff --git a/labs/lab5/Loop/obj/Debug/net9.0/ref/Loop.dll b/labs/lab5/Loop/obj/Debug/net9.0/ref/Loop.dll new file mode 100644 index 0000000..736d378 Binary files /dev/null and b/labs/lab5/Loop/obj/Debug/net9.0/ref/Loop.dll differ diff --git a/labs/lab5/Loop/obj/Debug/net9.0/refint/Loop.dll b/labs/lab5/Loop/obj/Debug/net9.0/refint/Loop.dll new file mode 100644 index 0000000..736d378 Binary files /dev/null and b/labs/lab5/Loop/obj/Debug/net9.0/refint/Loop.dll differ diff --git a/labs/lab5/Loop/obj/Loop.csproj.nuget.dgspec.json b/labs/lab5/Loop/obj/Loop.csproj.nuget.dgspec.json new file mode 100644 index 0000000..c6f90f5 --- /dev/null +++ b/labs/lab5/Loop/obj/Loop.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab5/Loop/Loop.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab5/Loop/Loop.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab5/Loop/Loop.csproj", + "projectName": "Loop", + "projectPath": "/home/nik/oop/labs/lab5/Loop/Loop.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab5/Loop/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab5/Loop/obj/Loop.csproj.nuget.g.props b/labs/lab5/Loop/obj/Loop.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab5/Loop/obj/Loop.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab5/Loop/obj/Loop.csproj.nuget.g.targets b/labs/lab5/Loop/obj/Loop.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab5/Loop/obj/Loop.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab5/Loop/obj/project.assets.json b/labs/lab5/Loop/obj/project.assets.json new file mode 100644 index 0000000..815d942 --- /dev/null +++ b/labs/lab5/Loop/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab5/Loop/Loop.csproj", + "projectName": "Loop", + "projectPath": "/home/nik/oop/labs/lab5/Loop/Loop.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab5/Loop/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab5/Loop/obj/project.nuget.cache b/labs/lab5/Loop/obj/project.nuget.cache new file mode 100644 index 0000000..c178a02 --- /dev/null +++ b/labs/lab5/Loop/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "XmTFlNb64zI=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab5/Loop/Loop.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab5/MatrixMultiply/MatrixMultiply.csproj b/labs/lab5/MatrixMultiply/MatrixMultiply.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab5/MatrixMultiply/MatrixMultiply.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab5/MatrixMultiply/Program.cs b/labs/lab5/MatrixMultiply/Program.cs new file mode 100644 index 0000000..bb8d02e --- /dev/null +++ b/labs/lab5/MatrixMultiply/Program.cs @@ -0,0 +1,60 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + int[,] m1 = new int[2, 2]; + int[,] m2 = new int[2, 2]; + + fillQuadraticMatrix(ref m1, 2); + fillQuadraticMatrix(ref m2, 2); + + int[,] res = multiplyQuadraticMatrix(m1, m2, 2); + + printQuadraticMatrix(res, 2); + } + + static void fillQuadraticMatrix(ref int[,] m, int n) + { + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + Console.Write("m[{0}][{1}] = ", i, j); + m[i, j] = int.Parse(Console.ReadLine()); + } + } + + } + + static void printQuadraticMatrix(int[,] m, int n) + { + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + Console.Write(m[i, j] + " "); + } + Console.Write("\n"); + } + } + + static int[,] multiplyQuadraticMatrix(int[,] m1, int[,] m2, int n) + { + int[,] res = new int[n, n]; + + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + for (int k = 0; k < n; k++) + { + res[i, j] += m1[i, k] * m2[k, j]; + } + } + } + return res; + } + +} diff --git a/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply new file mode 100755 index 0000000..5175bda Binary files /dev/null and b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply differ diff --git a/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.deps.json b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.deps.json new file mode 100644 index 0000000..9c54105 --- /dev/null +++ b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "MatrixMultiply/1.0.0": { + "runtime": { + "MatrixMultiply.dll": {} + } + } + } + }, + "libraries": { + "MatrixMultiply/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.dll b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.dll new file mode 100644 index 0000000..17b5fe8 Binary files /dev/null and b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.dll differ diff --git a/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.pdb b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.pdb new file mode 100644 index 0000000..f7991f7 Binary files /dev/null and b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.pdb differ diff --git a/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.runtimeconfig.json b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.AssemblyInfo.cs b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.AssemblyInfo.cs new file mode 100644 index 0000000..7643fbd --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("MatrixMultiply")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1c467e61be36ba28401de8950c829e3f753a634c")] +[assembly: System.Reflection.AssemblyProductAttribute("MatrixMultiply")] +[assembly: System.Reflection.AssemblyTitleAttribute("MatrixMultiply")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.AssemblyInfoInputs.cache b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.AssemblyInfoInputs.cache new file mode 100644 index 0000000..6410eb6 --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +04331c49f921a7429aefb22e34852167176cc0eb6eff54ff74fdc32820c402f8 diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..4cd086c --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = MatrixMultiply +build_property.ProjectDir = /home/nik/oop/labs/lab5/MatrixMultiply/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.GlobalUsings.g.cs b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.assets.cache b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.assets.cache new file mode 100644 index 0000000..f292e4c Binary files /dev/null and b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.assets.cache differ diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.csproj.CoreCompileInputs.cache b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..745580c --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +ea88fc3b550f6a964ea47b632e984ea30472c127dca7d28d99c9c330d5105556 diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.csproj.FileListAbsolute.txt b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..80e0ea3 --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.AssemblyInfo.cs +/home/nik/oop/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply +/home/nik/oop/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.deps.json +/home/nik/oop/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.runtimeconfig.json +/home/nik/oop/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.dll +/home/nik/oop/labs/lab5/MatrixMultiply/bin/Debug/net9.0/MatrixMultiply.pdb +/home/nik/oop/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.dll +/home/nik/oop/labs/lab5/MatrixMultiply/obj/Debug/net9.0/refint/MatrixMultiply.dll +/home/nik/oop/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.pdb +/home/nik/oop/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.genruntimeconfig.cache +/home/nik/oop/labs/lab5/MatrixMultiply/obj/Debug/net9.0/ref/MatrixMultiply.dll diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.dll b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.dll new file mode 100644 index 0000000..17b5fe8 Binary files /dev/null and b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.dll differ diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.genruntimeconfig.cache b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.genruntimeconfig.cache new file mode 100644 index 0000000..fcc2679 --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.genruntimeconfig.cache @@ -0,0 +1 @@ +12158eafecee62b11e7f6cd701788e6b2fc3b191f4f67e264c2c0f0daea4e326 diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.pdb b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.pdb new file mode 100644 index 0000000..f7991f7 Binary files /dev/null and b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/MatrixMultiply.pdb differ diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/apphost b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..5175bda Binary files /dev/null and b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/apphost differ diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/ref/MatrixMultiply.dll b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/ref/MatrixMultiply.dll new file mode 100644 index 0000000..3bc15b4 Binary files /dev/null and b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/ref/MatrixMultiply.dll differ diff --git a/labs/lab5/MatrixMultiply/obj/Debug/net9.0/refint/MatrixMultiply.dll b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/refint/MatrixMultiply.dll new file mode 100644 index 0000000..3bc15b4 Binary files /dev/null and b/labs/lab5/MatrixMultiply/obj/Debug/net9.0/refint/MatrixMultiply.dll differ diff --git a/labs/lab5/MatrixMultiply/obj/MatrixMultiply.csproj.nuget.dgspec.json b/labs/lab5/MatrixMultiply/obj/MatrixMultiply.csproj.nuget.dgspec.json new file mode 100644 index 0000000..0ca3a3c --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/MatrixMultiply.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab5/MatrixMultiply/MatrixMultiply.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab5/MatrixMultiply/MatrixMultiply.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab5/MatrixMultiply/MatrixMultiply.csproj", + "projectName": "MatrixMultiply", + "projectPath": "/home/nik/oop/labs/lab5/MatrixMultiply/MatrixMultiply.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab5/MatrixMultiply/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab5/MatrixMultiply/obj/MatrixMultiply.csproj.nuget.g.props b/labs/lab5/MatrixMultiply/obj/MatrixMultiply.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/MatrixMultiply.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab5/MatrixMultiply/obj/MatrixMultiply.csproj.nuget.g.targets b/labs/lab5/MatrixMultiply/obj/MatrixMultiply.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/MatrixMultiply.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab5/MatrixMultiply/obj/project.assets.json b/labs/lab5/MatrixMultiply/obj/project.assets.json new file mode 100644 index 0000000..208c962 --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab5/MatrixMultiply/MatrixMultiply.csproj", + "projectName": "MatrixMultiply", + "projectPath": "/home/nik/oop/labs/lab5/MatrixMultiply/MatrixMultiply.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab5/MatrixMultiply/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab5/MatrixMultiply/obj/project.nuget.cache b/labs/lab5/MatrixMultiply/obj/project.nuget.cache new file mode 100644 index 0000000..0b71d28 --- /dev/null +++ b/labs/lab5/MatrixMultiply/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "jGUAOCUgnWY=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab5/MatrixMultiply/MatrixMultiply.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab5/SizedArray/Program.cs b/labs/lab5/SizedArray/Program.cs new file mode 100644 index 0000000..77f1735 --- /dev/null +++ b/labs/lab5/SizedArray/Program.cs @@ -0,0 +1,21 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + int[] myArray; + Console.WriteLine("input an amount of elements: "); + int n = int.Parse(Console.ReadLine()); + Console.WriteLine("input elements one by one: "); + myArray = new int[n]; + + for (int i = 0; i < myArray.Length; ++i) + { + Console.Write("a[{0}] = ", i); + myArray[i] = int.Parse(Console.ReadLine()); + } + + foreach (int x in myArray) Console.Write("{0} ", x); + } +} diff --git a/labs/lab5/SizedArray/SizedArray.csproj b/labs/lab5/SizedArray/SizedArray.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab5/SizedArray/SizedArray.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray new file mode 100755 index 0000000..97653bb Binary files /dev/null and b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray differ diff --git a/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.deps.json b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.deps.json new file mode 100644 index 0000000..cbe2d2b --- /dev/null +++ b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "SizedArray/1.0.0": { + "runtime": { + "SizedArray.dll": {} + } + } + } + }, + "libraries": { + "SizedArray/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.dll b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.dll new file mode 100644 index 0000000..9860070 Binary files /dev/null and b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.dll differ diff --git a/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.pdb b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.pdb new file mode 100644 index 0000000..70eb03b Binary files /dev/null and b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.pdb differ diff --git a/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.runtimeconfig.json b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab5/SizedArray/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab5/SizedArray/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.AssemblyInfo.cs b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.AssemblyInfo.cs new file mode 100644 index 0000000..9565aff --- /dev/null +++ b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("SizedArray")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1c467e61be36ba28401de8950c829e3f753a634c")] +[assembly: System.Reflection.AssemblyProductAttribute("SizedArray")] +[assembly: System.Reflection.AssemblyTitleAttribute("SizedArray")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.AssemblyInfoInputs.cache b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.AssemblyInfoInputs.cache new file mode 100644 index 0000000..f212df9 --- /dev/null +++ b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +50a6401786029a369d4616ae5d05fce5406774fba42aa69511c9f626f3418aa4 diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..dcdf6a2 --- /dev/null +++ b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = SizedArray +build_property.ProjectDir = /home/nik/oop/labs/lab5/SizedArray/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.GlobalUsings.g.cs b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.assets.cache b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.assets.cache new file mode 100644 index 0000000..af78792 Binary files /dev/null and b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.assets.cache differ diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.csproj.CoreCompileInputs.cache b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..6659d96 --- /dev/null +++ b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +3d92d4016286ac84cd7834883d0b1a61e827699b3c6f3f23780c75298aff251f diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.csproj.FileListAbsolute.txt b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..e6f93f2 --- /dev/null +++ b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray +/home/nik/oop/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.deps.json +/home/nik/oop/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.runtimeconfig.json +/home/nik/oop/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.dll +/home/nik/oop/labs/lab5/SizedArray/bin/Debug/net9.0/SizedArray.pdb +/home/nik/oop/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.AssemblyInfo.cs +/home/nik/oop/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.dll +/home/nik/oop/labs/lab5/SizedArray/obj/Debug/net9.0/refint/SizedArray.dll +/home/nik/oop/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.pdb +/home/nik/oop/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.genruntimeconfig.cache +/home/nik/oop/labs/lab5/SizedArray/obj/Debug/net9.0/ref/SizedArray.dll diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.dll b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.dll new file mode 100644 index 0000000..9860070 Binary files /dev/null and b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.dll differ diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.genruntimeconfig.cache b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.genruntimeconfig.cache new file mode 100644 index 0000000..1a905b9 --- /dev/null +++ b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.genruntimeconfig.cache @@ -0,0 +1 @@ +47dbcb6bbe915fbac1f816be1661e913bb1cb6bbee55dd56a5c3451be106b847 diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.pdb b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.pdb new file mode 100644 index 0000000..70eb03b Binary files /dev/null and b/labs/lab5/SizedArray/obj/Debug/net9.0/SizedArray.pdb differ diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/apphost b/labs/lab5/SizedArray/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..97653bb Binary files /dev/null and b/labs/lab5/SizedArray/obj/Debug/net9.0/apphost differ diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/ref/SizedArray.dll b/labs/lab5/SizedArray/obj/Debug/net9.0/ref/SizedArray.dll new file mode 100644 index 0000000..9486be8 Binary files /dev/null and b/labs/lab5/SizedArray/obj/Debug/net9.0/ref/SizedArray.dll differ diff --git a/labs/lab5/SizedArray/obj/Debug/net9.0/refint/SizedArray.dll b/labs/lab5/SizedArray/obj/Debug/net9.0/refint/SizedArray.dll new file mode 100644 index 0000000..9486be8 Binary files /dev/null and b/labs/lab5/SizedArray/obj/Debug/net9.0/refint/SizedArray.dll differ diff --git a/labs/lab5/SizedArray/obj/SizedArray.csproj.nuget.dgspec.json b/labs/lab5/SizedArray/obj/SizedArray.csproj.nuget.dgspec.json new file mode 100644 index 0000000..ef65914 --- /dev/null +++ b/labs/lab5/SizedArray/obj/SizedArray.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab5/SizedArray/SizedArray.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab5/SizedArray/SizedArray.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab5/SizedArray/SizedArray.csproj", + "projectName": "SizedArray", + "projectPath": "/home/nik/oop/labs/lab5/SizedArray/SizedArray.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab5/SizedArray/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab5/SizedArray/obj/SizedArray.csproj.nuget.g.props b/labs/lab5/SizedArray/obj/SizedArray.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab5/SizedArray/obj/SizedArray.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab5/SizedArray/obj/SizedArray.csproj.nuget.g.targets b/labs/lab5/SizedArray/obj/SizedArray.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab5/SizedArray/obj/SizedArray.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab5/SizedArray/obj/project.assets.json b/labs/lab5/SizedArray/obj/project.assets.json new file mode 100644 index 0000000..8d0cfb0 --- /dev/null +++ b/labs/lab5/SizedArray/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab5/SizedArray/SizedArray.csproj", + "projectName": "SizedArray", + "projectPath": "/home/nik/oop/labs/lab5/SizedArray/SizedArray.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab5/SizedArray/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab5/SizedArray/obj/project.nuget.cache b/labs/lab5/SizedArray/obj/project.nuget.cache new file mode 100644 index 0000000..0f7feb7 --- /dev/null +++ b/labs/lab5/SizedArray/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "XnU4iHFAzUk=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab5/SizedArray/SizedArray.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab5/assets/1.png b/labs/lab5/assets/1.png new file mode 100644 index 0000000..431945b Binary files /dev/null and b/labs/lab5/assets/1.png differ diff --git a/labs/lab5/assets/2.png b/labs/lab5/assets/2.png new file mode 100644 index 0000000..6bc6b25 Binary files /dev/null and b/labs/lab5/assets/2.png differ diff --git a/labs/lab5/assets/3.png b/labs/lab5/assets/3.png new file mode 100644 index 0000000..1fe9a32 Binary files /dev/null and b/labs/lab5/assets/3.png differ diff --git a/labs/lab5/assets/4.png b/labs/lab5/assets/4.png new file mode 100644 index 0000000..2d46597 Binary files /dev/null and b/labs/lab5/assets/4.png differ diff --git a/labs/lab5/report.pdf b/labs/lab5/report.pdf new file mode 100644 index 0000000..c3a82d5 Binary files /dev/null and b/labs/lab5/report.pdf differ diff --git a/labs/lab5/report.typ b/labs/lab5/report.typ new file mode 100644 index 0000000..dcd8b11 --- /dev/null +++ b/labs/lab5/report.typ @@ -0,0 +1,309 @@ +#set text(size: 1.3em) + +#show raw.where(block: false): box.with( + fill: luma(240), + inset: (x: 3pt, y: 0pt), + outset: (y: 3pt), + radius: 2pt, +) + +#show raw.where(block: true): block.with( + fill: luma(240), + inset: 10pt, + radius: 4pt, +) + +// title + +#align(center)[Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики] +\ +\ +\ +#align(center)[Факультет инфокоммуникационных технологий] +#align(center)[Направление подготовки 11.03.02] +\ +\ +#align(center)[Лабораторная работа №5] +#align(center)[Создание и использование массив] +\ +\ +\ //#align(center)[Вариант 19] +\ +\ +\ +\ +\ +\ +\ +#align(right)[Выполнил:] +#align(right)[Дощенников Никита Андреевич] +#align(right)[Группа: К3221] +#align(right)[Проверил:] +#align(right)[Иванов Сергей Евгеньевич] +\ +\ +#align(center)[Санкт-Петербург] +#align(center)[2025] + +#pagebreak() + +=== Цель работы: + +Изучить массивы и приобрести навыки работы с ними. + +=== Упражнение 1. Работа с массивом размерного типа данных. + +В этом упражнении в проекте `Loop` (из третьей лабораторной) я реализовал массив для хранения данных. + +```cs +public static void Main(string[] args) +{ + int[] myArray = {100, 1, 32, 3, 14, 25, 6, 17, 8, 99}; + int n = 10; + for (int i = 0; i < n; i++) + { + if (myArray[i] % 2 == 0) myArray[i] = 0; + + Console.Write(myArray[i] + " "); + } +} +``` + +Примеры: + +#align(center)[#image("assets/1.png")] + +```cs +public static void Main(string[] args) +{ + int[] myArray; + Console.WriteLine("input an amount of elements: "); + int n = int.Parse(Console.ReadLine()); + Console.WriteLine("input elements one by one: "); + myArray = new int[n]; + + for (int i = 0; i < myArray.Length; ++i) + { + Console.Write("a[{0}] = ", i); + myArray[i] = int.Parse(Console.ReadLine()); + } + + foreach (int x in myArray) Console.Write("{0} ", x); +} +``` + +#align(center)[#image("assets/2.png")] + +=== Упражнение 2. Перемножение матриц. + +В этом упражнении я написал программу перемножения матриц 2 на 2. + +```cs +using System; + +public class Program +{ + public static void Main(string[] args) + { + int[,] m1 = new int[2, 2]; + int[,] m2 = new int[2, 2]; + + fillQuadraticMatrix(ref m1, 2); + fillQuadraticMatrix(ref m2, 2); + + int[,] res = multiplyQuadraticMatrix(m1, m2, 2); + + printQuadraticMatrix(res, 2); + } + + static void fillQuadraticMatrix(ref int[,] m, int n) + { + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + Console.Write("m[{0}][{1}] = ", i, j); + m[i, j] = int.Parse(Console.ReadLine()); + } + } + + } + + static void printQuadraticMatrix(int[,] m, int n) + { + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + Console.Write(m[i, j] + " "); + } + Console.Write("\n"); + } + } + + static int[,] multiplyQuadraticMatrix(int[,] m1, int[,] m2, int n) + { + int[,] res = new int[n, n]; + + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + for (int k = 0; k < n; k++) + { + res[i, j] += m1[i, k] * m2[k, j]; + } + } + } + return res; + } +} +``` + +Тесты: + +#align(center)[#image("assets/3.png")] + +=== Упражнение 3. Обработка данных массива. + +В этом упражнении я написал программу, которая заполняет массив элементами пользователя и выполняет обработку данных, а именно определяет сумму всех элементов массива, среднего значения массива, расчет суммы отрицательных или положительных элементов, расчет суммы элементов с нечетными или четными номерами, находит максимальный или минимальный элемент массива и вывести их индексы, расчитать произведение элементов массива, расположенных между максимальным и минимальным элементами. + +```cs +using System; + +public class Program +{ + static int SumPos(int[] a) + { + int r = 0; + foreach (int x in a) if (x > 0) r += x; + return r; + } + + static int SumNeg(int[] a) + { + int r = 0; + foreach (int x in a) if (x < 0) r += x; + return r; + } + + static int SumArr(int[] a) => SumPos(a) + SumNeg(a); + + static double AvgArr(int[] a) => a.Length == 0 ? double.NaN : (double)SumArr(a) / a.Length; + + static int SumEvenPos(int[] a) + { + int r = 0; + for (int i = 0; i < a.Length; i += 2) r += a[i]; + return r; + } + + static int SumOddPos(int[] a) + { + int r = 0; + for (int i = 1; i < a.Length; i += 2) r += a[i]; + return r; + } + + static int MaxIdx(int[] a) + { + if (a.Length == 0) return -1; + int idx = 0, m = a[0]; + for (int i = 1; i < a.Length; i++) + if (a[i] > m) { m = a[i]; idx = i; } + return idx; + } + + static int MinIdx(int[] a) + { + if (a.Length == 0) return -1; + int idx = 0, m = a[0]; + for (int i = 1; i < a.Length; i++) + if (a[i] < m) { m = a[i]; idx = i; } + return idx; + } + + static int ProductBetweenMinMax(int[] a) + { + int start = MinIdx(a), end = MaxIdx(a); + if (start == -1 || end == -1) return -1; + if (start > end) { int t = start; start = end; end = t; } + if (end - start <= 1) return -1; + int r = 1; + for (int i = start + 1; i < end; i++) r *= a[i]; + return r; + } + + public static void Main(string[] args) + { + Console.Write("input an arr length: "); + int n = int.Parse(Console.ReadLine()); + int[] arr = new int[n]; + + for (int i = 0; i < arr.Length; i++) + { + Console.Write("arr[{0}] = ", i); + arr[i] = int.Parse(Console.ReadLine()); + } + + Console.WriteLine("sum of the array's elements is {0}", SumArr(arr)); + Console.WriteLine("avg value of the array is {0}", AvgArr(arr)); + Console.WriteLine("sum of positive array values is {0}, sum of negative array values is {1}", SumPos(arr), SumNeg(arr)); + Console.WriteLine("sum of elements on even positions is {0}, sum of elements on odd positions is {1}", SumEvenPos(arr), SumOddPos(arr)); + Console.WriteLine("index of max array element is {0}", MaxIdx(arr)); + Console.WriteLine("index of min array element is {0}", MinIdx(arr)); + Console.WriteLine("product of numbers between min and max is {0}", ProductBetweenMinMax(arr)); + } +} +``` + +Тесты: + +#align(center)[#image("assets/4.png")] + +=== Выводы. + +В ходе проделанной работы я изучил массивы и приобрел навыки работы с ними. + +=== Code review. (by #link("https://zzzcode.ai")[zzzcode.ai]) + +*Резюме* + +Код представляет собой набор функций для работы с массивами целых чисел, включая вычисление суммы положительных и отрицательных элементов, среднего значения, суммы элементов на четных и нечетных позициях, а также индексов максимального и минимального элементов. Также реализована функция для вычисления произведения элементов между минимальным и максимальным значениями. + +*Ошибка* + +Код не обрабатывает возможные исключения, такие как `FormatException` при вводе данных пользователем. Это может привести к сбоям программы, если пользователь введет некорректные данные. + +*Стиль кода* + +Стиль кода в целом соответствует стандартам C\#. Однако, использование однострочных конструкций `if` может ухудшить читаемость. Рекомендуется использовать фигурные скобки для всех условных операторов. + +*Структура кода* + +Код организован в виде статических методов внутри класса `Program`. Это позволяет легко вызывать методы из `Main`. Однако, стоит рассмотреть возможность разделения логики на несколько классов для улучшения модульности. + +*Читаемость* + +Читаемость кода в целом хорошая, но можно улучшить, добавив комментарии к методам, чтобы объяснить их назначение. Также стоит использовать более описательные имена переменных. + +*Производительность* + +Производительность кода в целом приемлема для небольших массивов. Однако, для больших массивов стоит рассмотреть возможность использования параллельных вычислений или оптимизации алгоритмов. + +*Масштабируемость* + +Код может столкнуться с проблемами масштабируемости при работе с большими массивами, особенно в методах, которые используют вложенные циклы. Рекомендуется оптимизировать алгоритмы для повышения производительности. + +*Безопасность* + +Код не содержит явных уязвимостей, но отсутствие обработки исключений может привести к сбоям. Рекомендуется добавить обработку исключений для повышения надежности. + +*Обработка ошибок* + +Обработка ошибок в коде отсутствует. Рекомендуется добавить блоки `try-catch` для обработки возможных исключений, особенно при вводе данных пользователем. + +*Заключение* + +Код выполняет свои функции, но требует улучшений в области обработки ошибок, читаемости и структуры. Рекомендуется внести изменения для повышения надежности и удобства использования. + diff --git a/labs/lab6/Book/Book.cs b/labs/lab6/Book/Book.cs new file mode 100644 index 0000000..a20720a --- /dev/null +++ b/labs/lab6/Book/Book.cs @@ -0,0 +1,64 @@ +using System; + +class Book +{ + private String author; + private String title; + private String publisher; + private int pages; + private int year; + + private static double price = 9; + + static Book() + { + price = 10; + } + + public Book() + { + + } + + + public Book(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public Book(String author, String title) + { + this.author = author; + this.title = title; + } + + public void SetBook(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public static void SetPrice(double price) + { + Book.price = price; + } + + public void Show() + { + Console.WriteLine("\nКнига:\n Автор: {0}\n Название: {1}\n Год издания: {2}\n {3} стр.\n Стоимость аренды: {4}", author, title, year, pages, Book.price); + } + + public double PriceBook(int s) + { + double cost = s * price; + return cost; + } + +} diff --git a/labs/lab6/Book/Book.csproj b/labs/lab6/Book/Book.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab6/Book/Book.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab6/Book/Program.cs b/labs/lab6/Book/Program.cs new file mode 100644 index 0000000..3e06e1d --- /dev/null +++ b/labs/lab6/Book/Program.cs @@ -0,0 +1,31 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + Book b1 = new Book(); + b1.SetBook("Пушкин А.С.", "Капитанская дочка", "Вильямс", 123, 2012); + Book.SetPrice(12); + b1.Show(); + Console.WriteLine("\n Итоговая стоимость аренды: {0} р.", b1.PriceBook(3)); + + Book b2 = new Book("Толстой Л.Н.", "Война и мир", "Наука и жизнь", 1234, 2013); + b2.Show(); + + Book b3 = new Book("Лермонтов М.Ю.", "Мцыри"); + b3.Show(); + + + Triangle t1 = new Triangle(3, 4, 5); + t1.Show(); + Console.WriteLine("perimeter = {0}", t1.Perimeter()); + Console.WriteLine("area = {0}", t1.Area()); + Console.WriteLine("does this triangle exist? {0}", t1.Exists()); + + Triangle t2 = new Triangle(3, 4, 7); + t2.Show(); + Console.WriteLine("does this triangle exist? {0}", t2.Exists()); + + } +} diff --git a/labs/lab6/Book/Triangle.cs b/labs/lab6/Book/Triangle.cs new file mode 100644 index 0000000..e06e4e8 --- /dev/null +++ b/labs/lab6/Book/Triangle.cs @@ -0,0 +1,42 @@ +using System; + +class Triangle +{ + private int a; + private int b; + private int c; + + public Triangle(int a, int b, int c) + { + this.a = a; + this.b = b; + this.c = c; + } + + public void Show() + { + Console.WriteLine("a: {0}\nb: {1}\nc: {2}", a, b, c); + } + + public int Perimeter() + { + return a + b + c; + } + + public double Area() + { + double p = Perimeter() / 2; + return Math.Sqrt(p * (p - a) * (p - b) * (p - c)); + } + + public bool Exists() + { + if (a <= 0 || b <= 0 || c <= 0) return false; + + double maxSide = Math.Max(Math.Max(a, b), Math.Max(b, c)); + + if (maxSide >= a + b + c - maxSide) return false; + + return true; + } +} diff --git a/labs/lab6/Book/bin/Debug/net9.0/Book b/labs/lab6/Book/bin/Debug/net9.0/Book new file mode 100755 index 0000000..2ab4779 Binary files /dev/null and b/labs/lab6/Book/bin/Debug/net9.0/Book differ diff --git a/labs/lab6/Book/bin/Debug/net9.0/Book.deps.json b/labs/lab6/Book/bin/Debug/net9.0/Book.deps.json new file mode 100644 index 0000000..42ae985 --- /dev/null +++ b/labs/lab6/Book/bin/Debug/net9.0/Book.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Book/1.0.0": { + "runtime": { + "Book.dll": {} + } + } + } + }, + "libraries": { + "Book/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab6/Book/bin/Debug/net9.0/Book.dll b/labs/lab6/Book/bin/Debug/net9.0/Book.dll new file mode 100644 index 0000000..a564557 Binary files /dev/null and b/labs/lab6/Book/bin/Debug/net9.0/Book.dll differ diff --git a/labs/lab6/Book/bin/Debug/net9.0/Book.pdb b/labs/lab6/Book/bin/Debug/net9.0/Book.pdb new file mode 100644 index 0000000..ae7eccf Binary files /dev/null and b/labs/lab6/Book/bin/Debug/net9.0/Book.pdb differ diff --git a/labs/lab6/Book/bin/Debug/net9.0/Book.runtimeconfig.json b/labs/lab6/Book/bin/Debug/net9.0/Book.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab6/Book/bin/Debug/net9.0/Book.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab6/Book/obj/Book.csproj.nuget.dgspec.json b/labs/lab6/Book/obj/Book.csproj.nuget.dgspec.json new file mode 100644 index 0000000..b33d7c2 --- /dev/null +++ b/labs/lab6/Book/obj/Book.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab6/Book/Book.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab6/Book/Book.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab6/Book/Book.csproj", + "projectName": "Book", + "projectPath": "/home/nik/oop/labs/lab6/Book/Book.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab6/Book/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab6/Book/obj/Book.csproj.nuget.g.props b/labs/lab6/Book/obj/Book.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab6/Book/obj/Book.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab6/Book/obj/Book.csproj.nuget.g.targets b/labs/lab6/Book/obj/Book.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab6/Book/obj/Book.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab6/Book/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab6/Book/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab6/Book/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.AssemblyInfo.cs b/labs/lab6/Book/obj/Debug/net9.0/Book.AssemblyInfo.cs new file mode 100644 index 0000000..c08d856 --- /dev/null +++ b/labs/lab6/Book/obj/Debug/net9.0/Book.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Book")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+83c6a0637a0884d0045ccdda53c229410f964e7d")] +[assembly: System.Reflection.AssemblyProductAttribute("Book")] +[assembly: System.Reflection.AssemblyTitleAttribute("Book")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.AssemblyInfoInputs.cache b/labs/lab6/Book/obj/Debug/net9.0/Book.AssemblyInfoInputs.cache new file mode 100644 index 0000000..7b0d4cc --- /dev/null +++ b/labs/lab6/Book/obj/Debug/net9.0/Book.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +48015d2ed9b8286cbddc35f9427e7fe648ed493a5704c3bab7b74917d37f4169 diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab6/Book/obj/Debug/net9.0/Book.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..7693eab --- /dev/null +++ b/labs/lab6/Book/obj/Debug/net9.0/Book.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Book +build_property.ProjectDir = /home/nik/oop/labs/lab6/Book/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.GlobalUsings.g.cs b/labs/lab6/Book/obj/Debug/net9.0/Book.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab6/Book/obj/Debug/net9.0/Book.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.assets.cache b/labs/lab6/Book/obj/Debug/net9.0/Book.assets.cache new file mode 100644 index 0000000..7fb379d Binary files /dev/null and b/labs/lab6/Book/obj/Debug/net9.0/Book.assets.cache differ diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.csproj.CoreCompileInputs.cache b/labs/lab6/Book/obj/Debug/net9.0/Book.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..689d3a7 --- /dev/null +++ b/labs/lab6/Book/obj/Debug/net9.0/Book.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +2faabec596fcdbf5e724bf08006addca0113d5bf7018a6edb9fe97fd3d2f1d25 diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.csproj.FileListAbsolute.txt b/labs/lab6/Book/obj/Debug/net9.0/Book.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..d94cc33 --- /dev/null +++ b/labs/lab6/Book/obj/Debug/net9.0/Book.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab6/Book/bin/Debug/net9.0/Book +/home/nik/oop/labs/lab6/Book/bin/Debug/net9.0/Book.deps.json +/home/nik/oop/labs/lab6/Book/bin/Debug/net9.0/Book.runtimeconfig.json +/home/nik/oop/labs/lab6/Book/bin/Debug/net9.0/Book.dll +/home/nik/oop/labs/lab6/Book/bin/Debug/net9.0/Book.pdb +/home/nik/oop/labs/lab6/Book/obj/Debug/net9.0/Book.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab6/Book/obj/Debug/net9.0/Book.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab6/Book/obj/Debug/net9.0/Book.AssemblyInfo.cs +/home/nik/oop/labs/lab6/Book/obj/Debug/net9.0/Book.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab6/Book/obj/Debug/net9.0/Book.dll +/home/nik/oop/labs/lab6/Book/obj/Debug/net9.0/refint/Book.dll +/home/nik/oop/labs/lab6/Book/obj/Debug/net9.0/Book.pdb +/home/nik/oop/labs/lab6/Book/obj/Debug/net9.0/Book.genruntimeconfig.cache +/home/nik/oop/labs/lab6/Book/obj/Debug/net9.0/ref/Book.dll diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.dll b/labs/lab6/Book/obj/Debug/net9.0/Book.dll new file mode 100644 index 0000000..a564557 Binary files /dev/null and b/labs/lab6/Book/obj/Debug/net9.0/Book.dll differ diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.genruntimeconfig.cache b/labs/lab6/Book/obj/Debug/net9.0/Book.genruntimeconfig.cache new file mode 100644 index 0000000..6113f63 --- /dev/null +++ b/labs/lab6/Book/obj/Debug/net9.0/Book.genruntimeconfig.cache @@ -0,0 +1 @@ +2452364a71f303ed10f59034cc77792f2db009c3bf86117b7c2ecac4195e9088 diff --git a/labs/lab6/Book/obj/Debug/net9.0/Book.pdb b/labs/lab6/Book/obj/Debug/net9.0/Book.pdb new file mode 100644 index 0000000..ae7eccf Binary files /dev/null and b/labs/lab6/Book/obj/Debug/net9.0/Book.pdb differ diff --git a/labs/lab6/Book/obj/Debug/net9.0/apphost b/labs/lab6/Book/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..2ab4779 Binary files /dev/null and b/labs/lab6/Book/obj/Debug/net9.0/apphost differ diff --git a/labs/lab6/Book/obj/Debug/net9.0/ref/Book.dll b/labs/lab6/Book/obj/Debug/net9.0/ref/Book.dll new file mode 100644 index 0000000..371a8d4 Binary files /dev/null and b/labs/lab6/Book/obj/Debug/net9.0/ref/Book.dll differ diff --git a/labs/lab6/Book/obj/Debug/net9.0/refint/Book.dll b/labs/lab6/Book/obj/Debug/net9.0/refint/Book.dll new file mode 100644 index 0000000..371a8d4 Binary files /dev/null and b/labs/lab6/Book/obj/Debug/net9.0/refint/Book.dll differ diff --git a/labs/lab6/Book/obj/project.assets.json b/labs/lab6/Book/obj/project.assets.json new file mode 100644 index 0000000..4c5b938 --- /dev/null +++ b/labs/lab6/Book/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab6/Book/Book.csproj", + "projectName": "Book", + "projectPath": "/home/nik/oop/labs/lab6/Book/Book.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab6/Book/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab6/Book/obj/project.nuget.cache b/labs/lab6/Book/obj/project.nuget.cache new file mode 100644 index 0000000..7d1dbab --- /dev/null +++ b/labs/lab6/Book/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "ny3c6FZ8xC0=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab6/Book/Book.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab6/assets/1.png b/labs/lab6/assets/1.png new file mode 100644 index 0000000..43da527 Binary files /dev/null and b/labs/lab6/assets/1.png differ diff --git a/labs/lab6/assets/2.png b/labs/lab6/assets/2.png new file mode 100644 index 0000000..e5b5e9a Binary files /dev/null and b/labs/lab6/assets/2.png differ diff --git a/labs/lab6/assets/3.png b/labs/lab6/assets/3.png new file mode 100644 index 0000000..bb6640f Binary files /dev/null and b/labs/lab6/assets/3.png differ diff --git a/labs/lab6/report.pdf b/labs/lab6/report.pdf new file mode 100644 index 0000000..e4c19de Binary files /dev/null and b/labs/lab6/report.pdf differ diff --git a/labs/lab6/report.typ b/labs/lab6/report.typ new file mode 100644 index 0000000..b37ab92 --- /dev/null +++ b/labs/lab6/report.typ @@ -0,0 +1,287 @@ +#set text(size: 1.3em) + +#show raw.where(block: false): box.with( + fill: luma(240), + inset: (x: 3pt, y: 0pt), + outset: (y: 3pt), + radius: 2pt, +) + +#show raw.where(block: true): block.with( + fill: luma(240), + inset: 10pt, + radius: 4pt, +) + +// title + +#align(center)[Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики] +\ +\ +\ +#align(center)[Факультет инфокоммуникационных технологий] +#align(center)[Направление подготовки 11.03.02] +\ +\ +#align(center)[Лабораторная работа №6] +#align(center)[Создание и использование классов] +\ +\ +\ //#align(center)[Вариант 19] +\ +\ +\ +\ +\ +\ +\ +#align(right)[Выполнил:] +#align(right)[Дощенников Никита Андреевич] +#align(right)[Группа: К3221] +#align(right)[Проверил:] +#align(right)[Иванов Сергей Евгеньевич] +\ +\ +#align(center)[Санкт-Петербург] +#align(center)[2025] + +#pagebreak() + +=== Цель работы: + +Изучить понятия класса как пользовательского типа данных и приобрести навыки работы с классами. + +=== Упражнение 1. Разработка класса Book. + +В этом упражнении я создал класс `Book` c полями автор, название, год издания и стоимость аренды за книгу, а также методами. + +```cs +using System; + +class Book +{ + private String author; + private String title; + private String publisher; + private int pages; + private int year; + + private static double price = 9; + + static Book() + { + price = 10; + } + + public Book() + { + + } + + + public Book(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public Book(String author, String title) + { + this.author = author; + this.title = title; + } + + public void SetBook(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public static void SetPrice(double price) + { + Book.price = price; + } + + public void Show() + { + Console.WriteLine("\nКнига:\n Автор: {0}\n Название: {1}\n Год издания: {2}\n {3} стр.\n Стоимость аренды: {4}", author, title, year, pages, Book.price); + } + + public double PriceBook(int s) + { + double cost = s * price; + return cost; + } + +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Book b1 = new Book(); + b1.SetBook("Пушкин А.С.", "Капитанская дочка", "Вильямс", 123, 2012); + Book.SetPrice(12); + b1.Show(); + Console.WriteLine("\n Итоговая стоимость аренды: {0} р.", b1.PriceBook(3)); +} +``` + +Пример: + +#align(center)[#image("assets/1.png")] + +=== Упражнение 2. Использование конструкторов. + +В этом упражнении я добавил конструктор для инициализации объекта. + +Тесты: + +```cs +public static void Main(string[] args) +{ + Book b1 = new Book(); + b1.SetBook("Пушкин А.С.", "Капитанская дочка", "Вильямс", 123, 2012); + Book.SetPrice(12); + b1.Show(); + Console.WriteLine("\n Итоговая стоимость аренды: {0} р.", b1.PriceBook(3)); + + Book b2 = new Book("Толстой Л.Н.", "Война и мир", "Наука и жизнь", 1234, 2013); + b2.Show(); + + Book b3 = new Book("Лермонтов М.Ю.", "Мцыри"); + b3.Show(); +} +``` + +Примеры: + +#align(center)[#image("assets/2.png")] + +=== Упражнение 3. Реализация класса Triangle. + +В этом упражнении я создал класс Triangle и разработал следующие элементы класса: + +- Поля: стороны треугольника. +- Конструктор, позволяющий создать экземпляр класса с заданными длинами сторон. +- Методы, позволяющие вывести длины сторон треугольника на экран, расчитать периметр треугольника, расчитать площадь треугольника, реализовать проверку, позволяющую установить, существует ли треугольник с данными длинами сторон. + +```cs +using System; + +class Triangle +{ + private int a; + private int b; + private int c; + + public Triangle(int a, int b, int c) + { + this.a = a; + this.b = b; + this.c = c; + } + + public void Show() + { + Console.WriteLine("a: {0}\nb: {1}\nc: {2}", a, b, c); + } + + public int Perimeter() + { + return a + b + c; + } + + public double Area() + { + double p = Perimeter() / 2; + return Math.Sqrt(p * (p - a) * (p - b) * (p - c)); + } + + public bool Exists() + { + if (a <= 0 || b <= 0 || c <= 0) return false; + + double maxSide = Math.Max(Math.Max(a, b), Math.Max(b, c)); + + if (maxSide >= a + b + c - maxSide) return false; + + return true; + } +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Triangle t1 = new Triangle(3, 4, 5); + t1.Show(); + Console.WriteLine("perimeter = {0}", t1.Perimeter()); + Console.WriteLine("area = {0}", t1.Area()); + Console.WriteLine("does this triangle exist? {0}", t1.Exists()); + + Triangle t2 = new Triangle(3, 4, 7); + t2.Show(); + Console.WriteLine("does this triangle exist? {0}", t2.Exists()); +} +``` + +Пример: + +#align(center)[#image("assets/3.png")] + +=== Выводы. + +В ходе проделанной работы я изучил понятия класса как пользовательского типа данных и приобрел навыки работы с классами. + +=== Code review. (by #link("https://zzzcode.ai")[zzzcode.ai]) + +*Резюме* + +Код, представленный выше, реализует два класса: `Book` и `Triangle`. Класс `Book` управляет информацией о книгах, включая автора, название, издателя, количество страниц и год издания. Класс `Triangle` отвечает за свойства треугольника, такие как стороны, периметр и площадь. В целом, код демонстрирует базовые принципы объектно-ориентированного программирования, но требует улучшений в области стиля, структуры и обработки ошибок. + +*Ошибка* + +В классе `Book` метод `SetBook` не проверяет входные параметры на корректность. Например, количество страниц и год издания могут быть отрицательными значениями. Это может привести к некорректным данным. Рекомендуется добавить валидацию входных данных. + +*Стиль кода* + +Код написан в целом в соответствии с общепринятыми стандартами C\#. Однако, использование типа `String` вместо `string` не является стандартным стилем C\#. Рекомендуется использовать `string` для повышения читаемости и соответствия стилю C\#. + +*Структура кода* + +Структура классов в целом логична, но методы и свойства можно было бы организовать более последовательно. Например, методы, связанные с установкой и получением значений, можно сгруппировать вместе. Это улучшит читаемость и упростит навигацию по коду. + +*Читаемость* + +Читаемость кода можно улучшить, добавив комментарии к методам и классам, чтобы объяснить их назначение. Также стоит использовать более описательные имена переменных и методов, чтобы сделать код более самодокументируемым. + +*Производительность* + +Код не содержит явных проблем с производительностью, однако использование статического поля `price` может быть улучшено. Если цена книги должна быть уникальной для каждого экземпляра, лучше сделать это полем экземпляра. + +*Масштабируемость* + +Код может быть сложно масштабировать из-за жесткой привязки к конкретным полям и методам. Рекомендуется рассмотреть возможность использования интерфейсов или абстрактных классов для улучшения гибкости и расширяемости. + +*Безопасность* + +Код не содержит явных уязвимостей, однако отсутствие валидации входных данных может привести к проблемам. Рекомендуется добавить проверки на корректность данных, чтобы избежать потенциальных ошибок. + +*Обработка ошибок* + +Обработка ошибок в коде отсутствует. Рекомендуется использовать исключения для обработки некорректных данных и других возможных ошибок, чтобы обеспечить более надежное выполнение программы. + +*Заключение* + +Код представляет собой хорошую основу для работы с книгами и треугольниками, но требует улучшений в области стиля, структуры и обработки ошибок. Внедрение предложенных изменений повысит качество кода и упростит его поддержку в будущем. diff --git a/labs/lab7/Igra/Gamer.cs b/labs/lab7/Igra/Gamer.cs new file mode 100644 index 0000000..9e16afb --- /dev/null +++ b/labs/lab7/Igra/Gamer.cs @@ -0,0 +1,23 @@ +using System; + +class Gamer +{ + string Name; + IgralnayaKost seans; + + public Gamer(string name) + { + Name = name; + seans = new IgralnayaKost(); + } + + public int SeansGame() + { + return seans.random(); + } + + public override string ToString() + { + return Name; + } +} diff --git a/labs/lab7/Igra/Igra.csproj b/labs/lab7/Igra/Igra.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab7/Igra/Igra.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab7/Igra/IgralnayaKost.cs b/labs/lab7/Igra/IgralnayaKost.cs new file mode 100644 index 0000000..1c43dd5 --- /dev/null +++ b/labs/lab7/Igra/IgralnayaKost.cs @@ -0,0 +1,17 @@ +using System; + +class IgralnayaKost +{ + Random r; + + public IgralnayaKost() + { + r = new Random(); + } + + public int random() + { + int res = r.Next(6) + 1; + return res; + } +} diff --git a/labs/lab7/Igra/Program.cs b/labs/lab7/Igra/Program.cs new file mode 100644 index 0000000..f3c9b2b --- /dev/null +++ b/labs/lab7/Igra/Program.cs @@ -0,0 +1,14 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + Gamer g1 = new Gamer("Niko"); + + for (int i = 1; i <= 6; i++) + { + Console.WriteLine("Выпало количество очков {0} для игрока {1}", g1.SeansGame(), g1.ToString()); + } + } +} diff --git a/labs/lab7/Igra/bin/Debug/net9.0/Igra b/labs/lab7/Igra/bin/Debug/net9.0/Igra new file mode 100755 index 0000000..0ca2e3f Binary files /dev/null and b/labs/lab7/Igra/bin/Debug/net9.0/Igra differ diff --git a/labs/lab7/Igra/bin/Debug/net9.0/Igra.deps.json b/labs/lab7/Igra/bin/Debug/net9.0/Igra.deps.json new file mode 100644 index 0000000..fe13766 --- /dev/null +++ b/labs/lab7/Igra/bin/Debug/net9.0/Igra.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Igra/1.0.0": { + "runtime": { + "Igra.dll": {} + } + } + } + }, + "libraries": { + "Igra/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab7/Igra/bin/Debug/net9.0/Igra.dll b/labs/lab7/Igra/bin/Debug/net9.0/Igra.dll new file mode 100644 index 0000000..15d9449 Binary files /dev/null and b/labs/lab7/Igra/bin/Debug/net9.0/Igra.dll differ diff --git a/labs/lab7/Igra/bin/Debug/net9.0/Igra.pdb b/labs/lab7/Igra/bin/Debug/net9.0/Igra.pdb new file mode 100644 index 0000000..4e66e31 Binary files /dev/null and b/labs/lab7/Igra/bin/Debug/net9.0/Igra.pdb differ diff --git a/labs/lab7/Igra/bin/Debug/net9.0/Igra.runtimeconfig.json b/labs/lab7/Igra/bin/Debug/net9.0/Igra.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab7/Igra/bin/Debug/net9.0/Igra.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab7/Igra/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab7/Igra/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab7/Igra/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfo.cs b/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfo.cs new file mode 100644 index 0000000..184239b --- /dev/null +++ b/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Igra")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8c63118e20b76593817b5efc05943736b1cf730a")] +[assembly: System.Reflection.AssemblyProductAttribute("Igra")] +[assembly: System.Reflection.AssemblyTitleAttribute("Igra")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfoInputs.cache b/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfoInputs.cache new file mode 100644 index 0000000..c4e9caf --- /dev/null +++ b/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +05d5c8d28f18bf5c246094e88fc33948b0dac62f39381b4b360ad08d07b89dd2 diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab7/Igra/obj/Debug/net9.0/Igra.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..1551287 --- /dev/null +++ b/labs/lab7/Igra/obj/Debug/net9.0/Igra.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Igra +build_property.ProjectDir = /home/nik/oop/labs/lab7/Igra/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.GlobalUsings.g.cs b/labs/lab7/Igra/obj/Debug/net9.0/Igra.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab7/Igra/obj/Debug/net9.0/Igra.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.assets.cache b/labs/lab7/Igra/obj/Debug/net9.0/Igra.assets.cache new file mode 100644 index 0000000..0c9eaac Binary files /dev/null and b/labs/lab7/Igra/obj/Debug/net9.0/Igra.assets.cache differ diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.csproj.CoreCompileInputs.cache b/labs/lab7/Igra/obj/Debug/net9.0/Igra.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..d900273 --- /dev/null +++ b/labs/lab7/Igra/obj/Debug/net9.0/Igra.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +965f402a393a8b3c3615bdffcb747854f7dda4ef84f8cdb7176cc338c3ebeb3f diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.csproj.FileListAbsolute.txt b/labs/lab7/Igra/obj/Debug/net9.0/Igra.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..9ee22b9 --- /dev/null +++ b/labs/lab7/Igra/obj/Debug/net9.0/Igra.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra.deps.json +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra.runtimeconfig.json +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra.dll +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra.pdb +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfo.cs +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.dll +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/refint/Igra.dll +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.pdb +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.genruntimeconfig.cache +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/ref/Igra.dll diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.dll b/labs/lab7/Igra/obj/Debug/net9.0/Igra.dll new file mode 100644 index 0000000..15d9449 Binary files /dev/null and b/labs/lab7/Igra/obj/Debug/net9.0/Igra.dll differ diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.genruntimeconfig.cache b/labs/lab7/Igra/obj/Debug/net9.0/Igra.genruntimeconfig.cache new file mode 100644 index 0000000..8d1dd5a --- /dev/null +++ b/labs/lab7/Igra/obj/Debug/net9.0/Igra.genruntimeconfig.cache @@ -0,0 +1 @@ +59af8060a39fe66547924f2ecd51abdbe7484d6060668c2551dae0c99bc6f070 diff --git a/labs/lab7/Igra/obj/Debug/net9.0/Igra.pdb b/labs/lab7/Igra/obj/Debug/net9.0/Igra.pdb new file mode 100644 index 0000000..4e66e31 Binary files /dev/null and b/labs/lab7/Igra/obj/Debug/net9.0/Igra.pdb differ diff --git a/labs/lab7/Igra/obj/Debug/net9.0/apphost b/labs/lab7/Igra/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..0ca2e3f Binary files /dev/null and b/labs/lab7/Igra/obj/Debug/net9.0/apphost differ diff --git a/labs/lab7/Igra/obj/Debug/net9.0/ref/Igra.dll b/labs/lab7/Igra/obj/Debug/net9.0/ref/Igra.dll new file mode 100644 index 0000000..b96de09 Binary files /dev/null and b/labs/lab7/Igra/obj/Debug/net9.0/ref/Igra.dll differ diff --git a/labs/lab7/Igra/obj/Debug/net9.0/refint/Igra.dll b/labs/lab7/Igra/obj/Debug/net9.0/refint/Igra.dll new file mode 100644 index 0000000..b96de09 Binary files /dev/null and b/labs/lab7/Igra/obj/Debug/net9.0/refint/Igra.dll differ diff --git a/labs/lab7/Igra/obj/Igra.csproj.nuget.dgspec.json b/labs/lab7/Igra/obj/Igra.csproj.nuget.dgspec.json new file mode 100644 index 0000000..7cab9d4 --- /dev/null +++ b/labs/lab7/Igra/obj/Igra.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab7/Igra/Igra.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab7/Igra/Igra.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab7/Igra/Igra.csproj", + "projectName": "Igra", + "projectPath": "/home/nik/oop/labs/lab7/Igra/Igra.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab7/Igra/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab7/Igra/obj/Igra.csproj.nuget.g.props b/labs/lab7/Igra/obj/Igra.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab7/Igra/obj/Igra.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab7/Igra/obj/Igra.csproj.nuget.g.targets b/labs/lab7/Igra/obj/Igra.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab7/Igra/obj/Igra.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab7/Igra/obj/project.assets.json b/labs/lab7/Igra/obj/project.assets.json new file mode 100644 index 0000000..deaf98a --- /dev/null +++ b/labs/lab7/Igra/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab7/Igra/Igra.csproj", + "projectName": "Igra", + "projectPath": "/home/nik/oop/labs/lab7/Igra/Igra.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab7/Igra/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab7/Igra/obj/project.nuget.cache b/labs/lab7/Igra/obj/project.nuget.cache new file mode 100644 index 0000000..03d5dfd --- /dev/null +++ b/labs/lab7/Igra/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "DiS1VZPvPF4=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab7/Igra/Igra.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab7/MyClass/Book.cs b/labs/lab7/MyClass/Book.cs new file mode 100644 index 0000000..1b932a4 --- /dev/null +++ b/labs/lab7/MyClass/Book.cs @@ -0,0 +1,77 @@ +using System; + +class Book : Item +{ + private String author; + private String title; + private String publisher; + private int pages; + private int year; + private bool returnSrok; + + private static double price = 9; + + static Book() + { + price = 10; + } + + public Book() + { + + } + + + public Book(String author, String title, String publisher, int pages, int year, long invNumber, bool taken) : base (invNumber, taken) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public Book(String author, String title) + { + this.author = author; + this.title = title; + } + + public void SetBook(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public static void SetPrice(double price) + { + Book.price = price; + } + + + public override void Show() + { + Console.WriteLine("\nКнига:\n Автор: {0}\n Название: {1}\n Год издания: {2}\n {3} стр.\n Стоимость аренды: {4}", author, title, year, pages, Book.price); + base.Show(); + } + + + public double PriceBook(int s) + { + double cost = s * price; + return cost; + } + + public void ReturnSrok() + { + returnSrok = true; + } + + public override void Return() + { + taken = returnSrok; + } +} diff --git a/labs/lab7/MyClass/Item.cs b/labs/lab7/MyClass/Item.cs new file mode 100644 index 0000000..97494d2 --- /dev/null +++ b/labs/lab7/MyClass/Item.cs @@ -0,0 +1,47 @@ +using System; + +abstract class Item +{ + protected long invNumber; + protected bool taken; + + public Item(long invNumber, bool taken) + { + this.invNumber = invNumber; + this.taken = taken; + } + + public Item() + { + this.taken = true; + } + + public bool IsAvailable() + { + return taken; + } + + public long GetInvNumber() + { + return invNumber; + } + + private void Take() + { + taken = false; + } + + public void TakeItem() + { + if (this.IsAvailable()) + this.Take(); + } + + + abstract public void Return(); + + public virtual void Show() + { + Console.WriteLine("Состояние единицы хранения:\n Инвентарный номер: {0}\n Наличие: {1}", invNumber, taken); + } +} diff --git a/labs/lab7/MyClass/Magazine.cs b/labs/lab7/MyClass/Magazine.cs new file mode 100644 index 0000000..bc325e8 --- /dev/null +++ b/labs/lab7/MyClass/Magazine.cs @@ -0,0 +1,33 @@ +using System; + +class Magazine : Item +{ + private String volume; + private int number; + private String title; + private int year; + + public Magazine(String volume, int number, String title, int year, long invNumber, bool taken) : base(invNumber, taken) + { + this.volume = volume; + this.number = number; + this.title = title; + this.year = year; + } + + public Magazine() + {} + + public override void Show() + { + Console.WriteLine("\nЖурнал:\n Том: {0}\n Номер: {1}\n Название: {2}\n Год выпуска: {3}", volume, number, title, year); + base.Show(); + } + + + public override void Return() + { + taken = true; + } + +} diff --git a/labs/lab7/MyClass/MyClass.csproj b/labs/lab7/MyClass/MyClass.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab7/MyClass/MyClass.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab7/MyClass/Program.cs b/labs/lab7/MyClass/Program.cs new file mode 100644 index 0000000..368e597 --- /dev/null +++ b/labs/lab7/MyClass/Program.cs @@ -0,0 +1,59 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + /* + Book b1 = new Book(); + b1.SetBook("Пушкин А.С.", "Капитанская дочка", "Вильямс", 123, 2012); + Book.SetPrice(12); + b1.Show(); + Console.WriteLine("\n Итоговая стоимость аренды: {0} р.", b1.PriceBook(3)); + + Book b2 = new Book("Толстой Л.Н.", "Война и мир", "Наука и жизнь", 1234, 2013); + b2.Show(); + + Book b3 = new Book("Лермонтов М.Ю.", "Мцыри"); + b3.Show(); + + + Triangle t1 = new Triangle(3, 4, 5); + t1.Show(); + Console.WriteLine("perimeter = {0}", t1.Perimeter()); + Console.WriteLine("area = {0}", t1.Area()); + Console.WriteLine("does this triangle exist? {0}", t1.Exists()); + + Triangle t2 = new Triangle(3, 4, 7); + t2.Show(); + Console.WriteLine("does this triangle exist? {0}", t2.Exists()); + */ + + // Item item1 = new Item(); + // item1.Show(); + + Book b2 = new Book("Толстой Л. Н.", "Война и мир", "Наука и жизнь", 1234, 2013, 101, true); + + b2.Show(); + b2.TakeItem(); + b2.Show(); + + + Magazine mag1 = new Magazine("О природе", 5, "Земля и мы", 2014, 1235, true); + mag1.Show(); + + Console.WriteLine("\n Тестирование полиформизма"); + Item it; + + it = b2; + it.TakeItem(); + it.Return(); + it.Show(); + + it = mag1; + it.TakeItem(); + it.Return(); + it.Show(); + + } +} diff --git a/labs/lab7/MyClass/Triangle.cs b/labs/lab7/MyClass/Triangle.cs new file mode 100644 index 0000000..e06e4e8 --- /dev/null +++ b/labs/lab7/MyClass/Triangle.cs @@ -0,0 +1,42 @@ +using System; + +class Triangle +{ + private int a; + private int b; + private int c; + + public Triangle(int a, int b, int c) + { + this.a = a; + this.b = b; + this.c = c; + } + + public void Show() + { + Console.WriteLine("a: {0}\nb: {1}\nc: {2}", a, b, c); + } + + public int Perimeter() + { + return a + b + c; + } + + public double Area() + { + double p = Perimeter() / 2; + return Math.Sqrt(p * (p - a) * (p - b) * (p - c)); + } + + public bool Exists() + { + if (a <= 0 || b <= 0 || c <= 0) return false; + + double maxSide = Math.Max(Math.Max(a, b), Math.Max(b, c)); + + if (maxSide >= a + b + c - maxSide) return false; + + return true; + } +} diff --git a/labs/lab7/MyClass/bin/Debug/net9.0/MyClass b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass new file mode 100755 index 0000000..0610dad Binary files /dev/null and b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass differ diff --git a/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.deps.json b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.deps.json new file mode 100644 index 0000000..7960ce5 --- /dev/null +++ b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "MyClass/1.0.0": { + "runtime": { + "MyClass.dll": {} + } + } + } + }, + "libraries": { + "MyClass/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.dll b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.dll new file mode 100644 index 0000000..aa6b49e Binary files /dev/null and b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.dll differ diff --git a/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.pdb b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.pdb new file mode 100644 index 0000000..df43a45 Binary files /dev/null and b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.pdb differ diff --git a/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab7/MyClass/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab7/MyClass/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs new file mode 100644 index 0000000..52b7810 --- /dev/null +++ b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("MyClass")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8c63118e20b76593817b5efc05943736b1cf730a")] +[assembly: System.Reflection.AssemblyProductAttribute("MyClass")] +[assembly: System.Reflection.AssemblyTitleAttribute("MyClass")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache new file mode 100644 index 0000000..d97f8b4 --- /dev/null +++ b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +3c58198e9da904dcc7f71dfdc0c33c0196589953894183afdc08d515002a274c diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..f4fdcdf --- /dev/null +++ b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = MyClass +build_property.ProjectDir = /home/nik/oop/labs/lab7/MyClass/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.GlobalUsings.g.cs b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.assets.cache b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.assets.cache new file mode 100644 index 0000000..722a5e1 Binary files /dev/null and b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.assets.cache differ diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..63e0a08 --- /dev/null +++ b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +a9016e4d6a465816afe7a161ced41d1e99d5343896d13f2f5f5d854dc6c5fd2d diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.csproj.FileListAbsolute.txt b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..077543b --- /dev/null +++ b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.deps.json +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/refint/MyClass.dll +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/ref/MyClass.dll diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.dll b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.dll new file mode 100644 index 0000000..aa6b49e Binary files /dev/null and b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.dll differ diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache new file mode 100644 index 0000000..0d5ef0c --- /dev/null +++ b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache @@ -0,0 +1 @@ +cf9b031d6181c3e3db59efe4db6ebc6737086e3359187410580364e3ae497f75 diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.pdb b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.pdb new file mode 100644 index 0000000..df43a45 Binary files /dev/null and b/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.pdb differ diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/apphost b/labs/lab7/MyClass/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..0610dad Binary files /dev/null and b/labs/lab7/MyClass/obj/Debug/net9.0/apphost differ diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/ref/MyClass.dll b/labs/lab7/MyClass/obj/Debug/net9.0/ref/MyClass.dll new file mode 100644 index 0000000..d3f49f5 Binary files /dev/null and b/labs/lab7/MyClass/obj/Debug/net9.0/ref/MyClass.dll differ diff --git a/labs/lab7/MyClass/obj/Debug/net9.0/refint/MyClass.dll b/labs/lab7/MyClass/obj/Debug/net9.0/refint/MyClass.dll new file mode 100644 index 0000000..d3f49f5 Binary files /dev/null and b/labs/lab7/MyClass/obj/Debug/net9.0/refint/MyClass.dll differ diff --git a/labs/lab7/MyClass/obj/MyClass.csproj.nuget.dgspec.json b/labs/lab7/MyClass/obj/MyClass.csproj.nuget.dgspec.json new file mode 100644 index 0000000..66b2564 --- /dev/null +++ b/labs/lab7/MyClass/obj/MyClass.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab7/MyClass/MyClass.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab7/MyClass/MyClass.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab7/MyClass/MyClass.csproj", + "projectName": "MyClass", + "projectPath": "/home/nik/oop/labs/lab7/MyClass/MyClass.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab7/MyClass/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab7/MyClass/obj/MyClass.csproj.nuget.g.props b/labs/lab7/MyClass/obj/MyClass.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab7/MyClass/obj/MyClass.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab7/MyClass/obj/MyClass.csproj.nuget.g.targets b/labs/lab7/MyClass/obj/MyClass.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab7/MyClass/obj/MyClass.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab7/MyClass/obj/project.assets.json b/labs/lab7/MyClass/obj/project.assets.json new file mode 100644 index 0000000..26778a8 --- /dev/null +++ b/labs/lab7/MyClass/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab7/MyClass/MyClass.csproj", + "projectName": "MyClass", + "projectPath": "/home/nik/oop/labs/lab7/MyClass/MyClass.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab7/MyClass/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab7/MyClass/obj/project.nuget.cache b/labs/lab7/MyClass/obj/project.nuget.cache new file mode 100644 index 0000000..fe2647b --- /dev/null +++ b/labs/lab7/MyClass/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "VNfUtU6tkz0=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab7/MyClass/MyClass.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab7/MyClassLine/Line.cs b/labs/lab7/MyClassLine/Line.cs new file mode 100644 index 0000000..ef5a2df --- /dev/null +++ b/labs/lab7/MyClassLine/Line.cs @@ -0,0 +1,26 @@ +using System; + +class Line +{ + private Point pStart; + private Point pEnd; + + public Line(Point pStart, Point pEnd) + { + this.pStart = pStart; + this.pEnd = pEnd; + } + + public Line() + { } + + public void Show() + { + Console.WriteLine("Отрезок с координатами: ({0}) - ({1})", pStart, pEnd); + } + + public double DlinL() + { + return pStart.Dlina(pEnd); + } +} diff --git a/labs/lab7/MyClassLine/MyClassLine.csproj b/labs/lab7/MyClassLine/MyClassLine.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab7/MyClassLine/MyClassLine.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab7/MyClassLine/Point.cs b/labs/lab7/MyClassLine/Point.cs new file mode 100644 index 0000000..c894607 --- /dev/null +++ b/labs/lab7/MyClassLine/Point.cs @@ -0,0 +1,33 @@ +using System; + +class Point +{ + private double x; + private double y; + + public Point(double x, double y) + { + this.x = x; + this.y = y; + } + + public Point () + {} + + public void Show() + { + Console.WriteLine("Точка с координатами: ({0}, {1})", x, y); + } + + public double Dlina(Point p) + { + double Dl = Math.Sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y)); + return Dl; + } + + public override string ToString() + { + string ss = x + " ; " + y; + return ss; + } +} diff --git a/labs/lab7/MyClassLine/Program.cs b/labs/lab7/MyClassLine/Program.cs new file mode 100644 index 0000000..0548b33 --- /dev/null +++ b/labs/lab7/MyClassLine/Program.cs @@ -0,0 +1,18 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + Point p1 = new Point(); + p1.Show(); + Point p2 = new Point(12, 13); + p2.Show(); + + Line line = new Line(p1, p2); + line.Show(); + + double dtr = line.DlinL(); + Console.WriteLine("Длина отрезка " + dtr); + } +} diff --git a/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine new file mode 100755 index 0000000..8a405ec Binary files /dev/null and b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine differ diff --git a/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.deps.json b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.deps.json new file mode 100644 index 0000000..196c6e3 --- /dev/null +++ b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "MyClassLine/1.0.0": { + "runtime": { + "MyClassLine.dll": {} + } + } + } + }, + "libraries": { + "MyClassLine/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.dll b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.dll new file mode 100644 index 0000000..0f49bba Binary files /dev/null and b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.dll differ diff --git a/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.pdb b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.pdb new file mode 100644 index 0000000..daeeaa1 Binary files /dev/null and b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.pdb differ diff --git a/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.runtimeconfig.json b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab7/MyClassLine/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab7/MyClassLine/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.AssemblyInfo.cs b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.AssemblyInfo.cs new file mode 100644 index 0000000..7fbf733 --- /dev/null +++ b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("MyClassLine")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8c63118e20b76593817b5efc05943736b1cf730a")] +[assembly: System.Reflection.AssemblyProductAttribute("MyClassLine")] +[assembly: System.Reflection.AssemblyTitleAttribute("MyClassLine")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.AssemblyInfoInputs.cache b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.AssemblyInfoInputs.cache new file mode 100644 index 0000000..2b1508d --- /dev/null +++ b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +f60a94c1cede62b115d7c9a64a0b2d66651b596a14497334f17f69e1dce9798e diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..afbd2a4 --- /dev/null +++ b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = MyClassLine +build_property.ProjectDir = /home/nik/oop/labs/lab7/MyClassLine/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.GlobalUsings.g.cs b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.assets.cache b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.assets.cache new file mode 100644 index 0000000..74abfd2 Binary files /dev/null and b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.assets.cache differ diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.csproj.CoreCompileInputs.cache b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7382efb --- /dev/null +++ b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +9353bce025d487fa11b1601227ab1678a5ab2f544bbf872d381664c871e663fd diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.csproj.FileListAbsolute.txt b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..66ee21d --- /dev/null +++ b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.AssemblyInfo.cs +/home/nik/oop/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine +/home/nik/oop/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.deps.json +/home/nik/oop/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.runtimeconfig.json +/home/nik/oop/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.dll +/home/nik/oop/labs/lab7/MyClassLine/bin/Debug/net9.0/MyClassLine.pdb +/home/nik/oop/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.dll +/home/nik/oop/labs/lab7/MyClassLine/obj/Debug/net9.0/refint/MyClassLine.dll +/home/nik/oop/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.pdb +/home/nik/oop/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.genruntimeconfig.cache +/home/nik/oop/labs/lab7/MyClassLine/obj/Debug/net9.0/ref/MyClassLine.dll diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.dll b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.dll new file mode 100644 index 0000000..0f49bba Binary files /dev/null and b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.dll differ diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.genruntimeconfig.cache b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.genruntimeconfig.cache new file mode 100644 index 0000000..0d3c11f --- /dev/null +++ b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.genruntimeconfig.cache @@ -0,0 +1 @@ +7bf088fbd0869cfef42dbfc2476a23c7bccdebf70785642d74e82bf68d665291 diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.pdb b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.pdb new file mode 100644 index 0000000..daeeaa1 Binary files /dev/null and b/labs/lab7/MyClassLine/obj/Debug/net9.0/MyClassLine.pdb differ diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/apphost b/labs/lab7/MyClassLine/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..8a405ec Binary files /dev/null and b/labs/lab7/MyClassLine/obj/Debug/net9.0/apphost differ diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/ref/MyClassLine.dll b/labs/lab7/MyClassLine/obj/Debug/net9.0/ref/MyClassLine.dll new file mode 100644 index 0000000..b4710b7 Binary files /dev/null and b/labs/lab7/MyClassLine/obj/Debug/net9.0/ref/MyClassLine.dll differ diff --git a/labs/lab7/MyClassLine/obj/Debug/net9.0/refint/MyClassLine.dll b/labs/lab7/MyClassLine/obj/Debug/net9.0/refint/MyClassLine.dll new file mode 100644 index 0000000..b4710b7 Binary files /dev/null and b/labs/lab7/MyClassLine/obj/Debug/net9.0/refint/MyClassLine.dll differ diff --git a/labs/lab7/MyClassLine/obj/MyClassLine.csproj.nuget.dgspec.json b/labs/lab7/MyClassLine/obj/MyClassLine.csproj.nuget.dgspec.json new file mode 100644 index 0000000..3677fd1 --- /dev/null +++ b/labs/lab7/MyClassLine/obj/MyClassLine.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab7/MyClassLine/MyClassLine.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab7/MyClassLine/MyClassLine.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab7/MyClassLine/MyClassLine.csproj", + "projectName": "MyClassLine", + "projectPath": "/home/nik/oop/labs/lab7/MyClassLine/MyClassLine.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab7/MyClassLine/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab7/MyClassLine/obj/MyClassLine.csproj.nuget.g.props b/labs/lab7/MyClassLine/obj/MyClassLine.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab7/MyClassLine/obj/MyClassLine.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab7/MyClassLine/obj/MyClassLine.csproj.nuget.g.targets b/labs/lab7/MyClassLine/obj/MyClassLine.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab7/MyClassLine/obj/MyClassLine.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab7/MyClassLine/obj/project.assets.json b/labs/lab7/MyClassLine/obj/project.assets.json new file mode 100644 index 0000000..2f5d19d --- /dev/null +++ b/labs/lab7/MyClassLine/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab7/MyClassLine/MyClassLine.csproj", + "projectName": "MyClassLine", + "projectPath": "/home/nik/oop/labs/lab7/MyClassLine/MyClassLine.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab7/MyClassLine/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab7/MyClassLine/obj/project.nuget.cache b/labs/lab7/MyClassLine/obj/project.nuget.cache new file mode 100644 index 0000000..3e1a9b9 --- /dev/null +++ b/labs/lab7/MyClassLine/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "uG3QyhPHlEQ=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab7/MyClassLine/MyClassLine.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab7/Progrssion/ArithmeticProgression.cs b/labs/lab7/Progrssion/ArithmeticProgression.cs new file mode 100644 index 0000000..75e3629 --- /dev/null +++ b/labs/lab7/Progrssion/ArithmeticProgression.cs @@ -0,0 +1,23 @@ +using System; + +class ArithmeticProgression : Progression +{ + private int a0; + private int b; + + public ArithmeticProgression(int a0, int b) + { + this.a0 = a0; + this.b = b; + } + + public override int GetElement(int k) + { + return a0 + (k - 1) * b; + } + + public override int Sum(int n) + { + return (2 * a0 + (n - 1) * b) * n / 2; + } +} diff --git a/labs/lab7/Progrssion/GeometricProgression.cs b/labs/lab7/Progrssion/GeometricProgression.cs new file mode 100644 index 0000000..6ce7599 --- /dev/null +++ b/labs/lab7/Progrssion/GeometricProgression.cs @@ -0,0 +1,24 @@ +using System; + +class GeometricProgression : Progression +{ + private int p0; + private int q; + + public GeometricProgression(int p0, int q) + { + this.p0 = p0; + this.q = q; + } + + public override int GetElement(int k) + { + return p0 * (int)Math.Pow(q, k - 1); + } + + public override int Sum(int n) + { + if (q == 1) return p0 * n; + return p0 * (int)((Math.Pow(q, n) - 1) / (q - 1)); + } +} diff --git a/labs/lab7/Progrssion/Program.cs b/labs/lab7/Progrssion/Program.cs new file mode 100644 index 0000000..73b00a0 --- /dev/null +++ b/labs/lab7/Progrssion/Program.cs @@ -0,0 +1,18 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + Progression arith = new ArithmeticProgression(2, 3); + Progression geom = new GeometricProgression(2, 2); + + Console.WriteLine("Арифметическая прогрессия:"); + Console.WriteLine("5-й элемент = " + arith.GetElement(5)); + Console.WriteLine("Сумма 5 элементов = " + arith.Sum(5)); + + Console.WriteLine("\nГеометрическая прогрессия:"); + Console.WriteLine("5-й элемент = " + geom.GetElement(5)); + Console.WriteLine("Сумма 5 элементов = " + geom.Sum(5)); + } +} diff --git a/labs/lab7/Progrssion/Progression.cs b/labs/lab7/Progrssion/Progression.cs new file mode 100644 index 0000000..255bfa5 --- /dev/null +++ b/labs/lab7/Progrssion/Progression.cs @@ -0,0 +1,7 @@ +using System; + +abstract class Progression +{ + public abstract int GetElement(int k); + public abstract int Sum(int n); +} diff --git a/labs/lab7/Progrssion/Progrssion.csproj b/labs/lab7/Progrssion/Progrssion.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab7/Progrssion/Progrssion.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion new file mode 100755 index 0000000..7a01dc4 Binary files /dev/null and b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion differ diff --git a/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.deps.json b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.deps.json new file mode 100644 index 0000000..b78df7a --- /dev/null +++ b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Progrssion/1.0.0": { + "runtime": { + "Progrssion.dll": {} + } + } + } + }, + "libraries": { + "Progrssion/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.dll b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.dll new file mode 100644 index 0000000..56e9476 Binary files /dev/null and b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.dll differ diff --git a/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.pdb b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.pdb new file mode 100644 index 0000000..3369445 Binary files /dev/null and b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.pdb differ diff --git a/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.runtimeconfig.json b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab7/Progrssion/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab7/Progrssion/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfo.cs b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfo.cs new file mode 100644 index 0000000..ede82ff --- /dev/null +++ b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Progrssion")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8c63118e20b76593817b5efc05943736b1cf730a")] +[assembly: System.Reflection.AssemblyProductAttribute("Progrssion")] +[assembly: System.Reflection.AssemblyTitleAttribute("Progrssion")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfoInputs.cache b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfoInputs.cache new file mode 100644 index 0000000..65851ec --- /dev/null +++ b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +231b0612123ed9c81a58653fb6ef4a2e8228ba6cf401a20a47b808ae56470e20 diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..f9f32ee --- /dev/null +++ b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Progrssion +build_property.ProjectDir = /home/nik/oop/labs/lab7/Progrssion/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.GlobalUsings.g.cs b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.assets.cache b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.assets.cache new file mode 100644 index 0000000..782e72d Binary files /dev/null and b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.assets.cache differ diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.csproj.CoreCompileInputs.cache b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..a353264 --- /dev/null +++ b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +6950c19920e3fad63142e166c6c65638504c7f295fac7f3e0d587d8ae121a34c diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.csproj.FileListAbsolute.txt b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..c63ea26 --- /dev/null +++ b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.deps.json +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.runtimeconfig.json +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.dll +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.pdb +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfo.cs +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.dll +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/refint/Progrssion.dll +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.pdb +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.genruntimeconfig.cache +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/ref/Progrssion.dll diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.dll b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.dll new file mode 100644 index 0000000..56e9476 Binary files /dev/null and b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.dll differ diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.genruntimeconfig.cache b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.genruntimeconfig.cache new file mode 100644 index 0000000..7dd357b --- /dev/null +++ b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.genruntimeconfig.cache @@ -0,0 +1 @@ +bfb5502a1971c4e022bea8a07009a37b368a6b5aa215f2a76d52692f043fc0a5 diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.pdb b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.pdb new file mode 100644 index 0000000..3369445 Binary files /dev/null and b/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.pdb differ diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/apphost b/labs/lab7/Progrssion/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..7a01dc4 Binary files /dev/null and b/labs/lab7/Progrssion/obj/Debug/net9.0/apphost differ diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/ref/Progrssion.dll b/labs/lab7/Progrssion/obj/Debug/net9.0/ref/Progrssion.dll new file mode 100644 index 0000000..bc289c7 Binary files /dev/null and b/labs/lab7/Progrssion/obj/Debug/net9.0/ref/Progrssion.dll differ diff --git a/labs/lab7/Progrssion/obj/Debug/net9.0/refint/Progrssion.dll b/labs/lab7/Progrssion/obj/Debug/net9.0/refint/Progrssion.dll new file mode 100644 index 0000000..bc289c7 Binary files /dev/null and b/labs/lab7/Progrssion/obj/Debug/net9.0/refint/Progrssion.dll differ diff --git a/labs/lab7/Progrssion/obj/Progrssion.csproj.nuget.dgspec.json b/labs/lab7/Progrssion/obj/Progrssion.csproj.nuget.dgspec.json new file mode 100644 index 0000000..073d007 --- /dev/null +++ b/labs/lab7/Progrssion/obj/Progrssion.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab7/Progrssion/Progrssion.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab7/Progrssion/Progrssion.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab7/Progrssion/Progrssion.csproj", + "projectName": "Progrssion", + "projectPath": "/home/nik/oop/labs/lab7/Progrssion/Progrssion.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab7/Progrssion/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab7/Progrssion/obj/Progrssion.csproj.nuget.g.props b/labs/lab7/Progrssion/obj/Progrssion.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab7/Progrssion/obj/Progrssion.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab7/Progrssion/obj/Progrssion.csproj.nuget.g.targets b/labs/lab7/Progrssion/obj/Progrssion.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab7/Progrssion/obj/Progrssion.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab7/Progrssion/obj/project.assets.json b/labs/lab7/Progrssion/obj/project.assets.json new file mode 100644 index 0000000..bfd7096 --- /dev/null +++ b/labs/lab7/Progrssion/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab7/Progrssion/Progrssion.csproj", + "projectName": "Progrssion", + "projectPath": "/home/nik/oop/labs/lab7/Progrssion/Progrssion.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab7/Progrssion/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab7/Progrssion/obj/project.nuget.cache b/labs/lab7/Progrssion/obj/project.nuget.cache new file mode 100644 index 0000000..6caccf6 --- /dev/null +++ b/labs/lab7/Progrssion/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "aFJJItoUSgA=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab7/Progrssion/Progrssion.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab7/assets/1.png b/labs/lab7/assets/1.png new file mode 100644 index 0000000..6c1c455 Binary files /dev/null and b/labs/lab7/assets/1.png differ diff --git a/labs/lab7/assets/2.png b/labs/lab7/assets/2.png new file mode 100644 index 0000000..78876cb Binary files /dev/null and b/labs/lab7/assets/2.png differ diff --git a/labs/lab7/assets/3.png b/labs/lab7/assets/3.png new file mode 100644 index 0000000..d1bf520 Binary files /dev/null and b/labs/lab7/assets/3.png differ diff --git a/labs/lab7/assets/4.png b/labs/lab7/assets/4.png new file mode 100644 index 0000000..bd2e9c2 Binary files /dev/null and b/labs/lab7/assets/4.png differ diff --git a/labs/lab7/assets/5.png b/labs/lab7/assets/5.png new file mode 100644 index 0000000..5ed2cdb Binary files /dev/null and b/labs/lab7/assets/5.png differ diff --git a/labs/lab7/report.pdf b/labs/lab7/report.pdf new file mode 100644 index 0000000..cf8b785 Binary files /dev/null and b/labs/lab7/report.pdf differ diff --git a/labs/lab7/report.typ b/labs/lab7/report.typ new file mode 100644 index 0000000..0c7c904 --- /dev/null +++ b/labs/lab7/report.typ @@ -0,0 +1,600 @@ +#set text(size: 1.3em) + +#show raw.where(block: false): box.with( + fill: luma(240), + inset: (x: 3pt, y: 0pt), + outset: (y: 3pt), + radius: 2pt, +) + +#show raw.where(block: true): block.with( + fill: luma(240), + inset: 10pt, + radius: 4pt, +) + +// title + +#align(center)[Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики] +\ +\ +\ +#align(center)[Факультет инфокоммуникационных технологий] +#align(center)[Направление подготовки 11.03.02] +\ +\ +#align(center)[Лабораторная работа №7] +#align(center)[Создание иерархии классов] +\ +\ +\ //#align(center)[Вариант 19] +\ +\ +\ +\ +\ +\ +\ +#align(right)[Выполнил:] +#align(right)[Дощенников Никита Андреевич] +#align(right)[Группа: К3221] +#align(right)[Проверил:] +#align(right)[Иванов Сергей Евгеньевич] +\ +\ +#align(center)[Санкт-Петербург] +#align(center)[2025] + +#pagebreak() + +=== Цель работы: + +Изучение наследования как важного элемента объектно-ориентированного программирования и приобретение навыков реализации иерархии классов. + +=== Упражнение 1. Реализация наследования классов. + +В этом упражнении я использовал наследование для построения иерархии между классами, имеющих отношение типа "является". Вы добавите новый класс `Item`, который будет являться базовым для уже имеющегося класса `Book`. + +```cs +using System; + +abstract class Item +{ + protected long invNumber; + protected bool taken; + + public Item(long invNumber, bool taken) + { + this.invNumber = invNumber; + this.taken = taken; + } + + public Item() + { + this.taken = true; + } + + public bool IsAvailable() + { + return taken; + } + + public long GetInvNumber() + { + return invNumber; + } + + private void Take() + { + taken = false; + } + + public void TakeItem() + { + if (this.IsAvailable()) + this.Take(); + } + + + abstract public void Return(); + + public virtual void Show() + { + Console.WriteLine("Состояние единицы хранения:\n Инвентарный номер: {0}\n Наличие: {1}", invNumber, taken); + } +} +``` + +```cs +using System; + +class Book : Item +{ + private String author; + private String title; + private String publisher; + private int pages; + private int year; + private bool returnSrok; + + private static double price = 9; + + static Book() + { + price = 10; + } + + public Book() + { + + } + + + public Book(String author, String title, String publisher, int pages, int year, long invNumber, bool taken) : base (invNumber, taken) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public Book(String author, String title) + { + this.author = author; + this.title = title; + } + + public void SetBook(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public static void SetPrice(double price) + { + Book.price = price; + } + + + public override void Show() + { + Console.WriteLine("\nКнига:\n Автор: {0}\n Название: {1}\n Год издания: {2}\n {3} стр.\n Стоимость аренды: {4}", author, title, year, pages, Book.price); + base.Show(); + } + + + public double PriceBook(int s) + { + double cost = s * price; + return cost; + } + + public void ReturnSrok() + { + returnSrok = true; + } + + public override void Return() + { + taken = returnSrok; + } +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Item item1 = new Item(); + item1.Show(); +} +``` + +=== Упражнение 2. Использование конструкторов. + +В этом упражнении я определил конструкторы в базовом и в производном классах и реализуете их выполнение в обоих классах с помощью ключевого слова `base`, которое позволяет вызвать конструктор базового класса. + +```cs +using System; + +class Magazine : Item +{ + private String volume; + private int number; + private String title; + private int year; + + public Magazine(String volume, int number, String title, int year, long invNumber, bool taken) : base(invNumber, taken) + { + this.volume = volume; + this.number = number; + this.title = title; + this.year = year; + } + + public Magazine() + {} + + public override void Show() + { + Console.WriteLine("\nЖурнал:\n Том: {0}\n Номер: {1}\n Название: {2}\n Год выпуска: {3}", volume, number, title, year); + base.Show(); + } + + + public override void Return() + { + taken = true; + } + +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Book b2 = new Book("Толстой Л. Н.", "Война и мир", "Наука и жизнь", 1234, 2013, 101, true); + + b2.Show(); + b2.TakeItem(); + b2.Show(); + + Magazine mag1 = new Magazine("О природе", 5, "Земля и мы", 2014, 1235, true); + mag1.Show(); +} +``` + +Пример: + +#align(center)[#image("assets/1.png")] + +=== Упражнение 3. Переопределение методов. + +В этом упражнении я реализовал механизм полиморфизма с помощью виртуальных методов и их переопределения в производных классах. + +```cs +public static void Main(string[] args) +{ + Book b2 = new Book("Толстой Л. Н.", "Война и мир", "Наука и жизнь", 1234, 2013, 101, true); + + b2.Show(); + b2.TakeItem(); + b2.Show(); + + + Magazine mag1 = new Magazine("О природе", 5, "Земля и мы", 2014, 1235, true); + mag1.Show(); + + Console.WriteLine("\n Тестирование полиформизма"); + Item it; + + it = b2; + it.TakeItem(); + it.Return(); + it.Show(); + + it = mag1; + it.TakeItem(); + it.Return(); + it.Show(); +} +``` + +Пример: + +#align(center)[#image("assets/2.png")] + +=== Упражнение 4. Применение абстрактного класса и абстрактных методов. + +В этом упражнении я сделал базовый класс и один из его методов абстрактным. + +Тесты и примеры совпадают с предыдущим упражнением. + +=== Упражнение 5. Реализации модели включения. + +В этом упражнении я реализовал отношение "имеет", известное под названием модели включения или агрегации. + +```cs +using System; + +class Point +{ + private double x; + private double y; + + public Point(double x, double y) + { + this.x = x; + this.y = y; + } + + public Point () + {} + + public void Show() + { + Console.WriteLine("Точка с координатами: ({0}, {1})", x, y); + } + + public double Dlina(Point p) + { + double Dl = Math.Sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y)); + return Dl; + } + + public override string ToString() + { + string ss = x + " ; " + y; + return ss; + } +} +``` + +```cs +using System; + +class Line +{ + private Point pStart; + private Point pEnd; + + public Line(Point pStart, Point pEnd) + { + this.pStart = pStart; + this.pEnd = pEnd; + } + + public Line() + { } + + public void Show() + { + Console.WriteLine("Отрезок с координатами: ({0}) - ({1})", pStart, pEnd); + } + + public double DlinL() + { + return pStart.Dlina(pEnd); + } +} +``` + +Тесты: + +```cs +using System; + +public class Program +{ + public static void Main(string[] args) + { + Point p1 = new Point(); + p1.Show(); + Point p2 = new Point(12, 13); + p2.Show(); + + Line line = new Line(p1, p2); + line.Show(); + + double dtr = line.DlinL(); + Console.WriteLine("Длина отрезка " + dtr); + } +} +``` + +Примеры: + +#align(center)[#image("assets/3.png")] + +=== Упражнение 6. Реализация отношения ассоциации между классами. + +В этом упражнении я создал класс, моделирующий игральную кость и класс игрока, который связан с классом игры отношением ассоциации - каждый отдельный сеанс игры связан с конкретным игроком, бросающим кубик. + +```cs +using System; + +class IgralnayaKost +{ + Random r; + + public IgralnayaKost() + { + r = new Random(); + } + + public int random() + { + int res = r.Next(6) + 1; + return res; + } +} +``` + +```cs +using System; + +class Gamer +{ + string Name; + IgralnayaKost seans; + + public Gamer(string name) + { + Name = name; + seans = new IgralnayaKost(); + } + + public int SeansGame() + { + return seans.random(); + } + + public override string ToString() + { + return Name; + } +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Gamer g1 = new Gamer("Niko"); + + for (int i = 1; i <= 6; i++) + { + Console.WriteLine("Выпало количество очков {0} для игрока {1}", g1.SeansGame(), g1.ToString()); + } +} +``` + +Примеры: + +#align(center)[#image("assets/4.png")] + +=== Упражнение 7. Реализация прогрессии. + +В этом упражнении я определил абстрактный класс `Progression`, описывающий прогрессии. В этом классе определил абстрактный метод `GetElement` с целочисленным параметром `k`, возвращающий элемент прогрессии. Определил два производных класса `ArithmeticProgression` и `GeometricProgression`, описывающие арифметическую и геометрическую прогрессии. В каждом из классов определил конструктор, задающий параметры прогрессии и перегрузил унаследованный метод `GetElement`. + +```cs +using System; + +abstract class Progression +{ + public abstract int GetElement(int k); + public abstract int Sum(int n); +} +``` + +```cs +using System; + +class ArithmeticProgression : Progression +{ + private int a0; + private int b; + + public ArithmeticProgression(int a0, int b) + { + this.a0 = a0; + this.b = b; + } + + public override int GetElement(int k) + { + return a0 + (k - 1) * b; + } + + public override int Sum(int n) + { + return (2 * a0 + (n - 1) * b) * n / 2; + } +} +``` + +```cs +using System; + +class GeometricProgression : Progression +{ + private int p0; + private int q; + + public GeometricProgression(int p0, int q) + { + this.p0 = p0; + this.q = q; + } + + public override int GetElement(int k) + { + return p0 * (int)Math.Pow(q, k - 1); + } + + public override int Sum(int n) + { + if (q == 1) return p0 * n; + return p0 * (int)((Math.Pow(q, n) - 1) / (q - 1)); + } +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Progression arith = new ArithmeticProgression(2, 3); + Progression geom = new GeometricProgression(2, 2); + + Console.WriteLine("Арифметическая прогрессия:"); + Console.WriteLine("5-й элемент = " + arith.GetElement(5)); + Console.WriteLine("Сумма 5 элементов = " + arith.Sum(5)); + + Console.WriteLine("\nГеометрическая прогрессия:"); + Console.WriteLine("5-й элемент = " + geom.GetElement(5)); + Console.WriteLine("Сумма 5 элементов = " + geom.Sum(5)); +} +``` + +Пример: + +#align(center)[#image("assets/5.png")] + +=== Выводы. + +В ходе проделанной работе я изучил наследование как важный элемент объектно-ориентированного программирования и приобрел навыки реализации иерархии классов. + +=== Code review. (by #link("https://zzzcode.ai")[zzzcode.ai]) + +*Резюме* + +Код представляет собой реализацию нескольких классов, включая `Gamer`, `Book`, `Magazine`, `Item`, `Triangle`, `Line`, `Point`, и прогрессии. Основная логика кода заключается в моделировании игровых сессий и библиотечных предметов. Однако, код требует улучшений в области стиля, структуры и обработки ошибок. + +*Ошибка* + +В классе `Gamer` отсутствует проверка на `null` для параметра `name` в конструкторе. Это может привести к исключению, если передать `null`. Также метод `random()` в классе `IgralnayaKost` не определен в предоставленном коде, что может вызвать ошибки компиляции. + + +*Стиль кода* + +Имена переменных и методов должны следовать соглашениям о наименовании C\#. Например, `Name` и `seans` следует переименовать в `name` и `session` соответственно. Рекомендуется использовать свойства вместо полей для обеспечения инкапсуляции. + +*Структура кода* + +Код разбит на несколько классов, что хорошо для организации. Однако, стоит рассмотреть возможность разделения на отдельные файлы для каждого класса, чтобы улучшить читаемость и поддержку. + +*Читаемость* + +Код в целом читаем, но использование комментариев и документации для методов и классов значительно улучшит понимание кода другими разработчиками. + +*Производительность* + +Код не содержит явных проблем с производительностью, однако использование статических методов и свойств может быть оптимизировано для уменьшения потребления памяти. + +*Масштабируемость* + +Код может быть расширен, но для этого потребуется более четкая архитектура. Например, использование интерфейсов для классов `Item`, `Book`, и `Magazine` может улучшить гибкость и масштабируемость. + +*Безопасность* + +Отсутствие проверки входных данных может привести к уязвимостям. Рекомендуется добавить валидацию для всех входных параметров, особенно в конструкторах. + +*Обработка ошибок* + +Код не содержит механизма обработки ошибок. Рекомендуется использовать конструкции `try-catch` для обработки возможных исключений, особенно в методах, которые могут вызывать ошибки, такие как `random()`. + +*Заключение* + +Код демонстрирует базовые принципы объектно-ориентированного программирования, но требует улучшений в области стиля, структуры и обработки ошибок. Рекомендуется провести рефакторинг для повышения читаемости и безопасности, а также добавить документацию для улучшения поддержки кода в будущем. + + diff --git a/labs/lab8/MyClass/Book.cs b/labs/lab8/MyClass/Book.cs new file mode 100644 index 0000000..1b932a4 --- /dev/null +++ b/labs/lab8/MyClass/Book.cs @@ -0,0 +1,77 @@ +using System; + +class Book : Item +{ + private String author; + private String title; + private String publisher; + private int pages; + private int year; + private bool returnSrok; + + private static double price = 9; + + static Book() + { + price = 10; + } + + public Book() + { + + } + + + public Book(String author, String title, String publisher, int pages, int year, long invNumber, bool taken) : base (invNumber, taken) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public Book(String author, String title) + { + this.author = author; + this.title = title; + } + + public void SetBook(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public static void SetPrice(double price) + { + Book.price = price; + } + + + public override void Show() + { + Console.WriteLine("\nКнига:\n Автор: {0}\n Название: {1}\n Год издания: {2}\n {3} стр.\n Стоимость аренды: {4}", author, title, year, pages, Book.price); + base.Show(); + } + + + public double PriceBook(int s) + { + double cost = s * price; + return cost; + } + + public void ReturnSrok() + { + returnSrok = true; + } + + public override void Return() + { + taken = returnSrok; + } +} diff --git a/labs/lab8/MyClass/IPubs.cs b/labs/lab8/MyClass/IPubs.cs new file mode 100644 index 0000000..c08cd46 --- /dev/null +++ b/labs/lab8/MyClass/IPubs.cs @@ -0,0 +1,7 @@ +using System; + +interface IPubs +{ + void Subs(); + bool IfSubs { get; set; } +} diff --git a/labs/lab8/MyClass/Item.cs b/labs/lab8/MyClass/Item.cs new file mode 100644 index 0000000..87c991c --- /dev/null +++ b/labs/lab8/MyClass/Item.cs @@ -0,0 +1,55 @@ +using System; + +abstract class Item : IComparable +{ + protected long invNumber; + protected bool taken; + + public Item(long invNumber, bool taken) + { + this.invNumber = invNumber; + this.taken = taken; + } + + public Item() + { + this.taken = true; + } + + public bool IsAvailable() + { + return taken; + } + + public long GetInvNumber() + { + return invNumber; + } + + private void Take() + { + taken = false; + } + + public void TakeItem() + { + if (this.IsAvailable()) + this.Take(); + } + + + abstract public void Return(); + + public virtual void Show() + { + Console.WriteLine("Состояние единицы хранения:\n Инвентарный номер: {0}\n Наличие: {1}", invNumber, taken); + } + + int IComparable.CompareTo(object obj) + { + Item it = (Item)obj; + if (this.invNumber == it.invNumber) return 0; + else if (this.invNumber > it.invNumber) return 1; + else return -1; + } +} diff --git a/labs/lab8/MyClass/Magazine.cs b/labs/lab8/MyClass/Magazine.cs new file mode 100644 index 0000000..be7e2a4 --- /dev/null +++ b/labs/lab8/MyClass/Magazine.cs @@ -0,0 +1,40 @@ +using System; + +class Magazine : Item, IPubs +{ + private String volume; + private int number; + private String title; + private int year; + + public Magazine(String volume, int number, String title, int year, long invNumber, bool taken) : base(invNumber, taken) + { + this.volume = volume; + this.number = number; + this.title = title; + this.year = year; + } + + public Magazine() + {} + + public override void Show() + { + Console.WriteLine("\nЖурнал:\n Том: {0}\n Номер: {1}\n Название: {2}\n Год выпуска: {3}", volume, number, title, year); + base.Show(); + } + + + public override void Return() + { + taken = true; + } + + public bool IfSubs { get; set; } + + public void Subs() + { + Console.WriteLine("Подписка на журнал \"{0}\": {1}.", title, IfSubs); + } + +} diff --git a/labs/lab8/MyClass/MyClass.csproj b/labs/lab8/MyClass/MyClass.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab8/MyClass/MyClass.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab8/MyClass/Program.cs b/labs/lab8/MyClass/Program.cs new file mode 100644 index 0000000..7f98385 --- /dev/null +++ b/labs/lab8/MyClass/Program.cs @@ -0,0 +1,77 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + Book b1 = new Book(); + b1.SetBook("Пушкин А.С.", "Капитанская дочка", "Вильямс", 123, 2012); + Book.SetPrice(12); + b1.Show(); + Console.WriteLine("\n Итоговая стоимость аренды: {0} р.", b1.PriceBook(3)); + + // Book b2 = new Book("Толстой Л.Н.", "Война и мир", "Наука и жизнь", 1234, 2013); + // b2.Show(); + + Book b3 = new Book("Лермонтов М.Ю.", "Мцыри"); + b3.Show(); + + + Triangle t1 = new Triangle(3, 4, 5); + t1.Show(); + Console.WriteLine("perimeter = {0}", t1.Perimeter()); + Console.WriteLine("area = {0}", t1.Area()); + Console.WriteLine("does this triangle exist? {0}", t1.Exists()); + + Triangle t2 = new Triangle(3, 4, 7); + t2.Show(); + Console.WriteLine("does this triangle exist? {0}", t2.Exists()); + + // Item item1 = new Item(); + // item1.Show(); + + Book b2 = new Book("Толстой Л. Н.", "Война и мир", "Наука и жизнь", 1234, 2013, 101, true); + + b2.Show(); + b2.TakeItem(); + b2.Show(); + + + // Magazine mag1 = new Magazine("О природе", 5, "Земля и мы", 2014, 1235, true); + // mag1.Show(); + + Console.WriteLine("\n Тестирование полиформизма"); + Item it; + + it = b2; + it.TakeItem(); + it.Return(); + it.Show(); + + // it = mag1; + // it.TakeItem(); + // it.Return(); + // it.Show(); + + + Magazine mag1 = new Magazine("О природе", 5, "Земля и мы", 2014, 1235, true); + mag1.TakeItem(); + mag1.Show(); + mag1.IfSubs = true; + mag1.Subs(); + + Item[] items = new Item[4]; + items[0] = b1; + items[1] = b2; + items[2] = b3; + items[3] = mag1; + + Array.Sort(items); + + Console.WriteLine("\nСортировка по инвентарному номеру"); + foreach (Item x in items) + { + x.Show(); + } + } +} diff --git a/labs/lab8/MyClass/Triangle.cs b/labs/lab8/MyClass/Triangle.cs new file mode 100644 index 0000000..e06e4e8 --- /dev/null +++ b/labs/lab8/MyClass/Triangle.cs @@ -0,0 +1,42 @@ +using System; + +class Triangle +{ + private int a; + private int b; + private int c; + + public Triangle(int a, int b, int c) + { + this.a = a; + this.b = b; + this.c = c; + } + + public void Show() + { + Console.WriteLine("a: {0}\nb: {1}\nc: {2}", a, b, c); + } + + public int Perimeter() + { + return a + b + c; + } + + public double Area() + { + double p = Perimeter() / 2; + return Math.Sqrt(p * (p - a) * (p - b) * (p - c)); + } + + public bool Exists() + { + if (a <= 0 || b <= 0 || c <= 0) return false; + + double maxSide = Math.Max(Math.Max(a, b), Math.Max(b, c)); + + if (maxSide >= a + b + c - maxSide) return false; + + return true; + } +} diff --git a/labs/lab8/MyClass/bin/Debug/net9.0/MyClass b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass new file mode 100755 index 0000000..0610dad Binary files /dev/null and b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass differ diff --git a/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.deps.json b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.deps.json new file mode 100644 index 0000000..7960ce5 --- /dev/null +++ b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "MyClass/1.0.0": { + "runtime": { + "MyClass.dll": {} + } + } + } + }, + "libraries": { + "MyClass/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.dll b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.dll new file mode 100644 index 0000000..20f0ead Binary files /dev/null and b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.dll differ diff --git a/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.pdb b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.pdb new file mode 100644 index 0000000..7c9bdfb Binary files /dev/null and b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.pdb differ diff --git a/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab8/MyClass/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab8/MyClass/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs new file mode 100644 index 0000000..81b62bc --- /dev/null +++ b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("MyClass")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7c0cae85247e714f121496e471ff040abcdf0f0f")] +[assembly: System.Reflection.AssemblyProductAttribute("MyClass")] +[assembly: System.Reflection.AssemblyTitleAttribute("MyClass")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache new file mode 100644 index 0000000..23a7885 --- /dev/null +++ b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +669a34a9348f9959205ed831232c26c89da1c15b8353ab4f15cece73f33f2362 diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..9bea288 --- /dev/null +++ b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = MyClass +build_property.ProjectDir = /home/nik/oop/labs/lab8/MyClass/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.GlobalUsings.g.cs b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.assets.cache b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.assets.cache new file mode 100644 index 0000000..b887ef8 Binary files /dev/null and b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.assets.cache differ diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..9c9da44 --- /dev/null +++ b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +549f035e7c10aa5d3bdedf5cf21c6bd1a86b89787560e5ea468865b9de0207aa diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.csproj.FileListAbsolute.txt b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..533a886 --- /dev/null +++ b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.csproj.FileListAbsolute.txt @@ -0,0 +1,28 @@ +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.deps.json +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/refint/MyClass.dll +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/ref/MyClass.dll +/home/nik/oop/labs/lab8/MyClass/bin/Debug/net9.0/MyClass +/home/nik/oop/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.deps.json +/home/nik/oop/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json +/home/nik/oop/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab8/MyClass/bin/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs +/home/nik/oop/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab8/MyClass/obj/Debug/net9.0/refint/MyClass.dll +/home/nik/oop/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache +/home/nik/oop/labs/lab8/MyClass/obj/Debug/net9.0/ref/MyClass.dll diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.dll b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.dll new file mode 100644 index 0000000..20f0ead Binary files /dev/null and b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.dll differ diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache new file mode 100644 index 0000000..0d6e30d --- /dev/null +++ b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache @@ -0,0 +1 @@ +05e67916dc7e7a166b007425dfb5bd2109a5154d4b7f928392676054c8729ea4 diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.pdb b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.pdb new file mode 100644 index 0000000..7c9bdfb Binary files /dev/null and b/labs/lab8/MyClass/obj/Debug/net9.0/MyClass.pdb differ diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/apphost b/labs/lab8/MyClass/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..0610dad Binary files /dev/null and b/labs/lab8/MyClass/obj/Debug/net9.0/apphost differ diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/ref/MyClass.dll b/labs/lab8/MyClass/obj/Debug/net9.0/ref/MyClass.dll new file mode 100644 index 0000000..f36330f Binary files /dev/null and b/labs/lab8/MyClass/obj/Debug/net9.0/ref/MyClass.dll differ diff --git a/labs/lab8/MyClass/obj/Debug/net9.0/refint/MyClass.dll b/labs/lab8/MyClass/obj/Debug/net9.0/refint/MyClass.dll new file mode 100644 index 0000000..f36330f Binary files /dev/null and b/labs/lab8/MyClass/obj/Debug/net9.0/refint/MyClass.dll differ diff --git a/labs/lab8/MyClass/obj/MyClass.csproj.nuget.dgspec.json b/labs/lab8/MyClass/obj/MyClass.csproj.nuget.dgspec.json new file mode 100644 index 0000000..c9bf96d --- /dev/null +++ b/labs/lab8/MyClass/obj/MyClass.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab8/MyClass/MyClass.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab8/MyClass/MyClass.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab8/MyClass/MyClass.csproj", + "projectName": "MyClass", + "projectPath": "/home/nik/oop/labs/lab8/MyClass/MyClass.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab8/MyClass/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab8/MyClass/obj/MyClass.csproj.nuget.g.props b/labs/lab8/MyClass/obj/MyClass.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab8/MyClass/obj/MyClass.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab8/MyClass/obj/MyClass.csproj.nuget.g.targets b/labs/lab8/MyClass/obj/MyClass.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab8/MyClass/obj/MyClass.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab8/MyClass/obj/project.assets.json b/labs/lab8/MyClass/obj/project.assets.json new file mode 100644 index 0000000..3495b06 --- /dev/null +++ b/labs/lab8/MyClass/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab8/MyClass/MyClass.csproj", + "projectName": "MyClass", + "projectPath": "/home/nik/oop/labs/lab8/MyClass/MyClass.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab8/MyClass/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab8/MyClass/obj/project.nuget.cache b/labs/lab8/MyClass/obj/project.nuget.cache new file mode 100644 index 0000000..12c9dc2 --- /dev/null +++ b/labs/lab8/MyClass/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "v60AduM4H1I=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab8/MyClass/MyClass.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab8/Progrssion/ArithmeticProgression.cs b/labs/lab8/Progrssion/ArithmeticProgression.cs new file mode 100644 index 0000000..39e6253 --- /dev/null +++ b/labs/lab8/Progrssion/ArithmeticProgression.cs @@ -0,0 +1,23 @@ +using System; + +class ArithmeticProgression : IProgression +{ + private int a0; + private int b; + + public ArithmeticProgression(int a0, int b) + { + this.a0 = a0; + this.b = b; + } + + public int GetElement(int k) + { + return a0 + (k - 1) * b; + } + + public int Sum(int n) + { + return (2 * a0 + (n - 1) * b) * n / 2; + } +} diff --git a/labs/lab8/Progrssion/GeometricProgression.cs b/labs/lab8/Progrssion/GeometricProgression.cs new file mode 100644 index 0000000..a0d655b --- /dev/null +++ b/labs/lab8/Progrssion/GeometricProgression.cs @@ -0,0 +1,24 @@ +using System; + +class GeometricProgression : IProgression +{ + private int p0; + private int q; + + public GeometricProgression(int p0, int q) + { + this.p0 = p0; + this.q = q; + } + + public int GetElement(int k) + { + return p0 * (int)Math.Pow(q, k - 1); + } + + public int Sum(int n) + { + if (q == 1) return p0 * n; + return p0 * (int)((Math.Pow(q, n) - 1) / (q - 1)); + } +} diff --git a/labs/lab8/Progrssion/IProgression.cs b/labs/lab8/Progrssion/IProgression.cs new file mode 100644 index 0000000..98d3294 --- /dev/null +++ b/labs/lab8/Progrssion/IProgression.cs @@ -0,0 +1,7 @@ +using System; + +interface IProgression +{ + int GetElement(int k); + int Sum(int n); +} diff --git a/labs/lab8/Progrssion/Program.cs b/labs/lab8/Progrssion/Program.cs new file mode 100644 index 0000000..fcfe709 --- /dev/null +++ b/labs/lab8/Progrssion/Program.cs @@ -0,0 +1,18 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + IProgression arith = new ArithmeticProgression(2, 3); + IProgression geom = new GeometricProgression(2, 2); + + Console.WriteLine("Арифметическая прогрессия:"); + Console.WriteLine("5-й элемент = " + arith.GetElement(5)); + Console.WriteLine("Сумма 5 элементов = " + arith.Sum(5)); + + Console.WriteLine("\nГеометрическая прогрессия:"); + Console.WriteLine("5-й элемент = " + geom.GetElement(5)); + Console.WriteLine("Сумма 5 элементов = " + geom.Sum(5)); + } +} diff --git a/labs/lab8/Progrssion/Progrssion.csproj b/labs/lab8/Progrssion/Progrssion.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab8/Progrssion/Progrssion.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion new file mode 100755 index 0000000..7a01dc4 Binary files /dev/null and b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion differ diff --git a/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.deps.json b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.deps.json new file mode 100644 index 0000000..b78df7a --- /dev/null +++ b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Progrssion/1.0.0": { + "runtime": { + "Progrssion.dll": {} + } + } + } + }, + "libraries": { + "Progrssion/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.dll b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.dll new file mode 100644 index 0000000..e9e4a4a Binary files /dev/null and b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.dll differ diff --git a/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.pdb b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.pdb new file mode 100644 index 0000000..deb7c84 Binary files /dev/null and b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.pdb differ diff --git a/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.runtimeconfig.json b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab8/Progrssion/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab8/Progrssion/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfo.cs b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfo.cs new file mode 100644 index 0000000..3aaeb2c --- /dev/null +++ b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Progrssion")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7c0cae85247e714f121496e471ff040abcdf0f0f")] +[assembly: System.Reflection.AssemblyProductAttribute("Progrssion")] +[assembly: System.Reflection.AssemblyTitleAttribute("Progrssion")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfoInputs.cache b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfoInputs.cache new file mode 100644 index 0000000..d788113 --- /dev/null +++ b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +50a88fde13001e552e5a15c4c1dc9d84bf377c2af97397458f32aa7bfb8ed0ce diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..5890a9e --- /dev/null +++ b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Progrssion +build_property.ProjectDir = /home/nik/oop/labs/lab8/Progrssion/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.GlobalUsings.g.cs b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.assets.cache b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.assets.cache new file mode 100644 index 0000000..ae10cd4 Binary files /dev/null and b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.assets.cache differ diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.csproj.CoreCompileInputs.cache b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..3a9e099 --- /dev/null +++ b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +febb35b45ae827ae2cc38bca29142b671a3067babd5d9854467e6c29a7f734b8 diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.csproj.FileListAbsolute.txt b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..4a00974 --- /dev/null +++ b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.csproj.FileListAbsolute.txt @@ -0,0 +1,28 @@ +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.deps.json +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.runtimeconfig.json +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.dll +/home/nik/oop/labs/lab7/Progrssion/bin/Debug/net9.0/Progrssion.pdb +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfo.cs +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.dll +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/refint/Progrssion.dll +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.pdb +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/Progrssion.genruntimeconfig.cache +/home/nik/oop/labs/lab7/Progrssion/obj/Debug/net9.0/ref/Progrssion.dll +/home/nik/oop/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.AssemblyInfo.cs +/home/nik/oop/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.dll +/home/nik/oop/labs/lab8/Progrssion/obj/Debug/net9.0/refint/Progrssion.dll +/home/nik/oop/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.pdb +/home/nik/oop/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion +/home/nik/oop/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.deps.json +/home/nik/oop/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.runtimeconfig.json +/home/nik/oop/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.dll +/home/nik/oop/labs/lab8/Progrssion/bin/Debug/net9.0/Progrssion.pdb +/home/nik/oop/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.genruntimeconfig.cache +/home/nik/oop/labs/lab8/Progrssion/obj/Debug/net9.0/ref/Progrssion.dll diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.dll b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.dll new file mode 100644 index 0000000..e9e4a4a Binary files /dev/null and b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.dll differ diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.genruntimeconfig.cache b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.genruntimeconfig.cache new file mode 100644 index 0000000..afd2867 --- /dev/null +++ b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.genruntimeconfig.cache @@ -0,0 +1 @@ +b9720ec9fc833a3887df304a58803c131b5c329c227cb6c752c6888eb7c287f6 diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.pdb b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.pdb new file mode 100644 index 0000000..deb7c84 Binary files /dev/null and b/labs/lab8/Progrssion/obj/Debug/net9.0/Progrssion.pdb differ diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/apphost b/labs/lab8/Progrssion/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..7a01dc4 Binary files /dev/null and b/labs/lab8/Progrssion/obj/Debug/net9.0/apphost differ diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/ref/Progrssion.dll b/labs/lab8/Progrssion/obj/Debug/net9.0/ref/Progrssion.dll new file mode 100644 index 0000000..3d08f79 Binary files /dev/null and b/labs/lab8/Progrssion/obj/Debug/net9.0/ref/Progrssion.dll differ diff --git a/labs/lab8/Progrssion/obj/Debug/net9.0/refint/Progrssion.dll b/labs/lab8/Progrssion/obj/Debug/net9.0/refint/Progrssion.dll new file mode 100644 index 0000000..3d08f79 Binary files /dev/null and b/labs/lab8/Progrssion/obj/Debug/net9.0/refint/Progrssion.dll differ diff --git a/labs/lab8/Progrssion/obj/Progrssion.csproj.nuget.dgspec.json b/labs/lab8/Progrssion/obj/Progrssion.csproj.nuget.dgspec.json new file mode 100644 index 0000000..8043834 --- /dev/null +++ b/labs/lab8/Progrssion/obj/Progrssion.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab8/Progrssion/Progrssion.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab8/Progrssion/Progrssion.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab8/Progrssion/Progrssion.csproj", + "projectName": "Progrssion", + "projectPath": "/home/nik/oop/labs/lab8/Progrssion/Progrssion.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab8/Progrssion/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab8/Progrssion/obj/Progrssion.csproj.nuget.g.props b/labs/lab8/Progrssion/obj/Progrssion.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab8/Progrssion/obj/Progrssion.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab8/Progrssion/obj/Progrssion.csproj.nuget.g.targets b/labs/lab8/Progrssion/obj/Progrssion.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab8/Progrssion/obj/Progrssion.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab8/Progrssion/obj/project.assets.json b/labs/lab8/Progrssion/obj/project.assets.json new file mode 100644 index 0000000..64e5f6a --- /dev/null +++ b/labs/lab8/Progrssion/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab8/Progrssion/Progrssion.csproj", + "projectName": "Progrssion", + "projectPath": "/home/nik/oop/labs/lab8/Progrssion/Progrssion.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab8/Progrssion/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab8/Progrssion/obj/project.nuget.cache b/labs/lab8/Progrssion/obj/project.nuget.cache new file mode 100644 index 0000000..8d87ac3 --- /dev/null +++ b/labs/lab8/Progrssion/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "+4R2gX25Pfg=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab8/Progrssion/Progrssion.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab8/assets/1.png b/labs/lab8/assets/1.png new file mode 100644 index 0000000..552e7fc Binary files /dev/null and b/labs/lab8/assets/1.png differ diff --git a/labs/lab8/assets/2.png b/labs/lab8/assets/2.png new file mode 100644 index 0000000..b7ad1ef Binary files /dev/null and b/labs/lab8/assets/2.png differ diff --git a/labs/lab8/assets/3.png b/labs/lab8/assets/3.png new file mode 100644 index 0000000..c9ed0e6 Binary files /dev/null and b/labs/lab8/assets/3.png differ diff --git a/labs/lab8/report.pdf b/labs/lab8/report.pdf new file mode 100644 index 0000000..9d4c582 Binary files /dev/null and b/labs/lab8/report.pdf differ diff --git a/labs/lab8/report.typ b/labs/lab8/report.typ new file mode 100644 index 0000000..6510c8e --- /dev/null +++ b/labs/lab8/report.typ @@ -0,0 +1,350 @@ +#set text(size: 1.3em) + +#show raw.where(block: false): box.with( + fill: luma(240), + inset: (x: 3pt, y: 0pt), + outset: (y: 3pt), + radius: 2pt, +) + +#show raw.where(block: true): block.with( + fill: luma(240), + inset: 10pt, + radius: 4pt, +) + +// title + +#align(center)[Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики] +\ +\ +\ +#align(center)[Факультет инфокоммуникационных технологий] +#align(center)[Направление подготовки 11.03.02] +\ +\ +#align(center)[Лабораторная работа №8] +#align(center)[Использование интерфейсов при реализации иерархии классов] +\ +\ +\ //#align(center)[Вариант 19] +\ +\ +\ +\ +\ +\ +\ +#align(right)[Выполнил:] +#align(right)[Дощенников Никита Андреевич] +#align(right)[Группа: К3221] +#align(right)[Проверил:] +#align(right)[Иванов Сергей Евгеньевич] +\ +\ +#align(center)[Санкт-Петербург] +#align(center)[2025] + +#pagebreak() + +=== Цель работы: + +Использовать интерфейсы при реализации иерархии классов как важного элемента объектно-ориентированного программирования и приобретение навыков реализации интерфейсов. + +=== Упражнение 1. Создание и реализация интерфейса. + +В этом упражнении я создал интерфейс, определяющий поведение классов, которые будут его реализовывать. + +```cs +using System; + +interface IPubs +{ + void Subs(); + bool IfSubs { get; set; } +} +``` + +```cs +using System; + +class Magazine : Item, IPubs +{ + private String volume; + private int number; + private String title; + private int year; + + public Magazine(String volume, int number, String title, int year, long invNumber, bool taken) : base(invNumber, taken) + { + this.volume = volume; + this.number = number; + this.title = title; + this.year = year; + } + + public Magazine() + {} + + public override void Show() + { + Console.WriteLine("\nЖурнал:\n Том: {0}\n Номер: {1}\n Название: {2}\n Год выпуска: {3}", volume, number, title, year); + base.Show(); + } + + + public override void Return() + { + taken = true; + } + + public bool IfSubs { get; set; } + + public void Subs() + { + Console.WriteLine("Подписка на журнал \"{0}\": {1}.", title, IfSubs); + } + +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Magazine mag1 = new Magazine("О природе", 5, "Земля и мы", 2014, 1235, true); + mag1.TakeItem(); + mag1.Show(); + mag1.IfSubs = true; + mag1.Subs(); +} +``` + +Пример: + +#align(center)[#image("assets/1.png")] + +=== Упражнение 2. Использование стандартных интерфейсов. + +В этом упражнении я применил интерфейс `IComparable`, который задает метод сравнения объектов по принципу больше и меньше, что позволяет переопределить соответствующие операции в рамках класса, наследующего интерфейс `IComparable`. + +```cs +using System; + +abstract class Item : IComparable +{ + protected long invNumber; + protected bool taken; + + public Item(long invNumber, bool taken) + { + this.invNumber = invNumber; + this.taken = taken; + } + + public Item() + { + this.taken = true; + } + + public bool IsAvailable() + { + return taken; + } + + public long GetInvNumber() + { + return invNumber; + } + + private void Take() + { + taken = false; + } + + public void TakeItem() + { + if (this.IsAvailable()) + this.Take(); + } + + + abstract public void Return(); + + public virtual void Show() + { + Console.WriteLine("Состояние единицы хранения:\n Инвентарный номер: {0}\n Наличие: {1}", invNumber, taken); + } + + int IComparable.CompareTo(object obj) + { + Item it = (Item)obj; + if (this.invNumber == it.invNumber) return 0; + else if (this.invNumber > it.invNumber) return 1; + else return -1; + } +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Item[] items = new Item[4]; + items[0] = b1; + items[1] = b2; + items[2] = b3; + items[3] = mag1; + + Array.Sort(items); + + Console.WriteLine("\nСортировка по инвентарному номеру"); + foreach (Item x in items) + { + x.Show(); + } +} +``` + +Пример: + +#align(center)[#image("assets/2.png")] + +=== Упражнение 3. Реализация прогрессии с помощью интерфейса. + +В этом упражнении я заменил абстрактный класс `Progression` на интерфейс `IProgression`, определяющий поведение классов `ArithmeticProgression` и `GeometricProgression`, описывающих арифметическую и геометрическую прогрессии. + +```cs +using System; + +interface IProgression +{ + int GetElement(int k); + int Sum(int n); +} +``` + +```cs +using System; + +class ArithmeticProgression : IProgression +{ + private int a0; + private int b; + + public ArithmeticProgression(int a0, int b) + { + this.a0 = a0; + this.b = b; + } + + public int GetElement(int k) + { + return a0 + (k - 1) * b; + } + + public int Sum(int n) + { + return (2 * a0 + (n - 1) * b) * n / 2; + } +} +``` + +```cs +using System; + +class GeometricProgression : IProgression +{ + private int p0; + private int q; + + public GeometricProgression(int p0, int q) + { + this.p0 = p0; + this.q = q; + } + + public int GetElement(int k) + { + return p0 * (int)Math.Pow(q, k - 1); + } + + public int Sum(int n) + { + if (q == 1) return p0 * n; + return p0 * (int)((Math.Pow(q, n) - 1) / (q - 1)); + } +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + IProgression arith = new ArithmeticProgression(2, 3); + IProgression geom = new GeometricProgression(2, 2); + + Console.WriteLine("Арифметическая прогрессия:"); + Console.WriteLine("5-й элемент = " + arith.GetElement(5)); + Console.WriteLine("Сумма 5 элементов = " + arith.Sum(5)); + + Console.WriteLine("\nГеометрическая прогрессия:"); + Console.WriteLine("5-й элемент = " + geom.GetElement(5)); + Console.WriteLine("Сумма 5 элементов = " + geom.Sum(5)); +} +``` + +Пример: + +#align(center)[#image("assets/3.png")] + +=== Выводы. + +В ходе проделанной лабораторной работы я использовал интерфейсы при реализации иерархии классов как важного элемента объектно-ориентированного программирования и приобретел навыки реализации интерфейсов. + +=== Code review. (by #link("https://zzzcode.ai")[zzzcode.ai]) + +*Резюме* + +Класс `Book` представляет собой реализацию книги с различными атрибутами, такими как автор, название, издатель и т.д. Он наследуется от абстрактного класса `Item`, который управляет состоянием доступности книги. Код в целом хорошо структурирован, но требует некоторых улучшений в области стиля и производительности. + +*Ошибка* + +В методе `Return()` класса `Book` переменная `taken` устанавливается в значение `returnSrok`, которое по умолчанию равно `false`. Это может привести к тому, что книга будет считаться возвращенной, даже если она не была возвращена. Следует добавить логику для проверки состояния возврата. + +*Стиль кода* + +Использование `String` вместо `string` не соответствует общепринятому стилю C\#. Рекомендуется использовать `string` (с маленькой буквы). Имена переменных и методов должны следовать соглашениям о наименовании. Например, `returnSrok` можно переименовать в `isReturned` для большей ясности. + +*Структура кода* + +Класс `Book` имеет хорошую структуру, однако: Конструкторы перегружены, что может усложнить создание объектов. Рекомендуется использовать один конструктор с параметрами по умолчанию. Метод `SetBook` можно заменить на использование свойств, что улучшит инкапсуляцию. + +*Читаемость* + +Код читаем, но можно улучшить: Добавить XML-комментарии к методам и классам для лучшего понимания их назначения. Разделить длинные строки на несколько строк для повышения читаемости. + +*Производительность* + +Статическая переменная `price` может быть изменена через метод `SetPrice`, что может привести к неожиданным изменениям. Рекомендуется сделать её свойством только для чтения или использовать паттерн Singleton для управления ценой. + +*Масштабируемость* + +Класс `Book` может быть расширен для поддержки дополнительных атрибутов, таких как жанр или ISBN. Однако, если количество атрибутов увеличится, стоит рассмотреть возможность использования паттерна проектирования, такого как `Builder`. + +*Безопасность* + +Необходимо добавить валидацию входных данных в конструкторах и методах, чтобы предотвратить создание объектов с некорректными значениями (например, отрицательное количество страниц или год). + +*Обработка ошибок* + +В текущем коде отсутствует обработка исключений. Рекомендуется добавить обработку ошибок, особенно в методах, которые могут вызывать исключения, таких как `PriceBook`. + +*Заключение* + +Класс `Book` и его реализация в целом являются хорошей основой для работы с книгами. Однако, для улучшения качества кода и его поддержки, необходимо внести изменения в стиль, структуру и обработку ошибок. Рекомендуется также рассмотреть возможность добавления тестов для проверки функциональности классов. + + diff --git a/labs/lab9/Igra/Gamer.cs b/labs/lab9/Igra/Gamer.cs new file mode 100644 index 0000000..dd53f22 --- /dev/null +++ b/labs/lab9/Igra/Gamer.cs @@ -0,0 +1,30 @@ +using System; + +class Gamer +{ + string Name; + IgralnayaKost seans; + + public Gamer(string name) + { + Name = name; + seans = new IgralnayaKost(); + seans.MaxRolled += OnMaxRolled; + } + + void OnMaxRolled(int value) + { + Console.WriteLine("Событие: у игрока {0} выпало максимальное количество очков ({1})", Name, value); + } + + public int SeansGame() + { + return seans.random(); + } + + public override string ToString() + { + return Name; + } +} + diff --git a/labs/lab9/Igra/Igra.csproj b/labs/lab9/Igra/Igra.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab9/Igra/Igra.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab9/Igra/IgralnayaKost.cs b/labs/lab9/Igra/IgralnayaKost.cs new file mode 100644 index 0000000..7138958 --- /dev/null +++ b/labs/lab9/Igra/IgralnayaKost.cs @@ -0,0 +1,20 @@ +using System; + +class IgralnayaKost +{ + readonly Random r; + public event Action MaxRolled; + + public IgralnayaKost() + { + r = new Random(); + } + + public int random() + { + int res = r.Next(6) + 1; + if (res == 6) MaxRolled?.Invoke(res); + return res; + } +} + diff --git a/labs/lab9/Igra/Program.cs b/labs/lab9/Igra/Program.cs new file mode 100644 index 0000000..7cbc889 --- /dev/null +++ b/labs/lab9/Igra/Program.cs @@ -0,0 +1,15 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + Gamer g1 = new Gamer("Niko"); + + for (int i = 1; i <= 6; i++) + { + Console.WriteLine("Выпало количество очков {0} для игрока {1}", g1.SeansGame(), g1.ToString()); + } + } +} + diff --git a/labs/lab9/Igra/bin/Debug/net9.0/Igra b/labs/lab9/Igra/bin/Debug/net9.0/Igra new file mode 100755 index 0000000..0ca2e3f Binary files /dev/null and b/labs/lab9/Igra/bin/Debug/net9.0/Igra differ diff --git a/labs/lab9/Igra/bin/Debug/net9.0/Igra.deps.json b/labs/lab9/Igra/bin/Debug/net9.0/Igra.deps.json new file mode 100644 index 0000000..fe13766 --- /dev/null +++ b/labs/lab9/Igra/bin/Debug/net9.0/Igra.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Igra/1.0.0": { + "runtime": { + "Igra.dll": {} + } + } + } + }, + "libraries": { + "Igra/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab9/Igra/bin/Debug/net9.0/Igra.dll b/labs/lab9/Igra/bin/Debug/net9.0/Igra.dll new file mode 100644 index 0000000..0754378 Binary files /dev/null and b/labs/lab9/Igra/bin/Debug/net9.0/Igra.dll differ diff --git a/labs/lab9/Igra/bin/Debug/net9.0/Igra.pdb b/labs/lab9/Igra/bin/Debug/net9.0/Igra.pdb new file mode 100644 index 0000000..af05b8b Binary files /dev/null and b/labs/lab9/Igra/bin/Debug/net9.0/Igra.pdb differ diff --git a/labs/lab9/Igra/bin/Debug/net9.0/Igra.runtimeconfig.json b/labs/lab9/Igra/bin/Debug/net9.0/Igra.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab9/Igra/bin/Debug/net9.0/Igra.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab9/Igra/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab9/Igra/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab9/Igra/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.AssemblyInfo.cs b/labs/lab9/Igra/obj/Debug/net9.0/Igra.AssemblyInfo.cs new file mode 100644 index 0000000..dccb4de --- /dev/null +++ b/labs/lab9/Igra/obj/Debug/net9.0/Igra.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Igra")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3d8c2bcfcb819e795b157f0ee3892cbbe80e98ce")] +[assembly: System.Reflection.AssemblyProductAttribute("Igra")] +[assembly: System.Reflection.AssemblyTitleAttribute("Igra")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.AssemblyInfoInputs.cache b/labs/lab9/Igra/obj/Debug/net9.0/Igra.AssemblyInfoInputs.cache new file mode 100644 index 0000000..558618a --- /dev/null +++ b/labs/lab9/Igra/obj/Debug/net9.0/Igra.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +bbb674618cf86df02c0dbff2d2948ef788fa38b1e42c83cd1a3b8bdef7509517 diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab9/Igra/obj/Debug/net9.0/Igra.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..2e44c9f --- /dev/null +++ b/labs/lab9/Igra/obj/Debug/net9.0/Igra.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Igra +build_property.ProjectDir = /home/nik/oop/labs/lab9/Igra/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.GlobalUsings.g.cs b/labs/lab9/Igra/obj/Debug/net9.0/Igra.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab9/Igra/obj/Debug/net9.0/Igra.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.assets.cache b/labs/lab9/Igra/obj/Debug/net9.0/Igra.assets.cache new file mode 100644 index 0000000..501c8c0 Binary files /dev/null and b/labs/lab9/Igra/obj/Debug/net9.0/Igra.assets.cache differ diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.csproj.CoreCompileInputs.cache b/labs/lab9/Igra/obj/Debug/net9.0/Igra.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..d900273 --- /dev/null +++ b/labs/lab9/Igra/obj/Debug/net9.0/Igra.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +965f402a393a8b3c3615bdffcb747854f7dda4ef84f8cdb7176cc338c3ebeb3f diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.csproj.FileListAbsolute.txt b/labs/lab9/Igra/obj/Debug/net9.0/Igra.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..afc505a --- /dev/null +++ b/labs/lab9/Igra/obj/Debug/net9.0/Igra.csproj.FileListAbsolute.txt @@ -0,0 +1,28 @@ +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra.deps.json +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra.runtimeconfig.json +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra.dll +/home/nik/oop/labs/lab7/Igra/bin/Debug/net9.0/Igra.pdb +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.AssemblyInfo.cs +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.dll +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/refint/Igra.dll +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.pdb +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/Igra.genruntimeconfig.cache +/home/nik/oop/labs/lab7/Igra/obj/Debug/net9.0/ref/Igra.dll +/home/nik/oop/labs/lab9/Igra/bin/Debug/net9.0/Igra +/home/nik/oop/labs/lab9/Igra/bin/Debug/net9.0/Igra.deps.json +/home/nik/oop/labs/lab9/Igra/bin/Debug/net9.0/Igra.runtimeconfig.json +/home/nik/oop/labs/lab9/Igra/bin/Debug/net9.0/Igra.dll +/home/nik/oop/labs/lab9/Igra/bin/Debug/net9.0/Igra.pdb +/home/nik/oop/labs/lab9/Igra/obj/Debug/net9.0/Igra.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab9/Igra/obj/Debug/net9.0/Igra.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab9/Igra/obj/Debug/net9.0/Igra.AssemblyInfo.cs +/home/nik/oop/labs/lab9/Igra/obj/Debug/net9.0/Igra.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab9/Igra/obj/Debug/net9.0/Igra.dll +/home/nik/oop/labs/lab9/Igra/obj/Debug/net9.0/refint/Igra.dll +/home/nik/oop/labs/lab9/Igra/obj/Debug/net9.0/Igra.pdb +/home/nik/oop/labs/lab9/Igra/obj/Debug/net9.0/Igra.genruntimeconfig.cache +/home/nik/oop/labs/lab9/Igra/obj/Debug/net9.0/ref/Igra.dll diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.dll b/labs/lab9/Igra/obj/Debug/net9.0/Igra.dll new file mode 100644 index 0000000..0754378 Binary files /dev/null and b/labs/lab9/Igra/obj/Debug/net9.0/Igra.dll differ diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.genruntimeconfig.cache b/labs/lab9/Igra/obj/Debug/net9.0/Igra.genruntimeconfig.cache new file mode 100644 index 0000000..b41e193 --- /dev/null +++ b/labs/lab9/Igra/obj/Debug/net9.0/Igra.genruntimeconfig.cache @@ -0,0 +1 @@ +15568ecbe258691d0d047c49ef46a9ffa3fb09a4efabd54b9ef7f9cc3e69a4d6 diff --git a/labs/lab9/Igra/obj/Debug/net9.0/Igra.pdb b/labs/lab9/Igra/obj/Debug/net9.0/Igra.pdb new file mode 100644 index 0000000..af05b8b Binary files /dev/null and b/labs/lab9/Igra/obj/Debug/net9.0/Igra.pdb differ diff --git a/labs/lab9/Igra/obj/Debug/net9.0/apphost b/labs/lab9/Igra/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..0ca2e3f Binary files /dev/null and b/labs/lab9/Igra/obj/Debug/net9.0/apphost differ diff --git a/labs/lab9/Igra/obj/Debug/net9.0/ref/Igra.dll b/labs/lab9/Igra/obj/Debug/net9.0/ref/Igra.dll new file mode 100644 index 0000000..f2c75b2 Binary files /dev/null and b/labs/lab9/Igra/obj/Debug/net9.0/ref/Igra.dll differ diff --git a/labs/lab9/Igra/obj/Debug/net9.0/refint/Igra.dll b/labs/lab9/Igra/obj/Debug/net9.0/refint/Igra.dll new file mode 100644 index 0000000..f2c75b2 Binary files /dev/null and b/labs/lab9/Igra/obj/Debug/net9.0/refint/Igra.dll differ diff --git a/labs/lab9/Igra/obj/Igra.csproj.nuget.dgspec.json b/labs/lab9/Igra/obj/Igra.csproj.nuget.dgspec.json new file mode 100644 index 0000000..f1e5af7 --- /dev/null +++ b/labs/lab9/Igra/obj/Igra.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab9/Igra/Igra.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab9/Igra/Igra.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab9/Igra/Igra.csproj", + "projectName": "Igra", + "projectPath": "/home/nik/oop/labs/lab9/Igra/Igra.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab9/Igra/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab9/Igra/obj/Igra.csproj.nuget.g.props b/labs/lab9/Igra/obj/Igra.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab9/Igra/obj/Igra.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab9/Igra/obj/Igra.csproj.nuget.g.targets b/labs/lab9/Igra/obj/Igra.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab9/Igra/obj/Igra.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab9/Igra/obj/project.assets.json b/labs/lab9/Igra/obj/project.assets.json new file mode 100644 index 0000000..6e7a664 --- /dev/null +++ b/labs/lab9/Igra/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab9/Igra/Igra.csproj", + "projectName": "Igra", + "projectPath": "/home/nik/oop/labs/lab9/Igra/Igra.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab9/Igra/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab9/Igra/obj/project.nuget.cache b/labs/lab9/Igra/obj/project.nuget.cache new file mode 100644 index 0000000..6a69b25 --- /dev/null +++ b/labs/lab9/Igra/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "cAalPGIUtAQ=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab9/Igra/Igra.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab9/LearningCenter/Administrator.cs b/labs/lab9/LearningCenter/Administrator.cs new file mode 100644 index 0000000..e7571a7 --- /dev/null +++ b/labs/lab9/LearningCenter/Administrator.cs @@ -0,0 +1,29 @@ +using System; + +class Administrator : Person, IEmployee +{ + public string Laboratory { get; } + public string Department => Laboratory; + public string Position => "Администратор"; + public int Experience { get; } + public decimal BaseRate { get; } + + public Administrator(string lastName, DateTime birthDate, string laboratory, int experience, decimal baseRate) + : base(lastName, birthDate) + { + Laboratory = laboratory; + Experience = experience; + BaseRate = baseRate; + } + + public override void Show() + { + Console.WriteLine("Администратор: {0}, лаб.: {1}, стаж: {2} лет, возраст: {3}", LastName, Laboratory, Experience, Age()); + } + + public decimal GetMonthlyPay() + { + return BaseRate * (1 + 0.05m * Experience); + } +} + diff --git a/labs/lab9/LearningCenter/IEmployee.cs b/labs/lab9/LearningCenter/IEmployee.cs new file mode 100644 index 0000000..4e80ea6 --- /dev/null +++ b/labs/lab9/LearningCenter/IEmployee.cs @@ -0,0 +1,10 @@ +using System; + +interface IEmployee +{ + string Department { get; } + string Position { get; } + int Experience { get; } + decimal GetMonthlyPay(); +} + diff --git a/labs/lab9/LearningCenter/LearningCenter.csproj b/labs/lab9/LearningCenter/LearningCenter.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab9/LearningCenter/LearningCenter.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab9/LearningCenter/Manager.cs b/labs/lab9/LearningCenter/Manager.cs new file mode 100644 index 0000000..f34d37a --- /dev/null +++ b/labs/lab9/LearningCenter/Manager.cs @@ -0,0 +1,31 @@ +using System; + +class Manager : Person, IEmployee +{ + public string Faculty { get; } + public string Role { get; } + public int Experience { get; } + public decimal BaseRate { get; } + public string Department => Faculty; + public string Position => Role; + + public Manager(string lastName, DateTime birthDate, string faculty, string role, int experience, decimal baseRate) + : base(lastName, birthDate) + { + Faculty = faculty; + Role = role; + Experience = experience; + BaseRate = baseRate; + } + + public override void Show() + { + Console.WriteLine("Менеджер: {0}, факультет: {1}, должность: {2}, стаж: {3} лет, возраст: {4}", LastName, Faculty, Role, Experience, Age()); + } + + public decimal GetMonthlyPay() + { + return BaseRate * (1 + 0.06m * Experience); + } +} + diff --git a/labs/lab9/LearningCenter/Person.cs b/labs/lab9/LearningCenter/Person.cs new file mode 100644 index 0000000..df1ea14 --- /dev/null +++ b/labs/lab9/LearningCenter/Person.cs @@ -0,0 +1,27 @@ +using System; + +abstract class Person +{ + public string LastName { get; } + public DateTime BirthDate { get; } + + protected Person(string lastName, DateTime birthDate) + { + LastName = lastName; + BirthDate = birthDate; + } + + public int Age() + { + var today = DateTime.Today; + int a = today.Year - BirthDate.Year; + if (BirthDate.Date > today.AddYears(-a)) a--; + return a; + } + + public virtual void Show() + { + Console.WriteLine("{0}, возраст: {1}", LastName, Age()); + } +} + diff --git a/labs/lab9/LearningCenter/Program.cs b/labs/lab9/LearningCenter/Program.cs new file mode 100644 index 0000000..867b4f0 --- /dev/null +++ b/labs/lab9/LearningCenter/Program.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +public class Program +{ + public static void Main(string[] args) + { + var people = new List + { + new Administrator("Иванова", new DateTime(1985, 3, 12), "Лаборатория сетей", 8, 900m), + new Student("Петров", new DateTime(2005, 11, 2), "ФКТИ", 2), + new Teacher("Сидоров", new DateTime(1979, 6, 25), "ФКТИ", "Доцент", 12, 1400m), + new Manager("Кузнецова", new DateTime(1990, 1, 5), "ФКТИ", "Менеджер проектов", 6, 1100m), + new Student("Орлова", new DateTime(2003, 4, 17), "ФПМИ", 4) + }; + + foreach (var p in people) p.Show(); + + Console.WriteLine(); + int from = 20, to = 40; + var inRange = people.Where(p => p.Age() >= from && p.Age() <= to); + foreach (var p in inRange) p.Show(); + + Console.WriteLine(); + foreach (var e in people.OfType()) + Console.WriteLine("{0}: {1}, подразделение: {2}, оклад: {3:F2}", e.GetType().Name, e.Position, e.Department, e.GetMonthlyPay()); + } +} + diff --git a/labs/lab9/LearningCenter/Student.cs b/labs/lab9/LearningCenter/Student.cs new file mode 100644 index 0000000..7087841 --- /dev/null +++ b/labs/lab9/LearningCenter/Student.cs @@ -0,0 +1,20 @@ +using System; + +class Student : Person +{ + public string Faculty { get; } + public int Course { get; } + + public Student(string lastName, DateTime birthDate, string faculty, int course) + : base(lastName, birthDate) + { + Faculty = faculty; + Course = course; + } + + public override void Show() + { + Console.WriteLine("Студент: {0}, факультет: {1}, курс: {2}, возраст: {3}", LastName, Faculty, Course, Age()); + } +} + diff --git a/labs/lab9/LearningCenter/Teacher.cs b/labs/lab9/LearningCenter/Teacher.cs new file mode 100644 index 0000000..be29b52 --- /dev/null +++ b/labs/lab9/LearningCenter/Teacher.cs @@ -0,0 +1,32 @@ +using System; + +class Teacher : Person, IEmployee +{ + public string Faculty { get; } + public string Rank { get; } + public int Experience { get; } + public decimal BaseRate { get; } + public string Department => Faculty; + public string Position => Rank; + + public Teacher(string lastName, DateTime birthDate, string faculty, string rank, int experience, decimal baseRate) + : base(lastName, birthDate) + { + Faculty = faculty; + Rank = rank; + Experience = experience; + BaseRate = baseRate; + } + + public override void Show() + { + Console.WriteLine("Преподаватель: {0}, факультет: {1}, должность: {2}, стаж: {3} лет, возраст: {4}", LastName, Faculty, Rank, Experience, Age()); + } + + public decimal GetMonthlyPay() + { + decimal mult = Rank.ToLower().Contains("проф") ? 1.4m : Rank.ToLower().Contains("доцент") ? 1.2m : 1.0m; + return BaseRate * mult * (1 + 0.04m * Experience); + } +} + diff --git a/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter new file mode 100755 index 0000000..8a7288e Binary files /dev/null and b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter differ diff --git a/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.deps.json b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.deps.json new file mode 100644 index 0000000..3adf76b --- /dev/null +++ b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "LearningCenter/1.0.0": { + "runtime": { + "LearningCenter.dll": {} + } + } + } + }, + "libraries": { + "LearningCenter/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.dll b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.dll new file mode 100644 index 0000000..be8f7bb Binary files /dev/null and b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.dll differ diff --git a/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.pdb b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.pdb new file mode 100644 index 0000000..d89c7af Binary files /dev/null and b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.pdb differ diff --git a/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.runtimeconfig.json b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab9/LearningCenter/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.AssemblyInfo.cs b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.AssemblyInfo.cs new file mode 100644 index 0000000..37da1c7 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("LearningCenter")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3d8c2bcfcb819e795b157f0ee3892cbbe80e98ce")] +[assembly: System.Reflection.AssemblyProductAttribute("LearningCenter")] +[assembly: System.Reflection.AssemblyTitleAttribute("LearningCenter")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.AssemblyInfoInputs.cache b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.AssemblyInfoInputs.cache new file mode 100644 index 0000000..a283b36 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +ef77545df48a5c7f7f5a2ad697fa1aea2a8429ce71d303a33ccab29bdc6ceb7b diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..2a24062 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = LearningCenter +build_property.ProjectDir = /home/nik/oop/labs/lab9/LearningCenter/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.GlobalUsings.g.cs b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.assets.cache b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.assets.cache new file mode 100644 index 0000000..5a3339f Binary files /dev/null and b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.assets.cache differ diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.csproj.CoreCompileInputs.cache b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..00680f9 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +74bfb843dcdc21d95e467d5dda07efca3f79d59baf0577fb68e477bcc3c50e14 diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.csproj.FileListAbsolute.txt b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..27f4d23 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/nik/oop/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter +/home/nik/oop/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.deps.json +/home/nik/oop/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.runtimeconfig.json +/home/nik/oop/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.dll +/home/nik/oop/labs/lab9/LearningCenter/bin/Debug/net9.0/LearningCenter.pdb +/home/nik/oop/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.AssemblyInfo.cs +/home/nik/oop/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.dll +/home/nik/oop/labs/lab9/LearningCenter/obj/Debug/net9.0/refint/LearningCenter.dll +/home/nik/oop/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.pdb +/home/nik/oop/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.genruntimeconfig.cache +/home/nik/oop/labs/lab9/LearningCenter/obj/Debug/net9.0/ref/LearningCenter.dll diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.dll b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.dll new file mode 100644 index 0000000..be8f7bb Binary files /dev/null and b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.dll differ diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.genruntimeconfig.cache b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.genruntimeconfig.cache new file mode 100644 index 0000000..e1d3c89 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.genruntimeconfig.cache @@ -0,0 +1 @@ +2881bd5043120c29a98549d5c5a275cd667e8cdd424f573b8a90ea248583233d diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.pdb b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.pdb new file mode 100644 index 0000000..d89c7af Binary files /dev/null and b/labs/lab9/LearningCenter/obj/Debug/net9.0/LearningCenter.pdb differ diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/apphost b/labs/lab9/LearningCenter/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..8a7288e Binary files /dev/null and b/labs/lab9/LearningCenter/obj/Debug/net9.0/apphost differ diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/ref/LearningCenter.dll b/labs/lab9/LearningCenter/obj/Debug/net9.0/ref/LearningCenter.dll new file mode 100644 index 0000000..df631b0 Binary files /dev/null and b/labs/lab9/LearningCenter/obj/Debug/net9.0/ref/LearningCenter.dll differ diff --git a/labs/lab9/LearningCenter/obj/Debug/net9.0/refint/LearningCenter.dll b/labs/lab9/LearningCenter/obj/Debug/net9.0/refint/LearningCenter.dll new file mode 100644 index 0000000..df631b0 Binary files /dev/null and b/labs/lab9/LearningCenter/obj/Debug/net9.0/refint/LearningCenter.dll differ diff --git a/labs/lab9/LearningCenter/obj/LearningCenter.csproj.nuget.dgspec.json b/labs/lab9/LearningCenter/obj/LearningCenter.csproj.nuget.dgspec.json new file mode 100644 index 0000000..e24e61c --- /dev/null +++ b/labs/lab9/LearningCenter/obj/LearningCenter.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab9/LearningCenter/LearningCenter.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab9/LearningCenter/LearningCenter.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab9/LearningCenter/LearningCenter.csproj", + "projectName": "LearningCenter", + "projectPath": "/home/nik/oop/labs/lab9/LearningCenter/LearningCenter.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab9/LearningCenter/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab9/LearningCenter/obj/LearningCenter.csproj.nuget.g.props b/labs/lab9/LearningCenter/obj/LearningCenter.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/LearningCenter.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab9/LearningCenter/obj/LearningCenter.csproj.nuget.g.targets b/labs/lab9/LearningCenter/obj/LearningCenter.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab9/LearningCenter/obj/LearningCenter.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab9/LearningCenter/obj/project.assets.json b/labs/lab9/LearningCenter/obj/project.assets.json new file mode 100644 index 0000000..d2194d0 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab9/LearningCenter/LearningCenter.csproj", + "projectName": "LearningCenter", + "projectPath": "/home/nik/oop/labs/lab9/LearningCenter/LearningCenter.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab9/LearningCenter/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab9/LearningCenter/obj/project.nuget.cache b/labs/lab9/LearningCenter/obj/project.nuget.cache new file mode 100644 index 0000000..1386225 --- /dev/null +++ b/labs/lab9/LearningCenter/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "GKDBL/0OUoU=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab9/LearningCenter/LearningCenter.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab9/MyClass/Book.cs b/labs/lab9/MyClass/Book.cs new file mode 100644 index 0000000..df50fd7 --- /dev/null +++ b/labs/lab9/MyClass/Book.cs @@ -0,0 +1,102 @@ +using System; + +class Book : Item +{ + private String author; + private String title; + private String publisher; + private int pages; + private int year; + + private static double price = 9; + private bool returnSrok = false; + + static Book() + { + price = 10; + } + + public Book() + { + + } + + + public Book(String author, String title, String publisher, int pages, int year, long invNumber, bool taken) : base (invNumber, taken) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public Book(String author, String title) + { + this.author = author; + this.title = title; + } + + public void SetBook(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public static void SetPrice(double price) + { + Book.price = price; + } + + + public override void Show() + { + Console.WriteLine("\nКнига:\n Автор: {0}\n Название: {1}\n Год издания: {2}\n {3} стр.\n Стоимость аренды: {4}", author, title, year, pages, Book.price); + base.Show(); + } + + + public double PriceBook(int s) + { + double cost = s * price; + return cost; + } + + public override void Return() + { + taken = ReturnSrok; + } + + public delegate void ProcessBookDelegate(Book book); + + public void ProcessPaperbackBooks(ProcessBookDelegate processBook) + { + if (ReturnSrok) + processBook(this); + } + + public static event ProcessBookDelegate RetSrok; + + public bool ReturnSrok + { + get + { + return returnSrok; + } + set + { + returnSrok = value; + if (ReturnSrok == true) + RetSrok(this); + } + } + + public override string ToString() + { + string str = this.title + ", " + this.author + " Инв. номер " + this.invNumber; + return str; + } +} diff --git a/labs/lab9/MyClass/Item.cs b/labs/lab9/MyClass/Item.cs new file mode 100644 index 0000000..97494d2 --- /dev/null +++ b/labs/lab9/MyClass/Item.cs @@ -0,0 +1,47 @@ +using System; + +abstract class Item +{ + protected long invNumber; + protected bool taken; + + public Item(long invNumber, bool taken) + { + this.invNumber = invNumber; + this.taken = taken; + } + + public Item() + { + this.taken = true; + } + + public bool IsAvailable() + { + return taken; + } + + public long GetInvNumber() + { + return invNumber; + } + + private void Take() + { + taken = false; + } + + public void TakeItem() + { + if (this.IsAvailable()) + this.Take(); + } + + + abstract public void Return(); + + public virtual void Show() + { + Console.WriteLine("Состояние единицы хранения:\n Инвентарный номер: {0}\n Наличие: {1}", invNumber, taken); + } +} diff --git a/labs/lab9/MyClass/Magazine.cs b/labs/lab9/MyClass/Magazine.cs new file mode 100644 index 0000000..bc325e8 --- /dev/null +++ b/labs/lab9/MyClass/Magazine.cs @@ -0,0 +1,33 @@ +using System; + +class Magazine : Item +{ + private String volume; + private int number; + private String title; + private int year; + + public Magazine(String volume, int number, String title, int year, long invNumber, bool taken) : base(invNumber, taken) + { + this.volume = volume; + this.number = number; + this.title = title; + this.year = year; + } + + public Magazine() + {} + + public override void Show() + { + Console.WriteLine("\nЖурнал:\n Том: {0}\n Номер: {1}\n Название: {2}\n Год выпуска: {3}", volume, number, title, year); + base.Show(); + } + + + public override void Return() + { + taken = true; + } + +} diff --git a/labs/lab9/MyClass/MyClass.csproj b/labs/lab9/MyClass/MyClass.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/labs/lab9/MyClass/MyClass.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/labs/lab9/MyClass/Operation.cs b/labs/lab9/MyClass/Operation.cs new file mode 100644 index 0000000..84901e3 --- /dev/null +++ b/labs/lab9/MyClass/Operation.cs @@ -0,0 +1,14 @@ +using System; + +class Operation +{ + public static void PrintTitle(Book b) + { + b.Show(); + } + + public static void MetodObrabotchik(Book b) + { + Console.WriteLine("Книга {0} сдана в срок.", b.ToString()); + } +} diff --git a/labs/lab9/MyClass/Program.cs b/labs/lab9/MyClass/Program.cs new file mode 100644 index 0000000..caf46ae --- /dev/null +++ b/labs/lab9/MyClass/Program.cs @@ -0,0 +1,73 @@ +using System; + +public class Program +{ + public static void Main(string[] args) + { + /* + Book b1 = new Book(); + b1.SetBook("Пушкин А.С.", "Капитанская дочка", "Вильямс", 123, 2012); + Book.SetPrice(12); + b1.Show(); + Console.WriteLine("\n Итоговая стоимость аренды: {0} р.", b1.PriceBook(3)); + + Book b2 = new Book("Толстой Л.Н.", "Война и мир", "Наука и жизнь", 1234, 2013); + b2.Show(); + + Book b3 = new Book("Лермонтов М.Ю.", "Мцыри"); + b3.Show(); + + + Triangle t1 = new Triangle(3, 4, 5); + t1.Show(); + Console.WriteLine("perimeter = {0}", t1.Perimeter()); + Console.WriteLine("area = {0}", t1.Area()); + Console.WriteLine("does this triangle exist? {0}", t1.Exists()); + + Triangle t2 = new Triangle(3, 4, 7); + t2.Show(); + Console.WriteLine("does this triangle exist? {0}", t2.Exists()); + */ + + // Item item1 = new Item(); + // item1.Show(); + + /* + Book b2 = new Book("Толстой Л. Н.", "Война и мир", "Наука и жизнь", 1234, 2013, 101, true); + + b2.Show(); + b2.TakeItem(); + b2.Show(); + + + Magazine mag1 = new Magazine("О природе", 5, "Земля и мы", 2014, 1235, true); + mag1.Show(); + + Console.WriteLine("\n Тестирование полиформизма"); + Item it; + + it = b2; + it.TakeItem(); + it.Return(); + it.Show(); + + it = mag1; + it.TakeItem(); + it.Return(); + it.Show(); + + */ + + Book b4 = new Book("Толстой Л.Н.", "Анна Каренина", "Знание", 1204, 2014, 103, true); + Book b5 = new Book("Неш Т", "Программирование для профессионалов", "Вильямс", 1200, 2014, 108, true); + + Book.RetSrok += new Book.ProcessBookDelegate(Operation.MetodObrabotchik); + + b4.ReturnSrok = true; + b5.ReturnSrok = true; + + Console.WriteLine("\nКниги возвращены в срок:"); + b4.ProcessPaperbackBooks(Operation.PrintTitle); + b5.ProcessPaperbackBooks(Operation.PrintTitle); + } +} diff --git a/labs/lab9/MyClass/Triangle.cs b/labs/lab9/MyClass/Triangle.cs new file mode 100644 index 0000000..e06e4e8 --- /dev/null +++ b/labs/lab9/MyClass/Triangle.cs @@ -0,0 +1,42 @@ +using System; + +class Triangle +{ + private int a; + private int b; + private int c; + + public Triangle(int a, int b, int c) + { + this.a = a; + this.b = b; + this.c = c; + } + + public void Show() + { + Console.WriteLine("a: {0}\nb: {1}\nc: {2}", a, b, c); + } + + public int Perimeter() + { + return a + b + c; + } + + public double Area() + { + double p = Perimeter() / 2; + return Math.Sqrt(p * (p - a) * (p - b) * (p - c)); + } + + public bool Exists() + { + if (a <= 0 || b <= 0 || c <= 0) return false; + + double maxSide = Math.Max(Math.Max(a, b), Math.Max(b, c)); + + if (maxSide >= a + b + c - maxSide) return false; + + return true; + } +} diff --git a/labs/lab9/MyClass/bin/Debug/net9.0/MyClass b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass new file mode 100755 index 0000000..0610dad Binary files /dev/null and b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass differ diff --git a/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.deps.json b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.deps.json new file mode 100644 index 0000000..7960ce5 --- /dev/null +++ b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "MyClass/1.0.0": { + "runtime": { + "MyClass.dll": {} + } + } + } + }, + "libraries": { + "MyClass/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.dll b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.dll new file mode 100644 index 0000000..28b03dc Binary files /dev/null and b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.dll differ diff --git a/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.pdb b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.pdb new file mode 100644 index 0000000..b892e88 Binary files /dev/null and b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.pdb differ diff --git a/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/labs/lab9/MyClass/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/labs/lab9/MyClass/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs new file mode 100644 index 0000000..d633ed4 --- /dev/null +++ b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("MyClass")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3d8c2bcfcb819e795b157f0ee3892cbbe80e98ce")] +[assembly: System.Reflection.AssemblyProductAttribute("MyClass")] +[assembly: System.Reflection.AssemblyTitleAttribute("MyClass")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache new file mode 100644 index 0000000..fe02e05 --- /dev/null +++ b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +5f1e2d2b133ade4a16757283d3dfb38173bab760f9f2a01cde057378fdd200f8 diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..a3b4892 --- /dev/null +++ b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = MyClass +build_property.ProjectDir = /home/nik/oop/labs/lab9/MyClass/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.GlobalUsings.g.cs b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.assets.cache b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.assets.cache new file mode 100644 index 0000000..c666efe Binary files /dev/null and b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.assets.cache differ diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..6020eb3 --- /dev/null +++ b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +b6eeb5bdef6e2c02644aaa75969222ad56a8ae5fa848f2b9a0bf36c77dbdc1fd diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.csproj.FileListAbsolute.txt b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..e955d22 --- /dev/null +++ b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.csproj.FileListAbsolute.txt @@ -0,0 +1,28 @@ +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.deps.json +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab7/MyClass/bin/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/refint/MyClass.dll +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache +/home/nik/oop/labs/lab7/MyClass/obj/Debug/net9.0/ref/MyClass.dll +/home/nik/oop/labs/lab9/MyClass/bin/Debug/net9.0/MyClass +/home/nik/oop/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.deps.json +/home/nik/oop/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.runtimeconfig.json +/home/nik/oop/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab9/MyClass/bin/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.GeneratedMSBuildEditorConfig.editorconfig +/home/nik/oop/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfoInputs.cache +/home/nik/oop/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.AssemblyInfo.cs +/home/nik/oop/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.csproj.CoreCompileInputs.cache +/home/nik/oop/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.dll +/home/nik/oop/labs/lab9/MyClass/obj/Debug/net9.0/refint/MyClass.dll +/home/nik/oop/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.pdb +/home/nik/oop/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache +/home/nik/oop/labs/lab9/MyClass/obj/Debug/net9.0/ref/MyClass.dll diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.dll b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.dll new file mode 100644 index 0000000..28b03dc Binary files /dev/null and b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.dll differ diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache new file mode 100644 index 0000000..a06c00e --- /dev/null +++ b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.genruntimeconfig.cache @@ -0,0 +1 @@ +d590c4e74bd8755742999ea3cdcebb807222eb4693e8da32b2ee5d12d5003488 diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.pdb b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.pdb new file mode 100644 index 0000000..b892e88 Binary files /dev/null and b/labs/lab9/MyClass/obj/Debug/net9.0/MyClass.pdb differ diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/apphost b/labs/lab9/MyClass/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..0610dad Binary files /dev/null and b/labs/lab9/MyClass/obj/Debug/net9.0/apphost differ diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/ref/MyClass.dll b/labs/lab9/MyClass/obj/Debug/net9.0/ref/MyClass.dll new file mode 100644 index 0000000..343832f Binary files /dev/null and b/labs/lab9/MyClass/obj/Debug/net9.0/ref/MyClass.dll differ diff --git a/labs/lab9/MyClass/obj/Debug/net9.0/refint/MyClass.dll b/labs/lab9/MyClass/obj/Debug/net9.0/refint/MyClass.dll new file mode 100644 index 0000000..343832f Binary files /dev/null and b/labs/lab9/MyClass/obj/Debug/net9.0/refint/MyClass.dll differ diff --git a/labs/lab9/MyClass/obj/MyClass.csproj.nuget.dgspec.json b/labs/lab9/MyClass/obj/MyClass.csproj.nuget.dgspec.json new file mode 100644 index 0000000..52a8c70 --- /dev/null +++ b/labs/lab9/MyClass/obj/MyClass.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/home/nik/oop/labs/lab9/MyClass/MyClass.csproj": {} + }, + "projects": { + "/home/nik/oop/labs/lab9/MyClass/MyClass.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab9/MyClass/MyClass.csproj", + "projectName": "MyClass", + "projectPath": "/home/nik/oop/labs/lab9/MyClass/MyClass.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab9/MyClass/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/labs/lab9/MyClass/obj/MyClass.csproj.nuget.g.props b/labs/lab9/MyClass/obj/MyClass.csproj.nuget.g.props new file mode 100644 index 0000000..ad2a452 --- /dev/null +++ b/labs/lab9/MyClass/obj/MyClass.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/nik/.nuget/packages/ + /home/nik/.nuget/packages/ + PackageReference + 6.12.4 + + + + + \ No newline at end of file diff --git a/labs/lab9/MyClass/obj/MyClass.csproj.nuget.g.targets b/labs/lab9/MyClass/obj/MyClass.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/labs/lab9/MyClass/obj/MyClass.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/labs/lab9/MyClass/obj/project.assets.json b/labs/lab9/MyClass/obj/project.assets.json new file mode 100644 index 0000000..c0840e5 --- /dev/null +++ b/labs/lab9/MyClass/obj/project.assets.json @@ -0,0 +1,78 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "/home/nik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/nik/oop/labs/lab9/MyClass/MyClass.csproj", + "projectName": "MyClass", + "projectPath": "/home/nik/oop/labs/lab9/MyClass/MyClass.csproj", + "packagesPath": "/home/nik/.nuget/packages/", + "outputPath": "/home/nik/oop/labs/lab9/MyClass/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/nik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "downloadDependencies": [ + { + "name": "Microsoft.AspNetCore.App.Ref", + "version": "[9.0.9, 9.0.9]" + } + ], + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.110/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/labs/lab9/MyClass/obj/project.nuget.cache b/labs/lab9/MyClass/obj/project.nuget.cache new file mode 100644 index 0000000..8a1ab5e --- /dev/null +++ b/labs/lab9/MyClass/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "foRFbJcq8dk=", + "success": true, + "projectFilePath": "/home/nik/oop/labs/lab9/MyClass/MyClass.csproj", + "expectedPackageFiles": [ + "/home/nik/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.9/microsoft.aspnetcore.app.ref.9.0.9.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/labs/lab9/assets/1.png b/labs/lab9/assets/1.png new file mode 100644 index 0000000..9ebdc70 Binary files /dev/null and b/labs/lab9/assets/1.png differ diff --git a/labs/lab9/assets/2.png b/labs/lab9/assets/2.png new file mode 100644 index 0000000..a80b306 Binary files /dev/null and b/labs/lab9/assets/2.png differ diff --git a/labs/lab9/assets/3.png b/labs/lab9/assets/3.png new file mode 100644 index 0000000..6e55b01 Binary files /dev/null and b/labs/lab9/assets/3.png differ diff --git a/labs/lab9/assets/4.png b/labs/lab9/assets/4.png new file mode 100644 index 0000000..5500178 Binary files /dev/null and b/labs/lab9/assets/4.png differ diff --git a/labs/lab9/report.pdf b/labs/lab9/report.pdf new file mode 100644 index 0000000..a0e9239 Binary files /dev/null and b/labs/lab9/report.pdf differ diff --git a/labs/lab9/report.typ b/labs/lab9/report.typ new file mode 100644 index 0000000..6a7dafa --- /dev/null +++ b/labs/lab9/report.typ @@ -0,0 +1,649 @@ +#set text(size: 1.3em) + +#show raw.where(block: false): box.with( + fill: luma(240), + inset: (x: 3pt, y: 0pt), + outset: (y: 3pt), + radius: 2pt, +) + +#show raw.where(block: true): block.with( + fill: luma(240), + inset: 10pt, + radius: 4pt, +) + +// title + +#align(center)[Санкт-Петербургский национальный исследовательский университет информационных технологий, механики и оптики] +\ +\ +\ +#align(center)[Факультет инфокоммуникационных технологий] +#align(center)[Направление подготовки 11.03.02] +\ +\ +#align(center)[Лабораторная работа №9] +#align(center)[Применение делегатов и событий] +\ +\ +\ //#align(center)[Вариант 19] +\ +\ +\ +\ +\ +\ +\ +#align(right)[Выполнил:] +#align(right)[Дощенников Никита Андреевич] +#align(right)[Группа: К3221] +#align(right)[Проверил:] +#align(right)[Иванов Сергей Евгеньевич] +\ +\ +#align(center)[Санкт-Петербург] +#align(center)[2025] + +#pagebreak() + +=== Цель работы: + +Научиться работать с делегатами и событиями и применять их. + +=== Упражнение 1. Использование делегата при вызове метода. + +В этом упражнении я реализовал в классе `Book` возможность вызова метода через делегат. + +```cs +using System; + +class Operation +{ + public static void PrintTitle(Book b) + { + b.Show(); + } +} +``` + +```cs +using System; + +class Book : Item +{ + private String author; + private String title; + private String publisher; + private int pages; + private int year; + + private static double price = 9; + + static Book() + { + price = 10; + } + + public Book() + { + + } + + + public Book(String author, String title, String publisher, int pages, int year, long invNumber, bool taken) : base (invNumber, taken) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public Book(String author, String title) + { + this.author = author; + this.title = title; + } + + public void SetBook(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public static void SetPrice(double price) + { + Book.price = price; + } + + + public override void Show() + { + Console.WriteLine("\nКнига:\n Автор: {0}\n Название: {1}\n Год издания: {2}\n {3} стр.\n Стоимость аренды: {4}", author, title, year, pages, Book.price); + base.Show(); + } + + + public double PriceBook(int s) + { + double cost = s * price; + return cost; + } + + public override void Return() + { + taken = ReturnSrok; + } + + public delegate void ProcessBookDelegate(Book book); + + public bool ReturnSrok { get; set; } + + public void ProcessPaperbackBooks(ProcessBookDelegate processBook) + { + if (ReturnSrok) + processBook(this); + } +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Book b4 = new Book("Толстой Л.Н.", "Анна Каренина", "Знание", 1204, 2014, 103, true); + Book b5 = new Book("Неш Т", "Программирование для профессионалов", "Вильямс", 1200, 2014, 108, true); + + b4.ReturnSrok = true; + b5.ReturnSrok = false; + + Console.WriteLine("\nКниги возвращены в срок:"); + b4.ProcessPaperbackBooks(Operation.PrintTitle); + b5.ProcessPaperbackBooks(Operation.PrintTitle); +} +``` + +Пример: + +#align(center)[#image("assets/1.png")] + +=== Упражнение 2. Работа с событиями. + +В этом упражнении я в классе `Book` объявил событие "возвращение книги в срок", и объекты этого класса смогли уведомлять объекты других классов о данном событии. + +```cs +using System; + +class Book : Item +{ + private String author; + private String title; + private String publisher; + private int pages; + private int year; + + private static double price = 9; + private bool returnSrok = false; + + static Book() + { + price = 10; + } + + public Book() + { + + } + + + public Book(String author, String title, String publisher, int pages, int year, long invNumber, bool taken) : base (invNumber, taken) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public Book(String author, String title) + { + this.author = author; + this.title = title; + } + + public void SetBook(String author, String title, String publisher, int pages, int year) + { + this.author = author; + this.title = title; + this.publisher = publisher; + this.pages = pages; + this.year = year; + } + + public static void SetPrice(double price) + { + Book.price = price; + } + + + public override void Show() + { + Console.WriteLine("\nКнига:\n Автор: {0}\n Название: {1}\n Год издания: {2}\n {3} стр.\n Стоимость аренды: {4}", author, title, year, pages, Book.price); + base.Show(); + } + + + public double PriceBook(int s) + { + double cost = s * price; + return cost; + } + + public override void Return() + { + taken = ReturnSrok; + } + + public delegate void ProcessBookDelegate(Book book); + + public void ProcessPaperbackBooks(ProcessBookDelegate processBook) + { + if (ReturnSrok) + processBook(this); + } + + public static event ProcessBookDelegate RetSrok; + + public bool ReturnSrok + { + get + { + return returnSrok; + } + set + { + returnSrok = value; + if (ReturnSrok == true) + RetSrok(this); + } + } + + public override string ToString() + { + string str = this.title + ", " + this.author + " Инв. номер " + this.invNumber; + return str; + } +} +``` + +```cs +using System; + +class Operation +{ + public static void PrintTitle(Book b) + { + b.Show(); + } + + public static void MetodObrabotchik(Book b) + { + Console.WriteLine("Книга {0} сдана в срок.", b.ToString()); + } +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Book b4 = new Book("Толстой Л.Н.", "Анна Каренина", "Знание", 1204, 2014, 103, true); + Book b5 = new Book("Неш Т", "Программирование для профессионалов", "Вильямс", 1200, 2014, 108, true); + + Book.RetSrok += new Book.ProcessBookDelegate(Operation.MetodObrabotchik); + + b4.ReturnSrok = true; + b5.ReturnSrok = true; + + Console.WriteLine("\nКниги возвращены в срок:"); + b4.ProcessPaperbackBooks(Operation.PrintTitle); + b5.ProcessPaperbackBooks(Operation.PrintTitle); +} +``` + +Пример: + +#align(center)[#image("assets/2.png")] + +=== Упражнение 3. Реализация события. + +В этом упражнении в проекте `IgralnayaKost` я реализовал возникновение события "выпало максимальное количество очков" при броске игрального кубика. + +```cs +using System; + +class Gamer +{ + string Name; + IgralnayaKost seans; + + public Gamer(string name) + { + Name = name; + seans = new IgralnayaKost(); + seans.MaxRolled += OnMaxRolled; + } + + void OnMaxRolled(int value) + { + Console.WriteLine("Событие: у игрока {0} выпало максимальное количество очков ({1})", Name, value); + } + + public int SeansGame() + { + return seans.random(); + } + + public override string ToString() + { + return Name; + } +} +``` + +```cs +using System; + +class IgralnayaKost +{ + readonly Random r; + public event Action MaxRolled; + + public IgralnayaKost() + { + r = new Random(); + } + + public int random() + { + int res = r.Next(6) + 1; + if (res == 6) MaxRolled?.Invoke(res); + return res; + } +} +``` + +Тесты: + +```cs +public static void Main(string[] args) +{ + Gamer g1 = new Gamer("Niko"); + + for (int i = 1; i <= 6; i++) + { + Console.WriteLine("Выпало количество очков {0} для игрока {1}", g1.SeansGame(), g1.ToString()); + } +} +``` + +Пример: + +#align(center)[#image("assets/3.png")] + +=== Упражнение 4. Иерархия классов учебного центра. + +В этом задании я реализовал иерархию классов учебного центра. + +```cs +using System; + +class Administrator : Person, IEmployee +{ + public string Laboratory { get; } + public string Department => Laboratory; + public string Position => "Администратор"; + public int Experience { get; } + public decimal BaseRate { get; } + + public Administrator(string lastName, DateTime birthDate, string laboratory, int experience, decimal baseRate) + : base(lastName, birthDate) + { + Laboratory = laboratory; + Experience = experience; + BaseRate = baseRate; + } + + public override void Show() + { + Console.WriteLine("Администратор: {0}, лаб.: {1}, стаж: {2} лет, возраст: {3}", LastName, Laboratory, Experience, Age()); + } + + public decimal GetMonthlyPay() + { + return BaseRate * (1 + 0.05m * Experience); + } +} +``` + +```cs +using System; + +interface IEmployee +{ + string Department { get; } + string Position { get; } + int Experience { get; } + decimal GetMonthlyPay(); +} +``` + +```cs +using System; + +class Manager : Person, IEmployee +{ + public string Faculty { get; } + public string Role { get; } + public int Experience { get; } + public decimal BaseRate { get; } + public string Department => Faculty; + public string Position => Role; + + public Manager(string lastName, DateTime birthDate, string faculty, string role, int experience, decimal baseRate) + : base(lastName, birthDate) + { + Faculty = faculty; + Role = role; + Experience = experience; + BaseRate = baseRate; + } + + public override void Show() + { + Console.WriteLine("Менеджер: {0}, факультет: {1}, должность: {2}, стаж: {3} лет, возраст: {4}", LastName, Faculty, Role, Experience, Age()); + } + + public decimal GetMonthlyPay() + { + return BaseRate * (1 + 0.06m * Experience); + } +} +``` + +```cs +using System; + +abstract class Person +{ + public string LastName { get; } + public DateTime BirthDate { get; } + + protected Person(string lastName, DateTime birthDate) + { + LastName = lastName; + BirthDate = birthDate; + } + + public int Age() + { + var today = DateTime.Today; + int a = today.Year - BirthDate.Year; + if (BirthDate.Date > today.AddYears(-a)) a--; + return a; + } + + public virtual void Show() + { + Console.WriteLine("{0}, возраст: {1}", LastName, Age()); + } +} +``` + +```cs +using System; + +class Student : Person +{ + public string Faculty { get; } + public int Course { get; } + + public Student(string lastName, DateTime birthDate, string faculty, int course) + : base(lastName, birthDate) + { + Faculty = faculty; + Course = course; + } + + public override void Show() + { + Console.WriteLine("Студент: {0}, факультет: {1}, курс: {2}, возраст: {3}", LastName, Faculty, Course, Age()); + } +} +``` + +```cs +using System; + +class Teacher : Person, IEmployee +{ + public string Faculty { get; } + public string Rank { get; } + public int Experience { get; } + public decimal BaseRate { get; } + public string Department => Faculty; + public string Position => Rank; + + public Teacher(string lastName, DateTime birthDate, string faculty, string rank, int experience, decimal baseRate) + : base(lastName, birthDate) + { + Faculty = faculty; + Rank = rank; + Experience = experience; + BaseRate = baseRate; + } + + public override void Show() + { + Console.WriteLine("Преподаватель: {0}, факультет: {1}, должность: {2}, стаж: {3} лет, возраст: {4}", LastName, Faculty, Rank, Experience, Age()); + } + + public decimal GetMonthlyPay() + { + decimal mult = Rank.ToLower().Contains("проф") ? 1.4m : Rank.ToLower().Contains("доцент") ? 1.2m : 1.0m; + return BaseRate * mult * (1 + 0.04m * Experience); + } +} +``` + +Тесты: + +```cs +using System; +using System.Collections.Generic; +using System.Linq; + +public class Program +{ + public static void Main(string[] args) + { + var people = new List + { + new Administrator("Иванова", new DateTime(1985, 3, 12), "Лаборатория сетей", 8, 900m), + new Student("Петров", new DateTime(2005, 11, 2), "ФКТИ", 2), + new Teacher("Сидоров", new DateTime(1979, 6, 25), "ФКТИ", "Доцент", 12, 1400m), + new Manager("Кузнецова", new DateTime(1990, 1, 5), "ФКТИ", "Менеджер проектов", 6, 1100m), + new Student("Орлова", new DateTime(2003, 4, 17), "ФПМИ", 4) + }; + + foreach (var p in people) p.Show(); + + Console.WriteLine(); + int from = 20, to = 40; + var inRange = people.Where(p => p.Age() >= from && p.Age() <= to); + foreach (var p in inRange) p.Show(); + + Console.WriteLine(); + foreach (var e in people.OfType()) + Console.WriteLine("{0}: {1}, подразделение: {2}, оклад: {3:F2}", e.GetType().Name, e.Position, e.Department, e.GetMonthlyPay()); + } +} +``` + +Пример: + +#align(center)[#image("assets/4.png")] + +=== Вывод. + +В ходе проделанной работы я научился работать с делегатами и событиями и применять их. + +=== Code review. (by #link("https://zzzcode.ai")[zzzcode.ai]) + +*Резюме* + +Код представляет собой реализацию игры с использованием классов для игроков и игральных костей. Основные функции включают генерацию случайных значений и обработку событий. В целом, код хорошо структурирован, но требует некоторых улучшений в области стиля и читаемости. + +*Ошибка* + +В методе `random()` класса `IgralnayaKost` название метода не соответствует стандартам именования в C\#. Рекомендуется переименовать его в `Roll()` для лучшего понимания. + +*Стиль кода* + +Код в целом следует стандартам C\#, однако есть некоторые моменты, которые можно улучшить: Имена переменных и методов должны быть написаны в стиле `PascalCase`. Необходимо использовать явные модификаторы доступа (например, `public`, `private`) для всех членов класса. + +*Структура кода* + +Структура классов логична, однако стоит рассмотреть возможность разделения на отдельные файлы для каждого класса, чтобы улучшить организацию проекта и упростить навигацию. + +*Читаемость* + +Читаемость кода можно улучшить, добавив комментарии к методам и классам, а также следуя единообразному стилю именования. Например, использование `seans` как имени переменной может быть неочевидным для других разработчиков. + +*Производительность* + +Код работает эффективно для текущих задач, однако стоит обратить внимание на создание экземпляра `Random` в каждом вызове. Рекомендуется создать один экземпляр `Random` и использовать его повторно. + +*Масштабируемость* + +Код легко масштабируется, так как добавление новых типов игроков или игральных костей не требует значительных изменений в существующей логике. Однако стоит учитывать возможность добавления новых функций и их влияние на текущую архитектуру. + +*Безопасность* + +Код не содержит явных уязвимостей, однако стоит учитывать обработку исключений, особенно в методах, которые могут вызывать ошибки, например, при работе с пользовательским вводом. + +*Обработка ошибок* + +В текущем коде отсутствует обработка ошибок. Рекомендуется добавить обработку исключений, чтобы предотвратить сбои программы в случае неожиданных ситуаций. + +*Заключение* + +Код представляет собой хорошую основу для игры, но требует некоторых улучшений в области стиля, читаемости и обработки ошибок. Рекомендуется внести предложенные изменения для повышения качества и удобства работы с кодом. + + diff --git a/tasks.pdf b/tasks.pdf new file mode 100644 index 0000000..21735bb Binary files /dev/null and b/tasks.pdf differ