Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.16 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. ///////////////////////////////////////////
  5.  
  6. class UProgram { //University program
  7.    
  8.     class Degree { // Degree
  9.    
  10.         class Course { //Course
  11.             char studentArray[3];
  12.            
  13.             class Teacher { //Teacher
  14.                 private:
  15.                 std::string lastName;
  16.                 std::string firstName;
  17.                 int age;
  18.                 std::string Address;
  19.                 std::string City;
  20.                 int phone;
  21.                
  22.                 public:
  23.                 Teacher(); //constructor
  24.                 Teacher(std::string lastName, std::string firstName, int age, std::string Address, std::string City, int phone);
  25.                 ~Teacher(); // Destructor
  26.                
  27.                void SitInClass() {
  28.                    std::cout << "Sitting at front of class" << std::endl;
  29.                    } //Sit in class
  30.                
  31.                 void GradeStudent() {  //grade student
  32.                     std::cout << "Student graded" << std::endl;
  33.                     }
  34.                    
  35.                    
  36.             };
  37.            
  38.             class Student { //Student
  39.                  private:
  40.                 std::string lastName;
  41.                 std::string firstName;
  42.                 int age;
  43.                 std::string Address;
  44.                 std::string City;
  45.                 int phone;
  46.                
  47.                 public:
  48.                 Student(); //constructor
  49.                 Student(std::string lastName, std::string firstName, int age, std::string Address, std::string City, int phone);
  50.                 ~Student(); // Destructor
  51.                
  52.             void SitInClass();
  53.            
  54.            
  55.            
  56.             };
  57.            
  58.            
  59.            
  60.         };
  61.    
  62.        
  63.     };
  64. };
  65.  
  66.                //end of classes
  67.  
  68. void UProgram::Degree::Course::Student::SitInClass() {
  69.                    std::cout << "Sitting at front of class" << std::endl;
  70.                    } //Sit in class
  71.  
  72.  
  73.  
  74.  
  75. int main() {
  76.  
  77. Student student1;
  78.  
  79. student1.lastName = "Joey";
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement