Purchase Solution

Ada skeletal program

Not what you're looking for?

Ask Custom Question

--------------------------------------------------------------------------------
Consider the following Ada skeletal program:

procedure Main is
X : Interger;
procedure Sub3; -- This is a declaration of Sub3
-- It allows sub1 to call it
procedure Sub1 is
X : Interger;
procedure Sub2 is
begin -- of Sub2
...
end; -- of Sub2
begin -- of Sub1
...
end; -- of Sub1
procedure Sub3 is
begin -- of Sub3
...
end; -- of Sub3
begin -- of Main
...
end; -- of Main

Assume that the execution of this program is in the following unit order:

Main calls Sub1
Sub1 calls Sub2
Sub2 calls Sub3

Need this explained:

Assuming static scoping, which declaration of X is the correct one for a reference to X in the following:

i. Sub1
ii. Sub2
iii. Sub3

Purchase this Solution

Solution Summary

The Ada skeletal program is assessed.

Solution Preview

I call the first declaration of X in Main as outer X and the second declaration of X in Sub1 as
the inner X.

i. ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.