Here is an example for the instruction function:
void instructions( )
cout << "This program will compute the total cost of purchases made by a user \n";
cout << "The program will apply a 5% tax to the total cost of items minus any discount. \n";
cout << "The input to this program is the cost of each item, quantity, and the discount. \n";
cout << "The output is the grand total cost of all items together. \n";
Note that since the function is of type void, no return statement is used. However, a void function may have a return statement, but it will return nothing, i.e.,
may be used in a void function as well. The inclusion of return; in a void function may be inevitable when one wants to exit the function upon reaching a specific condition. For example:
if( cost_per_item <=0)
do something .....
Another example of a void function is a function that takes a real value and displays it with a specific number of decimal points.
void display_it(double x, int precision)
cout << x << endl;
Use overloading to write a function that displays two real values with
a specific precision.