110k views
0 votes
LAB 6.1 Functions with No Parameters Retrieve program proverb.cpp from the Lab 6.1 folder. The code is as follows: //This program prints the proverb // Now // in a function (procedure) //PLACE YOUR NAME HERE #include using namespace std; void writeProverb(); //This is the prototype for the writeProverb function int main() // Fill in the code to call the writeProverb function return 0; } // // // // // // // // writeProverb task: This function prints a proverb data in: none data out: no actual parameter altered // Fill in the function heading and the body of the function thatwill print //program Exercise : Fill in the code (places in bold so that the program will print out the tion.

1 Answer

7 votes

Program proverb.cpp prints a proverb in a function. Code includes a writeProverb() function prototype and a main function.

The program proverb.cpp is a simple program that demonstrates the use of functions with no parameters in C++.

The program declares a function called writeProverb() that prints a proverb.

In the main() function, the writeProverb() function is called.

The program then terminates.

To complete the program, we need to fill in the function body for writeProverb() by adding the appropriate code to print the proverb.

The output should include the text "Now is the time for all good men" followed by a newline character.

Once the function body is complete, running the program will call the writeProverb() function, which will print the proverb to the console.

For more such questions on Proverb:

User SLaks
by
8.5k points