Advertisement
darkjessy94

ereditarietà

Dec 29th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. class fila
  6. {
  7. public:
  8. fila(){aperta=false;NumPersone=0;};
  9. virtual void setstato(bool pronto);
  10. protected:
  11. vector<string>NomePersone;
  12. bool aperta;
  13. int NumPersone;
  14. };
  15.  
  16. class filaposta:public fila
  17. {
  18. public:
  19. void setstato(bool aperta){this->aperta=aperta;};
  20. void visualizzafila()
  21. {
  22. cout<<NumPersone<<endl;
  23.  
  24. for(string &x:NomePersone)
  25. cout<<x<<endl;
  26. };
  27. void inseriscipersone(string persona)
  28. {
  29. NomePersone.push_back(persona);
  30. NumPersone++;
  31. };
  32. };
  33.  
  34. class filabanca:public fila
  35. {
  36. public:
  37. void setstato(bool aperta)
  38. {
  39. this->aperta=aperta;
  40. };
  41. void visualizzafila()
  42. {
  43. cout<<NumPersone<<endl;
  44. for(string &x:NomePersone)
  45. cout<<x<<endl;
  46. };
  47. void inseriscipersone(vector<string>Ingredienti)
  48. {
  49. for (int i=0;i<Ingredienti.size();i++)
  50. {
  51. NomePersone.push_back(Ingredienti.at(i));
  52. NumPersone++;
  53. }
  54.  
  55. };
  56. };
  57. int main()
  58. {
  59.  
  60. return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement