fork download
  1. #include <iostream>
  2. #include<cmath>
  3. using namespace std;
  4.  
  5.  
  6. class FciIdentity
  7. {
  8. private:
  9. string id;
  10. string fciMail;
  11. public:
  12. FciIdentity() {}
  13. FciIdentity(string id, string fciMail)
  14. {
  15. this->id = id;
  16. this->fciMail = fciMail;
  17. }
  18. void setID(string id)
  19. {
  20. this->id = id;
  21. }
  22. string getID()
  23. {
  24. return this->id;
  25. }
  26. void setfciMail(string fciMail)
  27. {
  28. this->fciMail = fciMail;
  29. }
  30. string getfciMail()
  31. {
  32. return this->fciMail;
  33. }
  34. };
  35.  
  36. class FciStudent
  37. {
  38. private:
  39. string name;
  40. int age;
  41. FciIdentity* FciID;
  42. public:
  43. FciStudent() {}
  44. FciStudent(string name, int age)
  45. {
  46. this->name = name;
  47. this->age = age;
  48. FciID = new FciIdentity;
  49. }
  50. void setname(string name)
  51. {
  52. this->name = name;
  53. }
  54. string getname()
  55. {
  56. return this->name;
  57. }
  58. void setage(int age)
  59. {
  60. this->age = age;
  61. }
  62. int getage()
  63. {
  64. return this->age;
  65. }
  66. void print()
  67. {
  68. cout << "Name of the Student: " << name << endl;
  69. cout << "And His Age is: " << age << endl;
  70. }
  71. };
  72. class FCICourse
  73. {
  74. private:
  75. string name;
  76. int maxNumberOfStudentsCanBeEnrolled;
  77. FciStudent* studentsEnrolled[];
  78.  
  79. public:
  80. FCICourse() {};
  81. FCICourse(string name, int maxStudentsNum)
  82. {
  83. this->name = name;
  84. maxNumberOfStudentsCanBeEnrolled = maxStudentsNum;
  85. }
  86.  
  87. void setName(string name)
  88. {
  89. this->name = name;
  90. }
  91. string getName()
  92. {
  93. return this->name;
  94. }
  95. void setMaxStudentsNum(int maxStudentsNum)
  96. {
  97. maxNumberOfStudentsCanBeEnrolled = maxStudentsNum;
  98. }
  99. int getMaxStudentsNum()
  100. {
  101. return maxNumberOfStudentsCanBeEnrolled;
  102. }
  103.  
  104. bool addStudent(FciStudent *student)
  105. {
  106.  
  107. }
  108.  
  109. void print()
  110. {
  111. cout <<"----------------------------------------------"<<endl<<"Course is : "<<name<<endl<<"Students Enrolled are : "<<maxNumberOfStudentsCanBeEnrolled<<endl;
  112. }
  113.  
  114. };
  115.  
  116.  
  117. int main()
  118. {
  119. FciStudent beso;
  120. beso.setname("Super_Beso");
  121. beso.setage(40);
  122. beso.getage();
  123. beso.print();
  124.  
  125. FCICourse oop;
  126. oop.setName("OOP");
  127. oop.setMaxStudentsNum(200);
  128. oop.print();
  129.  
  130. return 0;
  131. }
  132.  
Success #stdin #stdout 0.01s 5392KB
stdin
Standard input is empty
stdout
Name of the Student: Super_Beso
And His Age is: 40
----------------------------------------------
Course is : OOP
Students Enrolled are : 200