subject

The following questions refer to the skeletal C++ program shown below. (a) Assume that static scoping is used. List all variables, along with the functions in which they are declared, that are visible at Line 1 in the program.
(b) Repeat part (a), but list the variables that are visible at Line 2.
(c) Repeat part (a), but list the variables that are visible at Line 3.
(d) Repeat part (a), but list the variables that are visible at Line 4.
(e) Repeat part (a), but list the variables that are visible at Line 5.
(f) Assume that dynamic scoping is used, and that main calls f1, which calls f2. (Assume that f1 calls f2 on Line 3.) List all variables, along with the functions in which they are declared, that are visible at Line 5 in the program.
void fl ();
void f2();
int a, b, c;
int main()
{int a, b, d; ...
//Line 1}
void fl()
{int d, e;
if (...)
{int a, b; ...
//Line 2} ...
//Line 3}
void f2()
{int a, c; if (...)
{int b, c; ...
//Line 4} ...
//Line 5}
Here's an example of the format that you should use for your answers: a (global), d (declared in fl), e (declared in if block in fl)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
Dave has to create animations for a game. which tool can dave use?
Answers: 3
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
question
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
question
Computers and Technology, 24.06.2019 11:30
Why is body language an important factor in a business meeting
Answers: 1
You know the right answer?
The following questions refer to the skeletal C++ program shown below. (a) Assume that static scopi...
Questions
Questions on the website: 13722362