|
|
|
|
|
|
|
Print two lines of asterisks
Print Welcome Home!
Print four lines of asterisks |
|
|
|
|
|
|
|
|
|
|
Print ***************
Print *************** |
|
|
|
|
|
|
|
|
|
|
|
Print ***************
Print ***************
Print ***************
Print *************** |
|
|
|
|
|
|
|
|
|
|
If we write the two Level 1 modules as void functions, the main function is simply |
|
|
|
|
|
|
|
|
int main()
{
Print2Lines();
cout << Welcome Home! << endl;
Print4Lines();
return 0;
} |
|
|
|
|
|
|
|
|
Notice how similar this code is to the main module of our top-down design. It contains two function callsone to a function named Print2Lines and another to a function named Print4Lines. Both of these functions are parameterlessthat is, they have no parameters within the parentheses. |
|
|
|
|
|
|
|
|
The following code should look familiar to you, but look carefully at the function heading. |
|
|
|
|
|