C++/Help! Create a Person.h header file
Borland C++ 5.02
I am trying to create a header file, "Person.h",
which will hold a class description and implementation (i.e. both within the header file) as follows.
The class is called Person, and has two attributes - name and year of birth.
This needs to be created by a user defined constructor method which can be used to set these attributes, using parameters which are passed when an object of the class is created.
Add two other methods which will write out
1. The persons name
2. The approximate age in any specified year, which is passed as a parameter to the method.
I need assistance to write a short test program which will create an object of the class, setting the attributes as described above, and which then calls the methods, writing the result of each out onto the screen.
I have made a genuine attempt to create this program, but failed and was told it was not what they wanted. The problem I am having is trying to understand the code and
when an error message appears when running the program.
cout<< "Hello "<<mybuffer<<".\n";
cout<< "What is your date of birth? ";
cout<< "How old are you? ";
cout<< "Thank you for your assistance";
cout<< "Thank you "<<mybuffer<<".\n";
cout<< "You have entered: ";
I would be extremely grateful if you could get back to me soon as possible.
Wayne , Thank you for your question.
It is against my policy to do homework questions. I can help you with work that you have already done, but I cannot give you full answers.
Please attempt to do part of the work, and then ask a specific question when you get stuck.
Learning can be difficult, but doing your own work will repay your effort with good grades in school and success in your career.