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, 21.06.2019 21:30
Apower user needs you to install a second type of operating system on his computer to increase efficiency while running some specialized software programs. which installation technique should you use?
Answers: 3
question
Computers and Technology, 22.06.2019 12:00
Which of the following “invisible” marks represents an inserted tab?
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
What is a costume plot? why is it important to a film or theater production?
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
Terri needs to insert a cover page into her document. where should she go to access the commands to do so? o insert tab, objects group o insert tab, illustrations group o insert tab, pages group o insert tab, media group submit
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: 13722361