Help me clean this up.

This is a discussion on Help me clean this up. within the C++ Programming forums, part of the General Programming Boards category; I got the idea to write this out of a book as a little project for myself. It works, but ...

Help me clean this up.

I got the idea to write this out of a book as a little project for myself. It works, but I'm thinking their had be be an easier way. I'm just starting, and struggling with the usage (not concept) of classes. Any suggestions will be greatly appreciated.

cout << "This program will show the user two different employees for Widegets Inc.\n";
cout << "These two employees are Bob and Martha,\n";
cout << "and you will be asked to input some data for each one.\n";
cout << "The this program will output that data you have given it. Ready?\n";

Thanks, but I was looking for something more along the lines of making this little project more streamlined. Given a day to think about it, I suppose I should have made just one Employee class and made Bob and Martha instances of the class, but I'm still unsure on how to make everything I did happen that way.
Please help me out.

Sounds sensible to me . As far as I could tell the classes had the same functions and variables, so you could just erase the second one entirely and rename to first to something like "employee" just to make more sense then
in main:

Code:

employee Bob;
employee Martha;

seems like the rest would work pretty much the same, but without the extra code...

If you need the input method for the employee class to say the employee's name instead of just replacing it with "employee," you could pass the employee's name to the method. You could also add a variable and methods for the employee's name in the class declaration. Your SetAge, SetYOJ, etc declarations should probably return the value to which the variable was set instead of void...to aid in error checking both now and in the future when it's become a habit.