When the compiler encounters the call to "numChildren ( );" in the main, it has not yet seen the declaration of "int numChildren ( ) { ... }" further down below. It doesn't recognize the function, and thus exits with an error.
What you need to do is give the compiler a heads-up about a function called numChildren being declared further down, before you actually call it. This is called a *prototype*, you tell the compiler what the name, return type and expected parameter types of a function are before you call it.
You need to place this prototype at the start of your source file, before the function call. Normally, prototypes are placed in header files (someheader.h), because those are included at the top of your actual source files, before any function calls.
http://pastebin.com/MzVQr0Kq
Now we are not out of the woods yet. There are still errors.
You are trying to call the function "totChildren();" from main, you probably meant to call "calCredit();".
The second problem is that you have named a variable "numChildren" which is the same as a function name "numChildren()". When the compiler sees a reference to "numChildren" it wont know if you meant the variable or function, it thus exists with an error. We can prevent this by renaming any of the two, I renamed the function to getNumChildren().
http://pastebin.com/LqP7fjZ2
The next problems are the "int numChildren = 0;" and "int totChildren = 0;". Those are placed inside the function body of getNumChildren. This means that they can only be used inside that function body, and are removed as soon as the function is done.
When "calCredit()" is called, it tries to access the variables "totChildren" and "numChildren", which don't exist.
What you need to do, is return the value of "numChildren" from the "getNumChildren()" function, and give it to "calCredit" to do a calculation with:
http://pastebin.com/G0bEg6B0 (note how I changed the function prototypes and declarations too)
And now the "calCredit()" function. The logic does not make any sense, and the variable "totCredit" is never declared.
What you probably meant to do was calculate "totCredit", instead of "totChildren". If totCredit > 4000 then you cap it at 4000. And after all that is done, you output the credit.
http://pastebin.com/Tx4vTC50
Last but not least: "system" is a function which is situated in the C standard library, it is not really recommended to use it just for pausing a program, but you can call it by including "#include
".
http://pastebin.com/ig6uqxQx (not recommended, but works)
You are better of using cin.get() though. This makes use of the native I/O library, and does not defer to some external system executable. For more info why system("pause") is bad: http://www.gidnetwork.com/b-61.html.
Final version: http://pastebin.com/m1WFyz7h