Question about puting mutiple programs into one. I am studying C++ for part of my networking course and am not the best at it. This week have to combine smaller programs into one larger one and I am having trouble. I have got this far on my program but for some reason i cant get it to compile and run. The goal is to have it ask for the information in the 2 lower parts then send it back to the main interface. Any ideas or input would be helpful. To some it up its asking for you to enter the number of children Then it gives you a tax rebate of up to 1000 for each child if you have more then 4 children its defualts to 4000.
#include <iostream>
using namespace std;
int getNumChildren( );
int calCredit( );
int main( )
{
int numChildren = 0;
int totCredit = 0;
calCreadit doesn't know anything about numChildren in main(). You have to pass it as a parameter. See http://www.cplusplus.com/doc/tutorial/functions/
Apart from that, you only have to call these functions from main. You may even write int totalCredit = calCredit( numChildren );