Question: Part a) Define a function ComputeVal() that takes one integer parameter and returns the parameter plus 6. Ex: If the input is 3, then the

Part a)

Define a function ComputeVal() that takes one integer parameter and returns the parameter plus 6.

Ex: If the input is 3, then the output is:

9

#include using namespace std;

/* Your code goes here */

int main() { int input; int result; cin >> input; result = ComputeVal(input); cout << result << endl;

return 0; }

Part B)

Define a function PrintInfo() that takes one string parameter and one integer parameter and outputs as follows, ending with a newline. The function should not return any value.

Ex: If the input is Lusaka 1331254, then the output is:

Lusaka has 1331254 people.

#include using namespace std;

/* Your code goes here */

int main() { string cityName; int cityInfo;

cin >> cityName; cin >> cityInfo;

PrintInfo(cityName, cityInfo);

return 0; }

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 Databases Questions!