Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Pick one of the following languages: Python, Modula, Ada, C#, or Perl. After con

ID: 3581542 • Letter: P

Question

Pick one of the following languages: Python, Modula, Ada, C#, or Perl. After consulting an authoritative reference, discuss each of the following requirements for that language: Declaration before use. Overloading of operators for programmer-defined types. Binding time of array size. What constitutes a scope? Location of a declaration within a scope. How does a decimal value waste memory space? Assume the following JavaScript program was interpreted using static-scoping rules. What value of x is displayed in function sub1? Under dynamic-scoping rules, what value of x is displayed in function sub1? Consider the following JavaScript program:

Explanation / Answer

C# is selected

a)Declaration is done before use to tell the compiler the return type of variable and alsomemory allocated to it.

b)by operator overloading

we can give special meaning to user defined types

we can give special meaning to operator

we can make it to do additional work other than its normal work

c)Binding is an association between the name and a thing.

There are twp main ways of binding

early bindng:time:If we know the target method at compile time,then it is known as early binding

late binding time:If we come to know the state of method or object at run time,then it is late binding.

d)scope:The lifetime and visibility of an object is called as scope.There are 2 main types of scope

scope within a function:Here visibility of a variable is just bounded within the opening and closing brackets of the function.

e)

scope within a entire program :This is also called as global scope.Here visibility of a variable is valid throughout the program.declaration within a scope is the declaration valid done within the brackets.It may be global or local level.

7)

These representations are called binary coded decimal (BCD). In some cases, they are stored one digit per byte, but in others, they are packed two digits per byte.Therefore, to store a six-digit coded decimal number requires 24 bits of memory. However, it takes only 20 bits to store the same number in binary.This is how decimal value waste the space.