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
Gemima has converted her table to a clustered column
Ber [7]

Answer:

1. Select the table

2. use Ctrl A

3. type the title

3 0
3 years ago
What are the different type of computer files?
oee [108]

Answer:

There actually a lot of them: World, PPT, Excell

Explanation:

6 0
3 years ago
Read 2 more answers
Which of the following enables users on different e-mail systems to exchange messages?
Setler [38]
MTA (Mail Transfer Agent)
7 0
3 years ago
Explain gui in detail​
valina [46]

Answer:

Stands for "Graphical User Interface" and is pronounced "gooey." It is a user interface that includes graphical elements, such as windows, icons and buttons. The term was created in the 1970s to distinguish graphical interfaces from text-based ones, such as command line interfaces.

Explanation:

The graphical user interface is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based user interfaces, typed command labels or text navigation. A GUI allows the user of a computer to communicate with the computer by moving a pointer around on a screen and clicking a button. ... A program on the computer is constantly checking for the location of the pointer on the screen, any movement of the mouse, and any buttons pressed.A GUI uses windows, icons, and menus to carry out commands, such as opening, deleting, and moving files. Although a GUI operating system is primarily navigated using a mouse, a keyboard can also be used via keyboard shortcuts or the arrow keys.

7 0
3 years ago
Which best explains why it is important to avoid sharing photos online?
konstantin123 [22]

Answer

To keep your privacy away from bad people, to keep your self safe whilst on the internet. Also if you could link the answer choices it would help greatly!

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Why do most people share, especially photos online using social media?
    11·2 answers
  • Which of the following is Not included in the Web Accessibility Initiative? Don’t rely on color alone.
    7·1 answer
  • When installing a SATA hard drive, is it true or false that you need to move the jumpers on the back of the drive to instruct th
    6·1 answer
  • Do u like five nights at Freddy's? and is it good or bad?​
    8·3 answers
  • Which of the following is an example of physical noise?
    15·1 answer
  • Using hard disk to temporarily store data or instructions from ram is referred to as the
    12·1 answer
  • Write a program that outputs inflation rates for two successive years and whether the inflation is increasing or decreasing. Ask
    9·1 answer
  • Hello 10 points if my Chromebook is on 26 percent how much time do I have left theoretically
    8·2 answers
  • When using bits to represent fractions of a number, can you make all possible fractions?
    9·1 answer
  • Write a program that prompts for a positive integer and prints the factors of all integers from 1 to that input integer. For exa
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!