154k views
2 votes
This function prints a proverb. The function takes a number // from the call. If that number is a 1 it prints "Now is the time // for all good men to come to the aid of their party." // Otherwise, it prints "Now is the time for all good men // to come to the aid of their country." // data in: code for ending word of proverb (integer) // data out: no actual parameter altered

1 Answer

4 votes

Answer:

// This function is written in C++ Programming Language

// Comments are used for explanatory purpose

// The scope of this code segment is limited to only the required function/module

// Program starts here

#include<iostream>

using namespace std;

int main ()

{

// Main method is omitted

}

// Declare function

void proverb(int digit)

{

if(digit == 1) // check if digit is 1

{

cout << "Now is the time for all good men to come to the aid of their party.";

}

else //Otherwise

{

cout << "Now is the time for all good men to come to the aid of their country";

}

}

// End of program

User Elasticrash
by
7.5k points