Tuesday, July 14, 2009

Can you please help me with my C++ problem?

(Employee Class) Create a class called Employee that includes three pieces of information as data members—a first name (type string), a last name (type string) and a monthly salary (type int).Your class should have a constructor that initializes the three data members. Provide a set and a get function for each data member. If the monthly salary is not positive, set it to 0. Write a test program that demonstrates class Employee’s capabilities. Create two Employee objects and display each object’s yearly salary. Then give each Employee a 10 percent raise and display each Employee’s yearly salary again.

Can you please help me with my C++ problem?
I won't do your homework for you. But if you have SPECIFIC questions, ask them.





---------------


EDIT: Proving once again that free advice is worth every penny, we have FaisalK, whose employee class won't even come close to compiling. However, as is often the case, the syntax errors mostly serve as cover to mask the more serious underlying design flaws.








---------------


ASIDE to kev: Still praying for me, buddy? It seems kind of ridiculous to me for someone to try to cheat on someone else's behalf and then to give them something that will guarantee them a failing grade. I don't mind pointing that out, and I doubt that I ever will.





But I guess it doesn't really change anything. Some people just seem to enjoy spewing out whatever cr*pola comes to mind all over the internets.





After all, 2 points is 2 points, right kev?
Reply:How much are you paying us to do your homework for you?


As much as your parents are paying your teachers to pay you?





Just pay attention in class instead of asking others to do it for you.
Reply:wait....start over lmao
Reply:#include%26lt;iostream%26gt;





using namespace std;





class employee


{


declare name as a string;


last name as a string;


monthly salary as a int;





public:


void getdata(void);


void setdata(void);





emlployee()


{


monthly salary = 0


last name = arun;


first name = arun;


};


void employee::getdata(void)


{


cout%26lt;%26lt;"a first name:";


cin%26gt;%26gt;name


cout%26lt;%26lt;"a last name:";


cin%26gt;%26gt;name


cout%26lt;%26lt;"monthly salary:";


}


void employee::setdata(void)


{


cout%26lt;%26lt;"first name";%26lt;%26lt;first name%26lt;%26lt;"\n";


cout%26lt;%26lt;"last name";%26lt;%26lt;last name%26lt;%26lt;"\n";


cout%26lt;%26lt;"monthly salary";%26lt;%26lt;monthly salary%26lt;%26lt;"\n";


}


return 0;


}





you can use this link for reference http://www.daniweb.com/forums/thread3038...
Reply:class Employee {


string firstname;


string lastname;


};
Reply:Whats your problem?


The whole thing or just a part?


No comments:

Post a Comment