Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

bellow it 8. Given the following program, answer the questions be Winclude iostr

ID: 3737868 • Letter: B

Question

bellow it 8. Given the following program, answer the questions be Winclude iostream> using namespace std const float PI 3.14157; int numl; float sall; char chl; void getinfo(float, int) foat setdata (int&, float&, char& int main (O f int num2; float result, sal2; char ch2; return 0; float setdata (int &a;, float & b, char &c;) int i,j void getinfo (float x, int y) Write a function call to setdata from main. Use the locally declared variables. b. Write a function call to getinfo from main. Use the locally declared variables. c. Based on your answers above, identify all arguments d. Write the complete headings of all the functions in the program. a. (2 pts) (2 pts) (2 pts) (3 pts) e. Write the names of all the global identifiers excluding functions. (4 pts) f. Write the names of all of the local identifiers that are not parameters. (4 pts) g. Identify all parameters in all functions (2 pts)

Explanation / Answer

NOTE: I have completed the program for your assignment. Please check and let me know if you have any questions. I will acknowledge back with a response within 24 hours. Thanks for your patience.


a)
As num1, num2 are integer variables and sal1, sal2 are float variables,
ch1, ch2 are character variables. We can call setdata function with these values.
setdata(num1, sal1, ch1);
setdata(num2, sal2, ch2);

b)
We can call call getinfo with sal1, num1 and sal2, num2 because they are float and integer variables.
getinfo(sal1, num1);
getinfo(sal2, num2);


c)
In the above two questions (a) and (b) the arguments are

num1, sal1, ch1
num2, sal2, ch2

for the setdata function call.

and

sal1, num1
sal2, num2

for the getinfo function call.


d)
All function headers in the program are:
int main()
float setdata(int & a, float & b, char & c)
void getinfo(float x, int y)

e)
Global identifiers are:
PI
num1, sal1, ch1
i, j

f)
In main() function the local identifiers are:
num2, result, sal2, ch2

g)
a, b, c are parameters of the function setdata
and
x, y are parameters of the function getinfo