Question: QUESTION 3 Given the following program segment. #include void calculate (float, float &, float &); int main() { float a=10, b=0, c=0; calculate (a, b,

QUESTION 3 Given the following program segment. #include void calculate (float, float &, float &); int main() { float a=10, b=0, c=0; calculate (a, b, c); cout << (a + b + c) << endl; return 0;

6 | Page CSC415: Fundamentals of Computer Problem Solving

6

} void calculate (float x, float &y, float &z) { y = 0.2 * x; z = 0.3 * x; } a) List three (3) local variables in the main() function. b) Identify the data type of parameter received by function calculate(). c) Identify the type of passing of parameter x (hint: by value or reference). d) Identify the type of passing of parameter z (hint: by value or reference). e) Show the output of the above program.

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!