Question:
You are required to write a program which will calculate the salary of an employee according to his/her grade?
2011-01-03 03:03:21 UTC
You must declare a class named CalSalary whose private data members will be employee ID, employee name and employee grade. Also write a constructor, setter and getter functions for all private data members and a function that will calculate the salary.

Detailed Description:
• Employee ID and grade should be of type integer. Employee name should be of type string.
• Constructor should initialize employee ID and grade with value zero and employee name with value NULL.
• For assigning or extracting values from private data members, you must use getter and setter functions.
• Declare a public member function named calculate which will calculate the net salary of the employee according to his/her grade.
• Formula for calculating actual salary is (Basic Salary) + 45% of basic salary.
• If the grade of employee is 17, then the basic salary is 15,000.
• If the grade is 18, then the basic salary is 20,000 and if grade is 19 then the basic salary is 25,000.

Sample Output 1

Please enter employee ID : 001
Please enter employee name : Mohammad Ali
Please enter employee grade : 17

The net salary of Mohammad Ali is Rs.21750



Sample Output 2

Please enter employee ID : 2
Please enter employee name : Aslam Khan
Please enter employee grade : 19

The net salary of Aslam Khan is Rs.36250
Three answers:
2011-01-03 03:28:33 UTC
why don't you just drop out of school? obviously you don't care about coding and you think you're *required* to do the work. i'm sure you won't starve without doing this course you couldn't care less about.



typedef struct {

char *name;

int grade;

int salary;

} employee_t;



start with that instead, class boi.
Abrar Alam
2011-01-03 11:27:55 UTC
i think this is easy program u can do urself ,,, go through c++ book given over there... if u can't able to then,,, publish i can do for u,,,thanx
Jim
2011-01-03 11:15:40 UTC
that means you, not us. get credit for your own code.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...