Hi there,
Although Mr. ToniAz has a point in us not going to do the work for you, I think some more clarification of your assignment may help get you on your way.
The main thing in the task description is this:
fidelers23 wrote: |
---|
Write the definitions of the declared function prototypes of the given code. |
You have been given declarations of functions, such as
void selectMenu ();
, this is like telling the compiler "just so you know, the function selectMenu will be defined somewhere in this file, ready for you to use it when you need to." Not doing this would involve the risk of the compiler throwing errors at you for "undefined functions".
Now, an example of a function declaration and definition would be as follows:
1 2 3 4 5 6 7 8
|
//telling the compiler there is a function called print_text, which takes a string as an argument
void print_text(std::string text);
//actually defining the function viz. telling the compiler what this function should actually do when called
void print_text(std::string text)
{
std::cout << text;
}
|
Off course that's a bit of a silly example, but you get the point hopefully.
So, as to your particular situation, a vague example, which you'll have to work out further yourself for it to work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
// --- Declaration
void selectMenu ();
// --- Definition
//this function will display the main menu options
//and will return a value of the selected transaction
// the program should validate the input : selection of options should be 1,2,3 and 4 only
//use do -while loop for validation of option
void int selectMenu()
{
int answer;
do
{
/* print menu options to screen and ask for an answer */
} while (/* answer is smaller than zero or bigger than 5 (1-4) */)
return answer;
}
|
Now, whoever wrote that code for you was in a hurry, this function is supposed to return something, according to the description, so it can never be of type void. Void functions don't return anything, they just do something without giving feedback.
Anyway, I hope that gets you on your way at least.
All the best,
NwN