From ac7f88e26ea41c1757822a327d8e50df5dfe7a8f Mon Sep 17 00:00:00 2001 From: Kagabiev <103552752+Kagabiev@users.noreply.github.com> Date: Wed, 13 Jul 2022 16:07:02 +0500 Subject: [PATCH 1/7] Update Quest.cpp --- Quest/Quest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Quest/Quest.cpp b/Quest/Quest.cpp index 7cc11e4..246b7d5 100644 --- a/Quest/Quest.cpp +++ b/Quest/Quest.cpp @@ -21,3 +21,4 @@ int main() // 4. В окне "Список ошибок" можно просматривать ошибки. // 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода. // 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл. +// kklkk;k;k;;ml From 8408b75333d93aac7cba1f813376bf5cd231a35a Mon Sep 17 00:00:00 2001 From: lev609 Date: Wed, 13 Jul 2022 16:12:30 +0500 Subject: [PATCH 2/7] 1 --- Quest/Quest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Quest/Quest.cpp b/Quest/Quest.cpp index 7cc11e4..246b7d5 100644 --- a/Quest/Quest.cpp +++ b/Quest/Quest.cpp @@ -21,3 +21,4 @@ int main() // 4. В окне "Список ошибок" можно просматривать ошибки. // 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода. // 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл. +// kklkk;k;k;;ml From 81f79fccfc4710138b58b6599e873e1ae8310f0a Mon Sep 17 00:00:00 2001 From: Kagabiev <103552752+Kagabiev@users.noreply.github.com> Date: Wed, 13 Jul 2022 16:16:22 +0500 Subject: [PATCH 3/7] 452 --- Quest/Quest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Quest/Quest.cpp b/Quest/Quest.cpp index 246b7d5..978d503 100644 --- a/Quest/Quest.cpp +++ b/Quest/Quest.cpp @@ -21,4 +21,4 @@ int main() // 4. В окне "Список ошибок" можно просматривать ошибки. // 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода. // 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл. -// kklkk;k;k;;ml +// jjujjijiji9uji From 1ec077270e0a3c05f35b527445cd1833aa7ac80d Mon Sep 17 00:00:00 2001 From: lev609 Date: Wed, 13 Jul 2022 19:36:04 +0500 Subject: [PATCH 4/7] =?UTF-8?q?=D0=94=D0=BE=D0=BC=D0=B0=D1=88=D0=BD=D1=8F?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=E2=84=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Quest/Quest.cpp | 162 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 146 insertions(+), 16 deletions(-) diff --git a/Quest/Quest.cpp b/Quest/Quest.cpp index 978d503..e1378b8 100644 --- a/Quest/Quest.cpp +++ b/Quest/Quest.cpp @@ -1,24 +1,154 @@ -// Quest.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. -// - + #include +using namespace std; + + +class Person +{ +protected: + string name; + int age; + string gender; + int weight; +public: + + Person() + : name(name), age(age), gender(gender), weight(weight) + {} + + Person(string name, int age, string gender, int weight) + { + this->name = name; + this->age = age; + this->gender = gender; + this->weight = weight; + } + + void printf() + { + cout << "Name: " << name << endl << "Age: " << age << endl << "Gender: " << gender << endl << "Weight: " << weight << endl; + } +}; + + +class Student : public Person +{ +protected: + int year_of_study; +public: + Student(string name, int age, string gender, int weight, int year_of_study) : + Person (name, age, gender, weight) + { + this->year_of_study = year_of_study; + + + } + + void printYear() + { + cout << "Year of study: " << year_of_study << endl << endl; + } + + + +}; + + +class Fruit +{ +protected: + string Name; + string Color; +public: + + + + void setName(string Name) + { + this->Name = Name; + } + + void setColor(string Color) + { + this->Color = Color; + } + + string getName() + { + return Name; + } + string getColor() + { + return Color; + } +}; + + +class Apple : public Fruit +{ +public: + Apple(string Color) + { + this->Color = Color; + Color = "green"; + setName("apple"); + getColor(); + } + + + + +}; + +class GrannySmith : public Apple +{ +public: + + GrannySmith() : Apple("green") + { + setName("Granny Smith " + Apple::getName()); + } + + +}; + +class Banana : public Fruit +{ +public: + + Banana() + { + Color = "yellow"; + setName("banana"); + getColor(); + } + +}; + int main() { - std::cout << "Hello World!\n"; -} + Student s00("Leo", 16, "Male", 69, 2013); + Student s01("Piter", 17, "Male", 78, 2012); + Student s02("Lera", 21, "Female", 48, 2014); + + Person* Stud[] = { &s00,&s01,&s02 }; + for (int i = 0; i < 3; i++) + { + cout << i+1 << ". "; + Stud[i]->printf(); + ((Student *)Stud[i])->printYear(); + } + -//привет + Apple a("red"); + Banana b; + GrannySmith c; -// Запуск программы: CTRL+F5 или меню "Отладка" > "Запуск без отладки" -// Отладка программы: F5 или меню "Отладка" > "Запустить отладку" + std::cout << "My " << a.getName() << " is " << a.getColor() << ".\n"; + std::cout << "My " << b.getName() << " is " << b.getColor() << ".\n"; + std::cout << "My " << c.getName() << " is " << c.getColor() << ".\n"; -// Советы по началу работы -// 1. В окне обозревателя решений можно добавлять файлы и управлять ими. -// 2. В окне Team Explorer можно подключиться к системе управления версиями. -// 3. В окне "Выходные данные" можно просматривать выходные данные сборки и другие сообщения. -// 4. В окне "Список ошибок" можно просматривать ошибки. -// 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода. -// 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл. -// jjujjijiji9uji + return 0; +}; \ No newline at end of file From 3912be7154813bfe47bd7bf79ceb065a404de24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=B2=20=D0=96=D0=BE=D1=80=D0=B8=D0=BD?= <76964171+lev609@users.noreply.github.com> Date: Thu, 14 Jul 2022 02:36:01 +0500 Subject: [PATCH 5/7] Pull requests --- Quest/Quest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Quest/Quest.cpp b/Quest/Quest.cpp index e1378b8..31545ba 100644 --- a/Quest/Quest.cpp +++ b/Quest/Quest.cpp @@ -1,4 +1,5 @@ - +//Pull requests + #include using namespace std; @@ -151,4 +152,4 @@ int main() std::cout << "My " << c.getName() << " is " << c.getColor() << ".\n"; return 0; -}; \ No newline at end of file +}; From 0225c6fa7140a1ae0fe3164631856519c16c9c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=B2=20=D0=96=D0=BE=D1=80=D0=B8=D0=BD?= <76964171+lev609@users.noreply.github.com> Date: Thu, 14 Jul 2022 02:37:28 +0500 Subject: [PATCH 6/7] Revert "Lev" From 71ceeb39c7f8872ad153fc62909152e73450583c Mon Sep 17 00:00:00 2001 From: lev609 Date: Thu, 14 Jul 2022 02:38:53 +0500 Subject: [PATCH 7/7] 1 --- Quest/Quest.cpp | 153 ------------------------------------------------ 1 file changed, 153 deletions(-) diff --git a/Quest/Quest.cpp b/Quest/Quest.cpp index e1378b8..e02abfc 100644 --- a/Quest/Quest.cpp +++ b/Quest/Quest.cpp @@ -1,154 +1 @@  -#include -using namespace std; - - -class Person -{ -protected: - string name; - int age; - string gender; - int weight; -public: - - Person() - : name(name), age(age), gender(gender), weight(weight) - {} - - Person(string name, int age, string gender, int weight) - { - this->name = name; - this->age = age; - this->gender = gender; - this->weight = weight; - } - - void printf() - { - cout << "Name: " << name << endl << "Age: " << age << endl << "Gender: " << gender << endl << "Weight: " << weight << endl; - } -}; - - -class Student : public Person -{ -protected: - int year_of_study; -public: - Student(string name, int age, string gender, int weight, int year_of_study) : - Person (name, age, gender, weight) - { - this->year_of_study = year_of_study; - - - } - - void printYear() - { - cout << "Year of study: " << year_of_study << endl << endl; - } - - - -}; - - -class Fruit -{ -protected: - string Name; - string Color; -public: - - - - void setName(string Name) - { - this->Name = Name; - } - - void setColor(string Color) - { - this->Color = Color; - } - - string getName() - { - return Name; - } - string getColor() - { - return Color; - } -}; - - -class Apple : public Fruit -{ -public: - Apple(string Color) - { - this->Color = Color; - Color = "green"; - setName("apple"); - getColor(); - } - - - - -}; - -class GrannySmith : public Apple -{ -public: - - GrannySmith() : Apple("green") - { - setName("Granny Smith " + Apple::getName()); - } - - -}; - -class Banana : public Fruit -{ -public: - - Banana() - { - Color = "yellow"; - setName("banana"); - getColor(); - } - -}; - - -int main() -{ - Student s00("Leo", 16, "Male", 69, 2013); - Student s01("Piter", 17, "Male", 78, 2012); - Student s02("Lera", 21, "Female", 48, 2014); - - Person* Stud[] = { &s00,&s01,&s02 }; - for (int i = 0; i < 3; i++) - { - cout << i+1 << ". "; - Stud[i]->printf(); - ((Student *)Stud[i])->printYear(); - } - - - - Apple a("red"); - Banana b; - GrannySmith c; - - std::cout << "My " << a.getName() << " is " << a.getColor() << ".\n"; - std::cout << "My " << b.getName() << " is " << b.getColor() << ".\n"; - std::cout << "My " << c.getName() << " is " << c.getColor() << ".\n"; - - return 0; -}; \ No newline at end of file