If you write each statement on its own line, you can see that it spells out much of the initial code for you. Make an initial attempt and post that.
create a class called employee that include three pieces of information as data members - a first name(tye 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 demostrates 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
Reputation Points: 2780
Solved Threads: 312
long time no c
Offline 4,790 posts
since Apr 2004