Error 2 fatal error C1903: unable to recover from previous error(s); stopping compilation c:\users\j0e\documents\visual studio 2008\projects\assignment6pt1\assignment6pt1\assignment6pt1.cpp 40 Assignment6pt1
User is supposed to input the amount in cents between 1-99 and the program gives back how many quarters, dimes, and pennies. I first made this program without functions and since my assignment required I use functions, I added them and I think something got messed up during that process. I had 18 errors and got it down to 2 now. Any help would be amazing. Thank you.
It's possible you've not quite understood function parameters and the scope of variables.
1. Function main declared cents then passes it by value to input.
2. Function input has it's own distint variable called cents, which is different from cents in main. This parameter cents is given a value and the function returns. The value of cents in main remains unchanged.
3. The same for coinQuarters. Variable quarters is passed by value to coinQuarters. The only local variables that coinQuarters sees is it's parameter quarters. It does not see a variable called coinQuarte, and so the compilation fails because of that.