-
Notifications
You must be signed in to change notification settings - Fork 44
Горшков Николай КМБО-04-21 очищенный Pull requests #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Nikgor2002
wants to merge
9
commits into
grayed:master
Choose a base branch
from
Nikgor2002:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a8acdb1
cleaning
Nikgor2002 ac6b793
modification
Nikgor2002 bcfa41e
фиксация незначительных изменений
Nikgor2002 99a7b3a
Adding MEMHACKS
Nikgor2002 f61011d
Working electricity
Nikgor2002 5dc26c0
незначительные изменения
Nikgor2002 78b7b53
Доработал animals
Nikgor2002 8907466
Доработал animlas && vector
Nikgor2002 28b47ce
Доработал электричество
Nikgor2002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,192 @@ | ||
| #include "animal.h" | ||
|
|
||
| #include <iostream> | ||
| #include <string> | ||
| #include <sstream> | ||
| using namespace std; | ||
|
|
||
| int main() { | ||
| return 0; | ||
| } | ||
|
|
||
|
|
||
| class Animal { | ||
| private: | ||
| float the_average_value_of_the_duration_of_life; | ||
| public: | ||
| void set_the_average_value_of_the_duration_of_life(float new_the_average_value_of_the_duration_of_life) { the_average_value_of_the_duration_of_life = new_the_average_value_of_the_duration_of_life; } | ||
| float get_the_average_value_of_the_duration_of_life() const { return the_average_value_of_the_duration_of_life; } | ||
|
|
||
| bool Gender; | ||
| virtual string about() const; | ||
| protected: | ||
| Animal(); | ||
|
|
||
| }; | ||
|
|
||
| string Animal::about() const { | ||
| stringstream ss; | ||
| ss << "Gender = " << " " << Gender; | ||
| return ss.str(); | ||
| }; | ||
|
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Отсутствует перегрузка операции вывода в поток для |
||
| class Mammal : public Animal { | ||
| private: | ||
| int number_of_individuals; | ||
| public: | ||
| void set_number_of_individuals(int new_number_of_individuals) { number_of_individuals = new_number_of_individuals; } | ||
| int get_number_of_individuals() const { return number_of_individuals; } | ||
|
|
||
| string Coat_color; | ||
| virtual string about() const; | ||
| protected: | ||
| Mammal(); | ||
| }; | ||
|
|
||
| string Mammal::about() const { | ||
| stringstream ss; | ||
| ss << Animal::about() << " " << " Coat_color = " << " " << Coat_color; | ||
| return ss.str(); | ||
| }; | ||
|
|
||
|
|
||
|
|
||
| class Quadrupeds : public Mammal { | ||
| private: | ||
| float percentage_of_quality_of_life; | ||
| public: | ||
| void set_percentage_of_quality_of_life(float new_percentage_of_quality_of_life) { percentage_of_quality_of_life = new_percentage_of_quality_of_life; } | ||
| float get_percentage_of_quality_of_life() const { return percentage_of_quality_of_life; } | ||
|
|
||
| bool limbs; | ||
| virtual string about() const; | ||
| }; | ||
|
|
||
| string Quadrupeds::about() const { | ||
| stringstream ss; | ||
| ss << Animal::about() << " " << " limbs = " << " " << limbs; | ||
| return ss.str(); | ||
| }; | ||
|
|
||
|
|
||
| class Birds : public Mammal { | ||
| private: | ||
| int the_average_value_of_the_flight_for_one_season; | ||
| public: | ||
| void set_the_average_value_of_the_flight_for_one_season(int new_the_average_value_of_the_flight_for_one_season) { the_average_value_of_the_flight_for_one_season = new_the_average_value_of_the_flight_for_one_season; } | ||
| int get_the_average_value_of_the_flight_for_one_season() const { return the_average_value_of_the_flight_for_one_season; } | ||
|
|
||
|
|
||
| bool ability_to_fly; | ||
| virtual string about() const; | ||
| }; | ||
|
|
||
| string Birds::about() const { | ||
| stringstream ss; | ||
| ss << Mammal::about() << " " << " ability_to_fly = " << " " << ability_to_fly; | ||
| return ss.str(); | ||
| }; | ||
|
|
||
| class Cat : public Animal { | ||
| private: | ||
| int the_number_of_mice_caught_per_unit_of_time; | ||
| public: | ||
| void set_the_number_of_mice_caught_per_unit_of_time(int new_the_number_of_mice_caught_per_unit_of_time) { the_number_of_mice_caught_per_unit_of_time = new_the_number_of_mice_caught_per_unit_of_time; } | ||
| int get_the_number_of_mice_caught_per_unit_of_time() const { return the_number_of_mice_caught_per_unit_of_time; } | ||
|
|
||
|
|
||
| float vibrissaLength; | ||
| virtual string about() const; | ||
| }; | ||
|
|
||
| string Cat::about() const { | ||
| stringstream ss; | ||
| ss << Animal::about() << " " << " vibrissaLength = " << " " << vibrissaLength; | ||
| return ss.str(); | ||
| }; | ||
|
|
||
| class Manul : public Cat { | ||
| private: | ||
| int average_weight; | ||
| public: | ||
| void set_average_weight(int new_average_weight) { average_weight = new_average_weight; } | ||
| int get_average_weight() const { return average_weight; } | ||
|
|
||
|
|
||
| float Average_length_of_wool; | ||
| virtual string about() const; | ||
| }; | ||
|
|
||
| string Manul::about() const { | ||
| stringstream ss; | ||
| ss << Cat::about() << " " << " Average_length_of_wool = " << " " << Average_length_of_wool; | ||
| return ss.str(); | ||
| }; | ||
|
|
||
| class Mainkun : public Cat { | ||
| private: | ||
| string eye_color; | ||
| public: | ||
| void set_eye_color(string new_eye_color) { eye_color = new_eye_color; } | ||
| string get_eye_color() const { return eye_color; } | ||
|
|
||
| float Number_of_fleas; | ||
| virtual string about() const; | ||
| }; | ||
|
|
||
| string Mainkun::about() const { | ||
| stringstream ss; | ||
| ss << Cat::about() << " " << " Number_of_fleas = " << " " << Number_of_fleas; | ||
| return ss.str(); | ||
| }; | ||
|
|
||
|
|
||
| Animal::Animal() | ||
| : Gender() | ||
| , the_average_value_of_the_duration_of_life() | ||
| { | ||
| cerr << "" << endl; | ||
| } | ||
|
|
||
| Mammal::Mammal() | ||
| : number_of_individuals() | ||
| , Coat_color() | ||
| { | ||
| cerr << "" << endl; | ||
| } | ||
|
|
||
| inline ostream& operator <<(ostream& os, const Animal& animal) { | ||
| return os << animal.about(); | ||
| } | ||
|
|
||
| int main(){ | ||
| Mainkun kot_bOris; | ||
| Manul kot_Vasily; | ||
| Cat Roudi; | ||
| Birds ANgry_birds; | ||
| Quadrupeds dogs; | ||
|
|
||
| kot_bOris.Gender = true; | ||
| kot_bOris.Number_of_fleas = 50000; | ||
| kot_bOris.vibrissaLength = 5; | ||
|
|
||
| kot_Vasily.Average_length_of_wool = 3; | ||
| kot_Vasily.Gender = true; | ||
| kot_Vasily.vibrissaLength = 6; | ||
|
|
||
| Roudi.Gender = true; | ||
| Roudi.vibrissaLength = 4; | ||
|
|
||
| ANgry_birds.ability_to_fly = true; | ||
| ANgry_birds.Coat_color = "red"; | ||
| ANgry_birds.Gender = false; | ||
|
|
||
| dogs.Coat_color = "red"; | ||
| dogs.Gender = true; | ||
| dogs.limbs = 4; | ||
|
|
||
| cout << "-------------------------------------------------------------" << endl; | ||
| cout << "kot_bOris: " << kot_bOris << endl; | ||
| cout << "kot_Vasily: " << kot_Vasily << endl; | ||
| cout << "Roudi: " << Roudi << endl; | ||
| cout << "ANgry_birds: " << ANgry_birds << endl; | ||
| cout << "dogs: " << dogs << endl; | ||
| cout << "-------------------------------------------------------------"; | ||
|
|
||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не выполнен пункт с
protected.