diff --git a/20/Lab20/Lab20.cpp b/20/Lab20/Lab20.cpp new file mode 100644 index 0000000..a38fa43 --- /dev/null +++ b/20/Lab20/Lab20.cpp @@ -0,0 +1,64 @@ +#include +#include +#include + +using namespace std; + +struct Employee { + string surname; + string position; + string education; + int birth_year; + double salary; +}; + +int main() { + + SetConsoleOutputCP(CP_UTF8); + + int n; + cout << "Введіть кількість працівників: "; + cin >> n; + + Employee* employees = new Employee[n]; + + // ввід даних про кожного працівника + for (int i = 0; i < n; i++) { + cout << "Введіть дані про працівника #" << i + 1 << ":" << endl; + cout << "Призвіще: "; + cin >> employees[i].surname; + cout << "Посада: "; + cin >> employees[i].position; + cout << "Освіта: "; + cin >> employees[i].education; + cout << "Рік народження: "; + cin >> employees[i].birth_year; + cout << "Зарплатня: "; + cin >> employees[i].salary; + } + + // обчислення середнього значення зарплатні + double total_salary = 0; + for (int i = 0; i < n; i++) { + total_salary += employees[i].salary; + } + double average_salary = total_salary / n; + + // відбір працівників зарплатня яких більше середнього значення + int count = 0; + Employee* selected_employees = new Employee[n]; + for (int i = 0; i < n; i++) { + if (employees[i].salary > average_salary) { + selected_employees[count] = employees[i]; + count++; + } + } + + // вивід результатів + cout << "Працівники із ЗП вище середньої:" << endl; + for (int i = 0; i < count; i++) { + cout << selected_employees[i].surname << " (" << selected_employees[i].position << "): " << selected_employees[i].salary << endl; + } + + return 0; +} diff --git a/20/Lab20/Lab20.sln b/20/Lab20/Lab20.sln new file mode 100644 index 0000000..ad0935a --- /dev/null +++ b/20/Lab20/Lab20.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32929.385 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lab20", "Lab20.vcxproj", "{758EFDDB-456E-43E6-AE8F-184D37802B7C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {758EFDDB-456E-43E6-AE8F-184D37802B7C}.Debug|x64.ActiveCfg = Debug|x64 + {758EFDDB-456E-43E6-AE8F-184D37802B7C}.Debug|x64.Build.0 = Debug|x64 + {758EFDDB-456E-43E6-AE8F-184D37802B7C}.Debug|x86.ActiveCfg = Debug|Win32 + {758EFDDB-456E-43E6-AE8F-184D37802B7C}.Debug|x86.Build.0 = Debug|Win32 + {758EFDDB-456E-43E6-AE8F-184D37802B7C}.Release|x64.ActiveCfg = Release|x64 + {758EFDDB-456E-43E6-AE8F-184D37802B7C}.Release|x64.Build.0 = Release|x64 + {758EFDDB-456E-43E6-AE8F-184D37802B7C}.Release|x86.ActiveCfg = Release|Win32 + {758EFDDB-456E-43E6-AE8F-184D37802B7C}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1C6F4F20-3611-4F8D-81FC-1BD252D8A141} + EndGlobalSection +EndGlobal diff --git a/20/Lab20/Lab20.vcxproj b/20/Lab20/Lab20.vcxproj new file mode 100644 index 0000000..41f6425 --- /dev/null +++ b/20/Lab20/Lab20.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {758efddb-456e-43e6-ae8f-184d37802b7c} + Lab20 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/20/Lab20/Lab20.vcxproj.filters b/20/Lab20/Lab20.vcxproj.filters new file mode 100644 index 0000000..29c8d3d --- /dev/null +++ b/20/Lab20/Lab20.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/20/Lab20/Lab20.vcxproj.user b/20/Lab20/Lab20.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/20/Lab20/Lab20.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/20/Lab20/x64/Debug/Lab20.exe b/20/Lab20/x64/Debug/Lab20.exe new file mode 100644 index 0000000..bfec32d Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.exe differ diff --git a/20/Lab20/x64/Debug/Lab20.exe.recipe b/20/Lab20/x64/Debug/Lab20.exe.recipe new file mode 100644 index 0000000..2f9a8a1 --- /dev/null +++ b/20/Lab20/x64/Debug/Lab20.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\2 семестр\Технології програмування\Lab20\x64\Debug\Lab20.exe + + + + + + \ No newline at end of file diff --git a/20/Lab20/x64/Debug/Lab20.ilk b/20/Lab20/x64/Debug/Lab20.ilk new file mode 100644 index 0000000..0189925 Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.ilk differ diff --git a/20/Lab20/x64/Debug/Lab20.log b/20/Lab20/x64/Debug/Lab20.log new file mode 100644 index 0000000..4802613 --- /dev/null +++ b/20/Lab20/x64/Debug/Lab20.log @@ -0,0 +1,2 @@ + Lab20.cpp + Lab20.vcxproj -> D:\2 семестр\Технології програмування\Lab20\x64\Debug\Lab20.exe diff --git a/20/Lab20/x64/Debug/Lab20.obj b/20/Lab20/x64/Debug/Lab20.obj new file mode 100644 index 0000000..9dfcf52 Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.obj differ diff --git a/20/Lab20/x64/Debug/Lab20.pdb b/20/Lab20/x64/Debug/Lab20.pdb new file mode 100644 index 0000000..177a271 Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.pdb differ diff --git a/20/Lab20/x64/Debug/Lab20.tlog/CL.command.1.tlog b/20/Lab20/x64/Debug/Lab20.tlog/CL.command.1.tlog new file mode 100644 index 0000000..47fbdf6 Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.tlog/CL.command.1.tlog differ diff --git a/20/Lab20/x64/Debug/Lab20.tlog/CL.read.1.tlog b/20/Lab20/x64/Debug/Lab20.tlog/CL.read.1.tlog new file mode 100644 index 0000000..c486b8d Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.tlog/CL.read.1.tlog differ diff --git a/20/Lab20/x64/Debug/Lab20.tlog/CL.write.1.tlog b/20/Lab20/x64/Debug/Lab20.tlog/CL.write.1.tlog new file mode 100644 index 0000000..914c42b Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.tlog/CL.write.1.tlog differ diff --git a/20/Lab20/x64/Debug/Lab20.tlog/Lab20.lastbuildstate b/20/Lab20/x64/Debug/Lab20.tlog/Lab20.lastbuildstate new file mode 100644 index 0000000..11dd0eb --- /dev/null +++ b/20/Lab20/x64/Debug/Lab20.tlog/Lab20.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.19041.0: +Debug|x64|D:\2 семестр\Технології програмування\Lab20\| diff --git a/20/Lab20/x64/Debug/Lab20.tlog/link.command.1.tlog b/20/Lab20/x64/Debug/Lab20.tlog/link.command.1.tlog new file mode 100644 index 0000000..7f39bfd Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.tlog/link.command.1.tlog differ diff --git a/20/Lab20/x64/Debug/Lab20.tlog/link.read.1.tlog b/20/Lab20/x64/Debug/Lab20.tlog/link.read.1.tlog new file mode 100644 index 0000000..df96e97 Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.tlog/link.read.1.tlog differ diff --git a/20/Lab20/x64/Debug/Lab20.tlog/link.write.1.tlog b/20/Lab20/x64/Debug/Lab20.tlog/link.write.1.tlog new file mode 100644 index 0000000..766d9c0 Binary files /dev/null and b/20/Lab20/x64/Debug/Lab20.tlog/link.write.1.tlog differ diff --git a/20/Lab20/x64/Debug/Lab20.vcxproj.FileListAbsolute.txt b/20/Lab20/x64/Debug/Lab20.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..5ac0fe0 --- /dev/null +++ b/20/Lab20/x64/Debug/Lab20.vcxproj.FileListAbsolute.txt @@ -0,0 +1 @@ +D:\2 семестр\Технології програмування\Lab20\x64\Debug\Lab20.exe diff --git a/20/Lab20/x64/Debug/vc143.idb b/20/Lab20/x64/Debug/vc143.idb new file mode 100644 index 0000000..6814920 Binary files /dev/null and b/20/Lab20/x64/Debug/vc143.idb differ diff --git a/20/Lab20/x64/Debug/vc143.pdb b/20/Lab20/x64/Debug/vc143.pdb new file mode 100644 index 0000000..e4fef4a Binary files /dev/null and b/20/Lab20/x64/Debug/vc143.pdb differ