Question: / / this program will allow the user to input from the keyboard whethered the last word to the following proverb shoul be party or

// this program will allow the user to input from the keyboard whethered the last word to the following proverb shoul be party or country.
// "Now is the time for all good men to come to the aid of their ".
// Inputting a 1 will use the word party. Any other number will use the word country.
// PLACE YOUR NAME HERE.
#include
#include
using namespace std;
// Fill in the prototype of the function writeProverb.
int main ()
{
int wordCode;
cout << "Given the phrase:" << endl;
cout << "Now is the time for all good men to come to the aid of their ___"
<< endl;
cout << "Input a 1 if you want the sentence to be finished with party"
<< endl;
cout << "Input any other number for the word country" << endl; cout << "Please input your choice now" << endl;
cin >> wordCode;
cout << endl;
writeProverb(wordCode);
return 0;
}
//******************************************************************************
//
//
//
//
//
//
//
//
//
//
//
void
task:
data in: data out:
writeProverb
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."
code for ending word of proverb (integer)
no actual parameter altered
*****************************************************************************
writeProverb (int number)
{
}
// Fill in the body of the function to accomplish what is described above
Exercise 1: Some people know this proverb as Now is the time for all good men to come to the aid of their country while others heard it as Now is the time for all good men to come to the aid of their party. This program will allow the user to choose which way they want it printed. Fill in the blanks of the program to accomplish what is described in the program comments. What happens if you inadvertently enter a float such as -3.97?
Exercise 2: Change the program so that an input of 1 from the user will print party at the end, a 2 will print country and any other number will be invalid so that the user will need to enter a new choice.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!