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
/* 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
/* 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started