Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified OOP/OOP/.vs/OOP/v17/.suo
Binary file not shown.
Binary file modified OOP/OOP/.vs/OOP/v17/Browse.VC.db
Binary file not shown.
Binary file not shown.
Binary file modified OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/1d6575618227d69e/MAIN.ipch
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions OOP/OOP/OOP.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 17.7.34024.191
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ctime", "ctime\ctime.vcxproj", "{0B3A8A1D-38BF-4358-9381-D772FEA522DB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cdata", "cdata\cdata.vcxproj", "{D57FD875-AB89-433D-8E1D-9D28270D1BE5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -21,6 +23,14 @@ Global
{0B3A8A1D-38BF-4358-9381-D772FEA522DB}.Release|x64.Build.0 = Release|x64
{0B3A8A1D-38BF-4358-9381-D772FEA522DB}.Release|x86.ActiveCfg = Release|Win32
{0B3A8A1D-38BF-4358-9381-D772FEA522DB}.Release|x86.Build.0 = Release|Win32
{D57FD875-AB89-433D-8E1D-9D28270D1BE5}.Debug|x64.ActiveCfg = Debug|x64
{D57FD875-AB89-433D-8E1D-9D28270D1BE5}.Debug|x64.Build.0 = Debug|x64
{D57FD875-AB89-433D-8E1D-9D28270D1BE5}.Debug|x86.ActiveCfg = Debug|Win32
{D57FD875-AB89-433D-8E1D-9D28270D1BE5}.Debug|x86.Build.0 = Debug|Win32
{D57FD875-AB89-433D-8E1D-9D28270D1BE5}.Release|x64.ActiveCfg = Release|x64
{D57FD875-AB89-433D-8E1D-9D28270D1BE5}.Release|x64.Build.0 = Release|x64
{D57FD875-AB89-433D-8E1D-9D28270D1BE5}.Release|x86.ActiveCfg = Release|Win32
{D57FD875-AB89-433D-8E1D-9D28270D1BE5}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
139 changes: 139 additions & 0 deletions OOP/OOP/cdata/cdata.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{d57fd875-ab89-433d-8e1d-9d28270d1be5}</ProjectGuid>
<RootNamespace>cdata</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="data.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="data.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
30 changes: 30 additions & 0 deletions OOP/OOP/cdata/cdata.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Исходные файлы">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Файлы заголовков">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Файлы ресурсов">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="data.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="data.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions OOP/OOP/cdata/cdata.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
93 changes: 93 additions & 0 deletions OOP/OOP/cdata/data.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#include "data.h"
#include <iostream>
Date::Date(int day, int month, int year) {
setValues(day, month, year);
}

Status Date::input() {
Status state = SUCCESS;
char dot;
cout << "Enter date in format DD.MM.YYYY: ";
cin >> day >> dot >> month >> dot >> year;
return state;
}

Status Date::setValues(int day, int month, int year) {
Status state = SUCCESS;
this->day = day;
this->month = month;
this->year = year;
return state;
}

Status Date::check() {
Status state = SUCCESS;
if (year < 0 || month < 1 || month > 12 || day < 1 || day > 31) {
state = ERROR;
}
return state;
}

Status Date::addDays(int days) {
Status state = SUCCESS;

day += days;

if (day > 31) {
day -= 31;
month++;
if (month > 12) {
month = 1;
year++;
}
}
return state;
}
Status Date::addMonths(int months) {
Status state = SUCCESS;
month += months;

while (month > 12) {
month -= 12;
year++;
}

return state;
}
Status Date::addYears(int years) {
Status state = SUCCESS;
year += years;
return state;
}

int Date::compare(const Date& other) const {

if (year > other.year)
return 1;
else if (year < other.year)
return -1;
else if (month > other.month)
return 1;
else if (month < other.month)
return -1;
else if (day > other.day)
return 1;
else if (day < other.day)
return -1;
else
return 0;
}

Status Date::assign(const Date& other) {
Status state = SUCCESS;
day = other.day;
month = other.month;
year = other.year;
return state;
}

Status Date::output() const {
Status state = SUCCESS;
cout << day << "." << month << "." << year << " " << endl;
return state;
}
22 changes: 22 additions & 0 deletions OOP/OOP/cdata/data.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

enum Status { SUCCESS = 3, ERROR = 1, WARNING = 2 };
using namespace std;

class Date {
private:
int day, month, year;

public:
Date() : day(0), month(0), year(0) {}
Date(int day, int month, int year);
Status input();
Status setValues(int day, int month, int year);
Status check();
Status addDays(int days);
Status addMonths(int months);
Status addYears(int years);
int compare(const Date& other) const;
Status assign(const Date& other);
Status output() const;
};
19 changes: 19 additions & 0 deletions OOP/OOP/cdata/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "data.h"
#include <iostream>


int main() {


Date date1(14, 12, 2022), date2;
cout << "DATE: ";
cout << date2.assign(date1) << endl;
cout << date1.output() << endl;
cout << date1.addDays(20) << endl;
cout << date1.output() << endl;
cout << date1.compare(date2) << endl;
cout << date1.addDays(-10) << endl;
cout << date1.output() << endl;

return 0;
}
11 changes: 11 additions & 0 deletions OOP/OOP/cdata/x64/Debug/cdata.exe.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\Users\filesop\OOP\OOP\x64\Debug\cdata.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>
Binary file added OOP/OOP/cdata/x64/Debug/cdata.ilk
Binary file not shown.
4 changes: 4 additions & 0 deletions OOP/OOP/cdata/x64/Debug/cdata.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
 data.cpp
main.cpp
Создание кода...
cdata.vcxproj -> C:\Users\filesop\OOP\OOP\x64\Debug\cdata.exe
Binary file not shown.
Binary file added OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.read.1.tlog
Binary file not shown.
Binary file added OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.write.1.tlog
Binary file not shown.
2 changes: 2 additions & 0 deletions OOP/OOP/cdata/x64/Debug/cdata.tlog/Cl.items.tlog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
C:\Users\filesop\OOP\OOP\cdata\data.cpp;C:\Users\filesop\OOP\OOP\cdata\x64\Debug\data.obj
C:\Users\filesop\OOP\OOP\cdata\main.cpp;C:\Users\filesop\OOP\OOP\cdata\x64\Debug\main.obj
2 changes: 2 additions & 0 deletions OOP/OOP/cdata/x64/Debug/cdata.tlog/cdata.lastbuildstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.37.32822:TargetPlatformVersion=10.0.22621.0:
Debug|x64|C:\Users\filesop\OOP\OOP\|
Binary file not shown.
Binary file not shown.
Binary file added OOP/OOP/cdata/x64/Debug/cdata.tlog/link.write.1.tlog
Binary file not shown.
Binary file added OOP/OOP/cdata/x64/Debug/vc143.idb
Binary file not shown.
Binary file added OOP/OOP/cdata/x64/Debug/vc143.pdb
Binary file not shown.
Binary file modified OOP/OOP/ctime/x64/Debug/ctime.ilk
Binary file not shown.
Binary file modified OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.read.1.tlog
Binary file not shown.
Binary file modified OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.write.1.tlog
Binary file not shown.
Binary file modified OOP/OOP/ctime/x64/Debug/ctime.tlog/link.read.1.tlog
Binary file not shown.
Binary file modified OOP/OOP/ctime/x64/Debug/ctime.tlog/link.write.1.tlog
Binary file not shown.
Binary file modified OOP/OOP/ctime/x64/Debug/vc143.idb
Binary file not shown.
Binary file modified OOP/OOP/ctime/x64/Debug/vc143.pdb
Binary file not shown.
Binary file added OOP/OOP/x64/Debug/cdata.pdb
Binary file not shown.
Binary file modified OOP/OOP/x64/Debug/ctime.pdb
Binary file not shown.