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
Before starting a spreadsheet, it is smarter to plan ahead and think through the design. true or false
Nesterboy [21]
True. THe axis order (horizontal/vertical) for instance, can cause a serious headache to you when organized wrong.
The same goes with functions, it's better to check them mentally/in a piece of paper beforehand.
6 0
3 years ago
A software application used at one computer to interact with other nodes on a network is called_____.
Ivanshal [37]

Answer:

A MIRCOCOMPTER NETWORK

Explanation:

3 0
4 years ago
Always follow the routine "clean up while in use and clean up before keeping it".
Anvisha [2.4K]
This answer out of the true or false or true
5 0
3 years ago
_____ is a technical career skill.
kifflom [539]
Time management is a very crucial skill to have because taking to long would set you back a long way.
7 0
3 years ago
Read 2 more answers
You work on the marketing team for a software company. You do not work closely with the development team; however, you need to k
topjm [15]

Answer:

b. an e-mail

Explanation:

Based on the scenario being described within the question it can be said that the best electronic communication tool in this scenario would be an e-mail. Using e-mails you would be able to send detailed communication messages to all of the individuals that need to read that message in one e-mail. Thus allowing for fast and clear communication between all relevant parties. Both podcasts and Wiki's are used for providing information to clients, or the target audience but not for sharing info within the company.

4 0
3 years ago
Other questions:
  • What is collaboration software?
    7·2 answers
  • If your driving privilege is suspended or revoked you may be eligible to apply for a hardship license or reinstatement to determ
    13·2 answers
  • Where may an operating system reside in a mobile device?
    5·1 answer
  • Where would you go to add fractions to a document in adobe indesign
    5·1 answer
  • People express more. often through the ___. language than written language
    9·2 answers
  • What will be the values of ans, x, and y after the following statements are executed? int ans = 35, x = 50, y =50; if ( x >=
    7·2 answers
  • What will you do to run a presentation from a computer on which you did not prepare the presentation, and how?
    13·1 answer
  • When it's time to change career paths, it's a good idea to first​
    7·2 answers
  • Nicole is in a study group to prepare for a test on plant biology, a subject she knows a lot about. During their meetings, she a
    8·2 answers
  • 4.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!