Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Consider the following JavaScript program (6pts) vaX, y, Z; function sub1 { var.a, y, Z, function sub2 ( var a, b, z; function sub3

image text in transcribedimage text in transcribed

1. Consider the following JavaScript program (6pts) vaX, y, Z; function sub1 { var.a, y, Z, function sub2 ( var a, b, z; function sub3 (X List all the variables, along with the program units where they are declared, that are visible in the bodies of sub1, sub2 and sub3, assuming static scope 2. Show the order of evaluation of the expressions assuming that there are no precedence rules and all operators associate right to left. (9 pts) a*b-1 + c ii)(a-b)/c & (d'ela-3) ii) a (b-1) /c mod d 3. Let the function fun be defined as (10 pts) int fun(int *k) *k +4; return 3* ("k) -1;) suppose fun is used in the program as follows void maiolX intL:10, j = 10, sum1, sum2; sum1- (i/2) + fun (&i); sum2 - fun (&j) + (j/ 2);) What are the values of sum1 and sum2 a. Operands in the expressions are evaluated left to right? b. Operands in the expressions are evaluated right to left

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

=+ 49-4 Explain how gender roles and gender identity differ.

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago

Question

Is there a clear hierarchy of points in my outline?

Answered: 1 week ago