Hello, I started learning C/C++ by taking a class and everything was going smoothly until we had to refactor the Procedures we've done into Functions to return a value.
The program is working fine with Procedures.
I did the first transitioning of a Procedure into Function and it wasn't detected as an error (it still won't compile nonetheless).
Onto the next procedure, I did the same thing as I did and compile...I got tax_rate: 'undeclared identifier'
Below is just a bit of the code I'm working on and where I'm currently stuck at.
I hope to receive some hints or advice to solve this problem I'm currently on.
Thanks for the help.
i think in c++ functions and procedures mean the same thing,
1. you shouldn't define functions within main -> your line 12 does that
2. declare variables before using them, tax doesn't do that
3. don't use conflicting names for functions and variables, let each be unique,
seems like you have a local variables and a function called tax
well you overall code structure should be something close to this