Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql++ For Sql Users A Tutorial

Authors: Don Chamberlin

1st Edition

0692184503, 978-0692184509

More Books

Students also viewed these Databases questions