theme changed

This commit is contained in:
nik
2025-09-30 08:21:09 +03:00
parent 4c261f7def
commit 8bd93df2ae
917 changed files with 15023 additions and 0 deletions

View File

@@ -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);
}
}

View File

@@ -0,0 +1,10 @@
using System;
interface IEmployee
{
string Department { get; }
string Position { get; }
int Experience { get; }
decimal GetMonthlyPay();
}

View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -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);
}
}

View File

@@ -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());
}
}

View File

@@ -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<Person>
{
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<IEmployee>())
Console.WriteLine("{0}: {1}, подразделение: {2}, оклад: {3:F2}", e.GetType().Name, e.Position, e.Department, e.GetMonthlyPay());
}
}

View File

@@ -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());
}
}

View File

@@ -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);
}
}

Binary file not shown.

View File

@@ -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": ""
}
}
}

View File

@@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net9.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "9.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")]

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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.

View File

@@ -0,0 +1 @@
ef77545df48a5c7f7f5a2ad697fa1aea2a8429ce71d303a33ccab29bdc6ceb7b

View File

@@ -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 =

View File

@@ -0,0 +1,8 @@
// <auto-generated/>
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;

View File

@@ -0,0 +1 @@
74bfb843dcdc21d95e467d5dda07efca3f79d59baf0577fb68e477bcc3c50e14

View File

@@ -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

View File

@@ -0,0 +1 @@
2881bd5043120c29a98549d5c5a275cd667e8cdd424f573b8a90ea248583233d

Binary file not shown.

View File

@@ -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"
}
}
}
}
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/nik/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/nik/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.12.4</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/home/nik/.nuget/packages/" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@@ -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"
}
}
}
}

View File

@@ -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": []
}