Hello berni2k, I am not sure if you still need help with this, but I would like to offer some. I am new to the board or else I would have responded sooner. First, of course I know you probably don't want to hear this, I have some questions and comments. The comments:
1) C++ has some new and complex topics like classes that are hard for new and experienced programmers to grasp. Even still, there are several ways of implementing solutions to problems in C++ and you may find a class is not necessary to gain a solution.
2) Looking at the problem at hand, it would appear a class is a good way.
3) Do not expect to code anything FAST in C++, particularly with such an intermediate/advanced aspect of C++ like classes.
Now, on to the questions. Why did you chose to use a class to solve this problem? When thinking about a class, outside of the obvious like classname, you will need to think about what libraries/operations you need to perform and want to have, constructor(s) to initialize private member variables, destructors, member, private, and free functions. Why do you think you need a class for Holidays specifically?
Did you check online resources, tutorials, etc. for solutions to similar problems? This sounds pretty familiar although I have never programmed anything like this before.I want to output the work days between two dates (start and end date input by user).
To output information, you will use the "cout << _____;", but may have to overload it for your class. Reading input in from a user can be done with "cin >> _____;" You would have two separate "cin" statements, one for reading in the start date and one for the end date. This would take place in your main function, not in the class declaration or implementation. I thought through it but dont know how to code it.
How much experience do you have in C++? If you are just learning the language, then of course it would be hard to know where to start. If you are a novice, but have some experience with C++, then you should be familar with what I am telling you and at least be able to write/provide some pseudo code of what it is you are trying to do. You seem to have a good idea of where to go with this, but you need to really review classes and nail down what you are trying to accomplish because I suspect you can do this without the use of classes, but it would take several functions and that could get messy.
I hope this helps you out some.
Edited by Lathrup_Baseball, 03 August 2007 - 10:46 PM.