1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Neko [114]
3 years ago
9

Functional side effects: 15) Given the following Java/C++ like code. Assuming function calls (operands) are evaluated from left-

to-right, one at a time. a) What outputs are printed to the screen? int a = 4; // global variable int fun1() { a = 2; return 3; } int fun2() { return a; } void main() { int x = fun1() + fun2(); System.out.println("x = " + x); } Answer: x = b) What outputs are printed to the screen? int a = 4; // global variable int fun1() { a = 2; return 3; } int fun2() { return a; } void main() { int x = fun2() + fun1(); System.out.println("x = " + x); } Answer: x =
Computers and Technology
1 answer:
tigry1 [53]3 years ago
7 0

Answer:

a. x = 5

b. x = 7

Explanation:

a)

OUTPUT: x = 5

In the main() function, fun1() is evaluated first and it updates the value of the global variable to 2 and returns 3.

The second function returns the value of the global variable 'a' and this variable has value 2.

So,

x = 3 + 2

x = 5

b)

OUTPUT: x = 7

In the main() function, fun2() is evaluated first and it returns 4 because global variable 'a' is initialized with value 4.

The second function fun()1 will returns the value 3.

So,

x = 4 + 3

x = 7

You might be interested in
When you take a multiple-choice test, you are relying on ________, a means of retrieving information out of your long-term memor
Karolina [17]

Answer:b)Recognition

Explanation: Recognition method is the technique which is based upon the similarity of the structure.It basically compares between the received format and the format of the reference on the basis of their structure.It is considered as a good method of the retrieving the image or format which is in storage. This usually results in opting the correct answer or option.

Therefore, the correct answer is option (b).

8 0
3 years ago
Optimizing a PC’s performance often involves utilities that can defragment disks, clean a system’s Registry, scan for malware, r
KATRIN_1 [288]

Answer:

a. True

Explanation:

PC's sometimes runs slowly and on the long run cost money. Optimizing performance involves running software utilities that could restore speed and efficiency.

Scanning for malware/ virus , cleaning system registry, uninstalling unused program,  deleting unnecessary files, disk defragment , updating of windows software and setting up the browser are ways to optimize your pc's performance.

3 0
3 years ago
Calculate the maximal size of a file if we have:
ollegr [7]

Answer:

4 GB

Explanation:

<u>Determine the maximal size of a file </u>

100 direct block address

= 100 * 1024 = 102400

One single indirect block address

= 128 * 1024 = 131072

One double indirect block address

= 128 * 128 * 1024 = 16777216

one triple indirect block address

=  128 * 128 * 128 * 1024 = 2147483648

one quadruple indirect block addresses

=  128 * 128 * 128 * 128 * 1024 = 274877906944

maximal size of the file

= ∑ 102400 +  131072 + 16777216 + 2147483648 + 274877906944

= 4GB

7 0
3 years ago
What is the Multiplier if the change in RGDP is $525,000,000 and initial spending is $100,000?
OLEGan [10]
The right answer is A
4 0
3 years ago
On a DTP project, Morgan is preparing digital files to be sent to a printer. Which word describes the activity that Morgan is pe
VladimirAG [237]

In this activity Morgan is preparing the digital files to a printer  on a DTP project.

Explanation:

DTP project is the creation of documents using page layout on a personal computer. The process of printing digital based images directly to variety of media substrates is known as digital processing.

The digital files like PDFs can be sent directly to digital printing press to print on paper, photo paper, fabric and so on.

They have unique fade rates and different sensitives to the various deterioration mechanisms. DTP is used for graphic designers to create documents.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Explain why blocking ping (ICMP echo request) packets at an organization's edge router is not an effective defense against ping
    11·1 answer
  • David has created a lot of styles and now his Quick Style Gallery contains styles he no longer uses.
    14·2 answers
  • Analyze the following code. // Program 1: public class Test { public static void main(String[] args) { Object a1 = new A(); Obje
    5·1 answer
  • Given the availability of an ofstream object named output, write the other statements necessary to write the string "3.14159" in
    8·1 answer
  • If you were to mount a nonmetallic box to the front of a stud, what type of bracket should the box have? A. FP B. BP C. NP D. JP
    13·1 answer
  • In Microsoft Word, when you highlight existing text you want to replace, you're in
    7·1 answer
  • Select the correct answer from each drop-down menu. Look at Marta's email signature and fill in the missing elements. Marta D'Ab
    14·2 answers
  • Suddenly, though, just as the procedure was about to be relayed to the astronauts, the pressure . . . the temperature . . . drop
    5·2 answers
  • We call any device connected to the Internet a(n) ________. Group of answer choices router host IP client
    9·1 answer
  • The arrangement of keys on a keyboard, QWERTY reflects the keyboard layout by ________. Group of answer choices using the letter
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!