#include <iostream>
#include <string>
using namespace std;

class Teacher {
public:    
    //proreties /attributes
     string name;
     string dept;
     string subject;
     double salary;
    //methods / member functions
    void changeDept (string newDept){
        dept = newDept;
    }

};

int main() {
    Teacher t1;
    t1.name = "suhana";
    t1.subject = "c++";
    t1.dept = "computer science";
    t1.salary = 25000;
    
    cout << t1.name <<endl;
    return 0;

}






Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: