functions frustration

This is a discussion on functions frustration within the C++ Programming forums, part of the General Programming Boards category; i dont know where to start with this code i have
Code:
#include <iostream>
#include <string>
using namespace std;
int ...

i got the basics of the program to work; but i'm trying to add more levels to it:

Add (Level 2) to use functions to break your program into more manageable pieces. I'd recommend the display of the result go into a function to de-clutter the main.

In fact, you can probably break out another function from the results-display: the random pre-message generation. If you do, I'll throw in another (Level 1.5) to make just the random number formula into an inline function.

You can add a special (Level 1.5) to place your suffix-determining code in a generic/re-usable function.

Add (Level 1.5) to place your suffix function in a library.

Add (Level 1.5) to place your random number generation function in a library.

what are yall recommendations on starting a function in order to add these levels?

Does that tutorial have a lesson on functions? If not, take a look at the cprogramming.com function tutorial, and I strongly advise you to get a good beginning C++ book. Most books will give you much more explanation/information than an online tutorial... A typical beginning C++ book will cover esentially the same topics as a tutorial, but it will have 300-700 pages!

The concept of a function is a "detour" in the program flow. So, as your programming is stepping-through main(), it takes a detour to do the stuff in the function, and then comes back to main where it left-off.

Or, you can think of a function as a "subcontractor". You hire the main contractor to build a house, and he hires a bunch of subcontractors to do the actual work.

One advantage of functions is that you can call the function several times, from different places in your program. If you didn't use a function, you would have to repeat that code everywhere it's needed. You can even build a library of functions and use them in several different programs.

You will have a function prototype, a function definition, and one or more function calls. Take your time, and study these things carefully, because function prototypes, function calls, and the first line of a function definition, all look somewhat similar, but they have slightly different requirements.

When your function returns to main(), it may return with one value. If your function needs to affect/change more than one value, you have to use references or pointers.

And, when you pass-in a variable to a function, you are only passing-in the value associated with the variable. The variable name inside the function may be different from the name of the variable passed-in.