I've been given this assignment and to be frank, I haven't understood much part of this in college. I usually understand well by examples which are not given there much. So, now, I have an assignment, the full text of which goes as follows:
Design a class Person with private data members as bellow
name as array of character
age as an integer
gender as a character
address as array of character
public member functions as below:
initData( ) function for initialization of all data member
showData( ) function for display of all data members
getAge( ) function for returning age of a person
getGender ( ) function for returning gender of a person
setAge ( ) function for modifying age of a person.
Design the main function to create a person and invoke it’s member functions.
Programming is like football: the only way to learn it is to do it. Hit your books and figure out how to declare a class with data and member functions. This is a very basic assignment. You need to learn to do this on your own.
I'm sorry if this doesn't seem helpful, but the longer you delay learning the basics, the more trouble you'll have later on.
Thank you for the encouragement. I agree with what you say, but, sometimes, there's not enough time to learn. I have to submit the assignment really soon.
Also, I didn't stop trying it out myself. I still am trying out stuff.
HrishikeshK, tinker away! When you get stuck for more than hour, post the code that you have and ask specific questions. If the code isn't compiling, include the exact error message(s). If it isn't doing what you expect, post (1) the input that you're using, (2) the output that you get, and (3) the output that you expect. the more info you post, the easier it is for us to help you.