Develop your code a few lines at a time.
Someday I'm going to write an essay on this topic. It seems like a lot of instructors don't really teach how to approach a programming problem. This result in lots of frustrated beginners & students.
Nobody... not even experienced programmers write the whole program before trying it out!
1- Start-out with a 'Hello World" type program. You can substitute "Hello World" with some better description of the program.
2- Add one or two lines of code at a time. Compile, test-run, and debug before adding more lines.
3- Add some extra cout statements so you can "see" what the program is doing, and confirm that it's working, before you're completely done. (You can take them out, or coment them out later.)
4- When you create a function, make an empty (do-nothing) function first. Make the function prototype, the empty function definition, and the function call. Then, test-compile. If your function needs to return a value, just make it return a constant (i.e. return 10; ). It's also helpful to put a cout statement in your do-nothing function like: cout << "Now in FunctionOne() \n"; .
Now, this isn't as easy as it sounds, because you can't just write line one, then line two, then line three, of your code. (It won't compile if you do that.) The trick (the fun part, actually) is figuring-out which part of code makes sense to work on next.
Compilers can easily get confused when threre's an error (or two). Sometimes they will point to the wrong line. Sometimes one real error will cause the compiler to report several errors. Link errors are even trickier to track down.
So, it really helps to test-run and test-compile after every one or two lines. As you gain experience, you can write whole functions before testing. But, as you gain experience your programs generally will get longer and more complex, so you still won't be writing the whole program before testing & debugging.