I am having a problem with prototypes. I don't really get why I need phototypes or how to use them (my book doesn't explain it well)

One of my problems is I need to use correctMessage() instead of

cout << "Great Work!!!" << "\n";and I also need to use random good comments (switch between great, excellent, very good...). That also applys to incorrectMessage() and

wrong++; while ( z != multiplication(x,y) ) { cout << "Wrong. Try again. \n"; cin >> z; }

and bool needHelp( int, int ) and

fail = (wrong/10)*100; if ( fail <= 75) { cout << "\nPlease ask you instructor for extra help.\n"; }

Thank you for your help and hopefully I will understand the prototypes more. My full program is below.

#include <iostream> using std::cin; using std::cout; using std::endl; #include <cstdlib> using std::rand; using std::srand; #include <ctime> using std::time; void multiplication(); // function prototype for the function you are programming! void correctMessage(); // function prototype void incorrectMessage(); // function prototype bool needHelp( int, int ); // function prototype int main() { srand( time( 0 ) ); // seed random number generator int multiplication( int x = 0, int y = 0 ); // begin multiplication practice int count =1; int x =0; int y =0; int z =0; int wrong =0; double fail =0; while (count <= 10 && z != -1) { count++; x = rand() % 9 + 1; y = rand() % 9 + 1; cout << "How much is " << x << " times " << y << " (-1 to end)? "; cin >> z; if ( z != multiplication(x,y) && z != -1) { wrong++; while ( z != multiplication(x,y) ) { cout << "Wrong. Try again. \n"; cin >> z; } } if ( z == multiplication(x,y)) { cout << "Great Work!!!" << "\n"; } } fail = (wrong/10)*100; if ( fail <= 75) { cout << "\nPlease ask you instructor for extra help.\n"; } return 0; // indicate successful termination } // end main int multiplication(int x, int y) { return x*y; }