#include <iostream>
#include <string>
using namespace std;
// Class declaration
class Student {
private:
int empCode;
string name;
string dept;
string designation;
int age;
float salary;
public:
// Constructor to initialize the object
Student(int code, string empName, string empDept, string empDesignation, int empAge, float empSalary) {
empCode = code;
name = empName;
dept = empDept;
designation = empDesignation;
age = empAge;
salary = empSalary;
}
// Function to display Emp Code and Name if Salary > 50,000
void display() {
if (salary > 50000) {
cout << "Emp Code: " << empCode << ", Name: " << name << endl;
}
}
};
int main() {
// Creating 3 objects of Student class
Student emp1(101, "Alice", "IT", "Manager", 30, 60000);
Student emp2(102, "Bob", "HR", "Executive", 28, 45000);
Student emp3(103, "Charlie", "Finance", "Analyst", 35, 70000);
cout << "Employees with salary more than ₹50,000:" << endl;
emp1.display();
emp2.display();
emp3.display();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKLy8gQ2xhc3MgZGVjbGFyYXRpb24KY2xhc3MgU3R1ZGVudCB7CnByaXZhdGU6CiAgICBpbnQgZW1wQ29kZTsKICAgIHN0cmluZyBuYW1lOwogICAgc3RyaW5nIGRlcHQ7CiAgICBzdHJpbmcgZGVzaWduYXRpb247CiAgICBpbnQgYWdlOwogICAgZmxvYXQgc2FsYXJ5OwoKcHVibGljOgogICAgLy8gQ29uc3RydWN0b3IgdG8gaW5pdGlhbGl6ZSB0aGUgb2JqZWN0CiAgICBTdHVkZW50KGludCBjb2RlLCBzdHJpbmcgZW1wTmFtZSwgc3RyaW5nIGVtcERlcHQsIHN0cmluZyBlbXBEZXNpZ25hdGlvbiwgaW50IGVtcEFnZSwgZmxvYXQgZW1wU2FsYXJ5KSB7CiAgICAgICAgZW1wQ29kZSA9IGNvZGU7CiAgICAgICAgbmFtZSA9IGVtcE5hbWU7CiAgICAgICAgZGVwdCA9IGVtcERlcHQ7CiAgICAgICAgZGVzaWduYXRpb24gPSBlbXBEZXNpZ25hdGlvbjsKICAgICAgICBh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