Posts

Showing posts from November, 2021

C++ BASICS

 #include <iostream> #include <string> using namespace std; // f(x) = x^2 + 2 int add(int a, int b) {     int c;     c = a + b;     return c; } class Employee { public:     string name;     int salary;     Employee(string n, int s, int sp)     {         this->name = n;         this->salary = s;         this->secretPassword = sp;     }     void printDetails()     {         cout << "The name of our first employee is " << this->name << " and his salary is " << this->salary << " Dollars" << endl;     }     void getSecretPassword()     {         cout<<"The secret password of employee is "<<this->secretPassword;     } private:     int secretPassword; }; class Progra...