![]() |
| ||
| urgent need help in this code I write a C++ program, which stores the information about of the company’s employees. First I create a class named as Employee having following attributes. 1: id 2:name 3: sal 4: address Take input of all the four attributes from the user using four different setter functions. Class has following member functions. 1: display () 2: checkmanger() Member function display() will display all the records of employee using four different getter functions. Call all the four getter functions in this member function to display the records of employee. Make a member function checkmanager() that will find out whether the employee is manager or not if he has salary greater than or equal to 15,000 then he will be considered as a manager and if his salary is less than 15,000 then he will be considered as programmer. Where employee salary cannot be less than zero. Write setters and getters for all the four data members to set and get values. Write also constructor for the class. Also write destructor for the class Firm. Sample Output 1) Enter Employee id: 201 Enter Employee name: Akram Enter Employee salary: 20000 Enter Employee address: Lahore Employee id: 201 Employee name: Akram Employee salary: 20000 Employee address: Lahore The employee is manger. 2) Enter Employee id: 402 Enter Employee name: Ali Enter Employee salary: 10000 Enter Employee address: Lahore Employee id: 402 Employee name: Ali Employee salary: 10000 Employee address: Lahore The employee is Programmer. My program compiles but does not given required results. Please anybody checks, where is my mistake and corrects it. Or write this in a better way. I am new in c++ and not much concept of classes Thanks. //Header Files<< moderator edit: added code tags: [code][/code] >> |
| ||
| Please some one help me in this code I write a C++ program, which stores the information about of the company’s employees. First I create a class named as Employee having following attributes. 1: id 2:name 3: sal 4: address Take input of all the four attributes from the user using four different setter functions. Class has following member functions. 1: display () 2: checkmanger() Member function display() will display all the records of employee using four different getter functions. Call all the four getter functions in this member function to display the records of employee. Make a member function checkmanager() that will find out whether the employee is manager or not if he has salary greater than or equal to 15,000 then he will be considered as a manager and if his salary is less than 15,000 then he will be considered as programmer. Where employee salary cannot be less than zero. Write setters and getters for all the four data members to set and get values. Write also constructor for the class. Also write destructor for the class Firm. Sample Output 1) Enter Employee id: 201 Enter Employee name: Akram Enter Employee salary: 20000 Enter Employee address: Lahore Employee id: 201 Employee name: Akram Employee salary: 20000 Employee address: Lahore The employee is manger. 2) Enter Employee id: 402 Enter Employee name: Ali Enter Employee salary: 10000 Enter Employee address: Lahore Employee id: 402 Employee name: Ali Employee salary: 10000 Employee address: Lahore The employee is Programmer. My program compiles but does not given required results. Please anybody checks, where is my mistake and corrects it. Or write this in a better way. I am new in c++ and not much concept of classes Thanks. //Header Files<< moderator edit: added code tags: [code][/code] >> |
| ||
| Re: urgent need help in this code Shahid, Search for the word "Change" in the following code to see my changes. Also, I added a mock definition for the input function. Take care, Bruce //Header Files<< moderator edit: added code tags: [code][/code] >> |
| All times are GMT -4. The time now is 1:27 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC