Advertisement
Andrey_ZoZ

Untitled

Jul 24th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. class Person
  4. {
  5. private:
  6. static int idPersons;
  7. int idPerson;
  8. int priorityPerson;
  9. public:
  10. Person(int idPerson, int priorityPerson) :idPerson{idPersons++} {
  11. if (priorityPerson < 1 or priorityPerson>3) { this->priorityPerson = 3; }
  12. else { this->priorityPerson = priorityPerson; }
  13. }
  14. static int getIdPersons() { return idPersons; }
  15. };
  16. int Person::idPersons{ 0 };
  17.  
  18. class Printer
  19. {
  20. private:
  21. Person* persons;
  22. int front;
  23. int back;
  24. public:
  25. //Construct
  26. Printer(Person* persons) :persons{ persons }, front{ 0 }, back{persons[0].getIdPersons-1} {}
  27.  
  28. //Destruct
  29. ~Printer() { delete[] persons; front = 0, back = 0; }
  30.  
  31. //Methods
  32. void sortPersons();
  33. void getFront();
  34. void putBack();
  35.  
  36. //Operators
  37. //NONE
  38. };
  39.  
  40. void main()
  41. {
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement