diff --git a/OOP/OOP/.vs/OOP/FileContentIndex/03716729-71e0-4864-8689-06d8fbce0317.vsidx b/OOP/OOP/.vs/OOP/FileContentIndex/03716729-71e0-4864-8689-06d8fbce0317.vsidx new file mode 100644 index 0000000..e531a20 Binary files /dev/null and b/OOP/OOP/.vs/OOP/FileContentIndex/03716729-71e0-4864-8689-06d8fbce0317.vsidx differ diff --git a/OOP/OOP/.vs/OOP/FileContentIndex/32c93f70-f419-49f0-b201-82014f0fafee.vsidx b/OOP/OOP/.vs/OOP/FileContentIndex/32c93f70-f419-49f0-b201-82014f0fafee.vsidx new file mode 100644 index 0000000..ca177cb Binary files /dev/null and b/OOP/OOP/.vs/OOP/FileContentIndex/32c93f70-f419-49f0-b201-82014f0fafee.vsidx differ diff --git a/OOP/OOP/.vs/OOP/FileContentIndex/38c322ad-8ac9-4763-a352-8c0e9bfe58dc.vsidx b/OOP/OOP/.vs/OOP/FileContentIndex/38c322ad-8ac9-4763-a352-8c0e9bfe58dc.vsidx new file mode 100644 index 0000000..f0ee110 Binary files /dev/null and b/OOP/OOP/.vs/OOP/FileContentIndex/38c322ad-8ac9-4763-a352-8c0e9bfe58dc.vsidx differ diff --git a/OOP/OOP/.vs/OOP/FileContentIndex/3ccdad26-1564-46e6-ac3a-a48108d69299.vsidx b/OOP/OOP/.vs/OOP/FileContentIndex/3ccdad26-1564-46e6-ac3a-a48108d69299.vsidx deleted file mode 100644 index c9f9e6e..0000000 Binary files a/OOP/OOP/.vs/OOP/FileContentIndex/3ccdad26-1564-46e6-ac3a-a48108d69299.vsidx and /dev/null differ diff --git a/OOP/OOP/.vs/OOP/FileContentIndex/463fb21f-3d41-444c-86df-dcf5e5795fb9.vsidx b/OOP/OOP/.vs/OOP/FileContentIndex/463fb21f-3d41-444c-86df-dcf5e5795fb9.vsidx new file mode 100644 index 0000000..d524f6a Binary files /dev/null and b/OOP/OOP/.vs/OOP/FileContentIndex/463fb21f-3d41-444c-86df-dcf5e5795fb9.vsidx differ diff --git a/OOP/OOP/.vs/OOP/FileContentIndex/a774fd2e-b19f-4404-b569-d71d6dfe4a83.vsidx b/OOP/OOP/.vs/OOP/FileContentIndex/4a81247c-1abf-49fc-b772-91d5d78408ca.vsidx similarity index 99% rename from OOP/OOP/.vs/OOP/FileContentIndex/a774fd2e-b19f-4404-b569-d71d6dfe4a83.vsidx rename to OOP/OOP/.vs/OOP/FileContentIndex/4a81247c-1abf-49fc-b772-91d5d78408ca.vsidx index da150ee..359de21 100644 Binary files a/OOP/OOP/.vs/OOP/FileContentIndex/a774fd2e-b19f-4404-b569-d71d6dfe4a83.vsidx and b/OOP/OOP/.vs/OOP/FileContentIndex/4a81247c-1abf-49fc-b772-91d5d78408ca.vsidx differ diff --git a/OOP/OOP/.vs/OOP/FileContentIndex/c21e94e9-0151-4b0c-bd5f-387aed2464b8.vsidx b/OOP/OOP/.vs/OOP/FileContentIndex/c21e94e9-0151-4b0c-bd5f-387aed2464b8.vsidx deleted file mode 100644 index 4618696..0000000 Binary files a/OOP/OOP/.vs/OOP/FileContentIndex/c21e94e9-0151-4b0c-bd5f-387aed2464b8.vsidx and /dev/null differ diff --git a/OOP/OOP/.vs/OOP/FileContentIndex/d92e3f5c-08f8-41c5-ac4b-95a57b1c025e.vsidx b/OOP/OOP/.vs/OOP/FileContentIndex/d92e3f5c-08f8-41c5-ac4b-95a57b1c025e.vsidx deleted file mode 100644 index b272e91..0000000 Binary files a/OOP/OOP/.vs/OOP/FileContentIndex/d92e3f5c-08f8-41c5-ac4b-95a57b1c025e.vsidx and /dev/null differ diff --git a/OOP/OOP/.vs/OOP/v17/.suo b/OOP/OOP/.vs/OOP/v17/.suo index 5ef1f4a..f976f7c 100644 Binary files a/OOP/OOP/.vs/OOP/v17/.suo and b/OOP/OOP/.vs/OOP/v17/.suo differ diff --git a/OOP/OOP/.vs/OOP/v17/Browse.VC.db b/OOP/OOP/.vs/OOP/v17/Browse.VC.db index d29796f..73bba08 100644 Binary files a/OOP/OOP/.vs/OOP/v17/Browse.VC.db and b/OOP/OOP/.vs/OOP/v17/Browse.VC.db differ diff --git a/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/1bf2f412a2d6589c/DATA.ipch b/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/1bf2f412a2d6589c/DATA.ipch new file mode 100644 index 0000000..fc9e54f Binary files /dev/null and b/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/1bf2f412a2d6589c/DATA.ipch differ diff --git a/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/1d6575618227d69e/MAIN.ipch b/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/1d6575618227d69e/MAIN.ipch index 9992138..3a4ffbd 100644 Binary files a/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/1d6575618227d69e/MAIN.ipch and b/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/1d6575618227d69e/MAIN.ipch differ diff --git a/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/60a652d23a324955/MAIN.ipch b/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/60a652d23a324955/MAIN.ipch new file mode 100644 index 0000000..c2c0f29 Binary files /dev/null and b/OOP/OOP/.vs/OOP/v17/ipch/AutoPCH/60a652d23a324955/MAIN.ipch differ diff --git a/OOP/OOP/OOP.sln b/OOP/OOP/OOP.sln index 19e33cf..713026e 100644 --- a/OOP/OOP/OOP.sln +++ b/OOP/OOP/OOP.sln @@ -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 @@ -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 diff --git a/OOP/OOP/cdata/cdata.vcxproj b/OOP/OOP/cdata/cdata.vcxproj new file mode 100644 index 0000000..7266bcd --- /dev/null +++ b/OOP/OOP/cdata/cdata.vcxproj @@ -0,0 +1,139 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {d57fd875-ab89-433d-8e1d-9d28270d1be5} + cdata + 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/OOP/OOP/cdata/cdata.vcxproj.filters b/OOP/OOP/cdata/cdata.vcxproj.filters new file mode 100644 index 0000000..f996746 --- /dev/null +++ b/OOP/OOP/cdata/cdata.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {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 + + + + + Исходные файлы + + + Исходные файлы + + + + + Файлы заголовков + + + \ No newline at end of file diff --git a/OOP/OOP/cdata/cdata.vcxproj.user b/OOP/OOP/cdata/cdata.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/OOP/OOP/cdata/cdata.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/OOP/OOP/cdata/data.cpp b/OOP/OOP/cdata/data.cpp new file mode 100644 index 0000000..fbb7c0d --- /dev/null +++ b/OOP/OOP/cdata/data.cpp @@ -0,0 +1,93 @@ +#include "data.h" +#include +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; +} \ No newline at end of file diff --git a/OOP/OOP/cdata/data.h b/OOP/OOP/cdata/data.h new file mode 100644 index 0000000..9446431 --- /dev/null +++ b/OOP/OOP/cdata/data.h @@ -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; +}; \ No newline at end of file diff --git a/OOP/OOP/cdata/main.cpp b/OOP/OOP/cdata/main.cpp new file mode 100644 index 0000000..5a5e020 --- /dev/null +++ b/OOP/OOP/cdata/main.cpp @@ -0,0 +1,19 @@ +#include "data.h" +#include + + +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; +} \ No newline at end of file diff --git a/OOP/OOP/cdata/x64/Debug/cdata.exe.recipe b/OOP/OOP/cdata/x64/Debug/cdata.exe.recipe new file mode 100644 index 0000000..eb4f15b --- /dev/null +++ b/OOP/OOP/cdata/x64/Debug/cdata.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\Users\filesop\OOP\OOP\x64\Debug\cdata.exe + + + + + + \ No newline at end of file diff --git a/OOP/OOP/cdata/x64/Debug/cdata.ilk b/OOP/OOP/cdata/x64/Debug/cdata.ilk new file mode 100644 index 0000000..a0ac9f9 Binary files /dev/null and b/OOP/OOP/cdata/x64/Debug/cdata.ilk differ diff --git a/OOP/OOP/cdata/x64/Debug/cdata.log b/OOP/OOP/cdata/x64/Debug/cdata.log new file mode 100644 index 0000000..17b7819 --- /dev/null +++ b/OOP/OOP/cdata/x64/Debug/cdata.log @@ -0,0 +1,4 @@ + data.cpp + main.cpp + Создание кода... + cdata.vcxproj -> C:\Users\filesop\OOP\OOP\x64\Debug\cdata.exe diff --git a/OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.command.1.tlog b/OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.command.1.tlog new file mode 100644 index 0000000..e878cdb Binary files /dev/null and b/OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.command.1.tlog differ diff --git a/OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.read.1.tlog b/OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.read.1.tlog new file mode 100644 index 0000000..bc71e43 Binary files /dev/null and b/OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.read.1.tlog differ diff --git a/OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.write.1.tlog b/OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.write.1.tlog new file mode 100644 index 0000000..0a1dccf Binary files /dev/null and b/OOP/OOP/cdata/x64/Debug/cdata.tlog/CL.write.1.tlog differ diff --git a/OOP/OOP/cdata/x64/Debug/cdata.tlog/Cl.items.tlog b/OOP/OOP/cdata/x64/Debug/cdata.tlog/Cl.items.tlog new file mode 100644 index 0000000..17ce75c --- /dev/null +++ b/OOP/OOP/cdata/x64/Debug/cdata.tlog/Cl.items.tlog @@ -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 diff --git a/OOP/OOP/cdata/x64/Debug/cdata.tlog/cdata.lastbuildstate b/OOP/OOP/cdata/x64/Debug/cdata.tlog/cdata.lastbuildstate new file mode 100644 index 0000000..0683921 --- /dev/null +++ b/OOP/OOP/cdata/x64/Debug/cdata.tlog/cdata.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.37.32822:TargetPlatformVersion=10.0.22621.0: +Debug|x64|C:\Users\filesop\OOP\OOP\| diff --git a/OOP/OOP/cdata/x64/Debug/cdata.tlog/link.command.1.tlog b/OOP/OOP/cdata/x64/Debug/cdata.tlog/link.command.1.tlog new file mode 100644 index 0000000..658162d Binary files /dev/null and b/OOP/OOP/cdata/x64/Debug/cdata.tlog/link.command.1.tlog differ diff --git a/OOP/OOP/cdata/x64/Debug/cdata.tlog/link.read.1.tlog b/OOP/OOP/cdata/x64/Debug/cdata.tlog/link.read.1.tlog new file mode 100644 index 0000000..f7bf47d Binary files /dev/null and b/OOP/OOP/cdata/x64/Debug/cdata.tlog/link.read.1.tlog differ diff --git a/OOP/OOP/cdata/x64/Debug/cdata.tlog/link.write.1.tlog b/OOP/OOP/cdata/x64/Debug/cdata.tlog/link.write.1.tlog new file mode 100644 index 0000000..1e71264 Binary files /dev/null and b/OOP/OOP/cdata/x64/Debug/cdata.tlog/link.write.1.tlog differ diff --git a/OOP/OOP/cdata/x64/Debug/vc143.idb b/OOP/OOP/cdata/x64/Debug/vc143.idb new file mode 100644 index 0000000..d482465 Binary files /dev/null and b/OOP/OOP/cdata/x64/Debug/vc143.idb differ diff --git a/OOP/OOP/cdata/x64/Debug/vc143.pdb b/OOP/OOP/cdata/x64/Debug/vc143.pdb new file mode 100644 index 0000000..d7f04ca Binary files /dev/null and b/OOP/OOP/cdata/x64/Debug/vc143.pdb differ diff --git a/OOP/OOP/ctime/x64/Debug/ctime.ilk b/OOP/OOP/ctime/x64/Debug/ctime.ilk index fa0235c..7b0e554 100644 Binary files a/OOP/OOP/ctime/x64/Debug/ctime.ilk and b/OOP/OOP/ctime/x64/Debug/ctime.ilk differ diff --git a/OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.read.1.tlog b/OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.read.1.tlog index 25a0bd2..50da501 100644 Binary files a/OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.read.1.tlog and b/OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.read.1.tlog differ diff --git a/OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.write.1.tlog b/OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.write.1.tlog index 19b10c7..9b4ea63 100644 Binary files a/OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.write.1.tlog and b/OOP/OOP/ctime/x64/Debug/ctime.tlog/CL.write.1.tlog differ diff --git a/OOP/OOP/ctime/x64/Debug/ctime.tlog/link.read.1.tlog b/OOP/OOP/ctime/x64/Debug/ctime.tlog/link.read.1.tlog index 946c0eb..80d9f22 100644 Binary files a/OOP/OOP/ctime/x64/Debug/ctime.tlog/link.read.1.tlog and b/OOP/OOP/ctime/x64/Debug/ctime.tlog/link.read.1.tlog differ diff --git a/OOP/OOP/ctime/x64/Debug/ctime.tlog/link.write.1.tlog b/OOP/OOP/ctime/x64/Debug/ctime.tlog/link.write.1.tlog index 5ad1090..b7a2e1a 100644 Binary files a/OOP/OOP/ctime/x64/Debug/ctime.tlog/link.write.1.tlog and b/OOP/OOP/ctime/x64/Debug/ctime.tlog/link.write.1.tlog differ diff --git a/OOP/OOP/ctime/x64/Debug/vc143.idb b/OOP/OOP/ctime/x64/Debug/vc143.idb index a87c0cf..8c7be72 100644 Binary files a/OOP/OOP/ctime/x64/Debug/vc143.idb and b/OOP/OOP/ctime/x64/Debug/vc143.idb differ diff --git a/OOP/OOP/ctime/x64/Debug/vc143.pdb b/OOP/OOP/ctime/x64/Debug/vc143.pdb index c865a89..a822427 100644 Binary files a/OOP/OOP/ctime/x64/Debug/vc143.pdb and b/OOP/OOP/ctime/x64/Debug/vc143.pdb differ diff --git a/OOP/OOP/x64/Debug/cdata.pdb b/OOP/OOP/x64/Debug/cdata.pdb new file mode 100644 index 0000000..6607c53 Binary files /dev/null and b/OOP/OOP/x64/Debug/cdata.pdb differ diff --git a/OOP/OOP/x64/Debug/ctime.pdb b/OOP/OOP/x64/Debug/ctime.pdb index 79f066f..059ebc8 100644 Binary files a/OOP/OOP/x64/Debug/ctime.pdb and b/OOP/OOP/x64/Debug/ctime.pdb differ