#include <iostream> using namespace std; class emp { public: char* emp_name; int getInfo(char* emp_name, int emp_id_number, int emp_age) { cout << "Employee Name: " << emp_name << "\n"; cout << "Employee Id Number: " << emp_id_number << "\n"; cout << "Employee Age: " << emp_age; } }; class salary: public emp{ public: int getSalary(){ int tax_number; cout << "\nEnter Tax Number\t"; cin >> tax_number; } int calculateNet(){ int gross_salary; int deductions; cout << "Enter Gross Salary\t"; cin >> gross_salary; cout << "Enter deductions\t"; cin >> deductions; int netsalary = gross_salary - deductions; cout << "Salary Structure\n"; cout << "Gross Salary:\t"; cout << gross_salary << "\n"; cout << "Deductions: \t"; cout << deductions << "\n"; cout << "Netsalary\t"; cout << netsalary; } }; int main() { emp emp1; emp1.getInfo("Felix", 635932, 23); salary emp2; emp2.getSalary(); emp2.calculateNet(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)