In this code I got age to work, but I think im misunderstanding HOW it works as I am trying to get it to also do weight but am running into a bunch of different errors.
constructors are special in that they do not have a type. Typically functions have a type, even if it is void.
Weight() is an error, then, because its a function that has no type and is not of the same name as its owning class so it isn't a constructor.
it should probably be
float Weight(); //will return the value of weight
another issue is your setters. While overloading a function (having 2 versions that have the same name, like Weight() and Weight(float) ) is useful at times, it is generally frowned upon to have the overloads do different things. I would have a GetWeight() and SetWeight(float) so the reader can see what is going on. What you are doing is legal, but disorienting (much moreso in a big program than a small one).
It is a very good thing to learn to debug because as you improve your programming skills your programs are going to be longer and longer and more complexed and sometimes it is necessary to now what is happening in the memory.
I look in error list and
1.line 72 error -you do not have ;
2.line 72 one more error -you can not wright classname.something
you can call functions only on Class objects i.e child.Weigt()
3.You defined function Weight but if it has no return value you must wright void behind
void Weight()
void Weight(float newWeight)
It is the same as showAge function there you have void
First you create an object and after you call function on that object.
Person child(12);
child.Weight(123.23);