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

Step: 3

blur-text-image

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

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

Students also viewed these Databases questions

Question

Rewrite each statement with > so that it uses . 6 > 2

Answered: 1 week ago