From fcb79962844739277f382cac4f896b45bca566db Mon Sep 17 00:00:00 2001 From: lev609 Date: Thu, 14 Jul 2022 02:42:37 +0500 Subject: [PATCH] Pull --- Quest/Quest.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Quest/Quest.cpp b/Quest/Quest.cpp index 31545ba..22ed102 100644 --- a/Quest/Quest.cpp +++ b/Quest/Quest.cpp @@ -1,5 +1,3 @@ -//Pull requests - #include using namespace std; @@ -38,19 +36,19 @@ class Student : public Person int year_of_study; public: Student(string name, int age, string gender, int weight, int year_of_study) : - Person (name, age, gender, weight) + Person(name, age, gender, weight) { this->year_of_study = year_of_study; - - + + } void printYear() { cout << "Year of study: " << year_of_study << endl << endl; } - - + + }; @@ -96,7 +94,7 @@ class Apple : public Fruit getColor(); } - + }; @@ -104,7 +102,7 @@ class Apple : public Fruit class GrannySmith : public Apple { public: - + GrannySmith() : Apple("green") { setName("Granny Smith " + Apple::getName()); @@ -116,7 +114,7 @@ class GrannySmith : public Apple class Banana : public Fruit { public: - + Banana() { Color = "yellow"; @@ -136,9 +134,9 @@ int main() Person* Stud[] = { &s00,&s01,&s02 }; for (int i = 0; i < 3; i++) { - cout << i+1 << ". "; + cout << i + 1 << ". "; Stud[i]->printf(); - ((Student *)Stud[i])->printYear(); + ((Student*)Stud[i])->printYear(); } @@ -152,4 +150,4 @@ int main() std::cout << "My " << c.getName() << " is " << c.getColor() << ".\n"; return 0; -}; +}; \ No newline at end of file