Determine the scope of each identifier. #include <iostream> #include <cmath> #in
ID: 3622007 • Letter: D
Question
Determine the scope of each identifier.#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
void traceMe(double x, double y);
int main()
{
double one, two;
cout << "Enter two numbers: ";
cin >> one >> two;
cout << endl;
traceMe(one, two);
traceMe(two, one);
return 0;
}
void traceMe(double x, double y)
{
double z;
if (x != 0)
z = sqrt(y) / x;
else
{
cout << "Enter a nonzero number: ";
cin >> x;
cout << endl;
z = floor(pow(y, x));
}
cout << fixed << showpoint << setprecision(2);
cout << x << ", << y << ", " << z << endl;
}
Explanation / Answer
please rate - thanks
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
void traceMe(double x, double y);
int main()
{
double one, two; one, two scope goes from here
cout << "Enter two numbers: ";
cin >> one >> two;
cout << endl;
traceMe(one, two);
traceMe(two, one);
return 0; to here
}
void traceMe(double x, double y) x and y start here
{
double z; z starts here
if (x != 0)
z = sqrt(y) / x;
else
{
cout << "Enter a nonzero number: ";
cin >> x;
cout << endl;
z = floor(pow(y, x));
}
cout << fixed << showpoint << setprecision(2);
cout << x << ", << y << ", " << z << endl;
} x and y end here z ends here
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.