Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

More Books

Students also viewed these Databases questions