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
Luda [366]
3 years ago
11

function calculate () { var s = 2; var x = 2; var y = 3; if (x > 4) { s=s+ 2; } else if ( y > 4) { s=s+ 4; } else { s+=3;}

alert ("s="+s); }//close function
Computers and Technology
1 answer:
MAXImum [283]3 years ago
4 0

Answer:

The output of the given JavaScript code is "5".  

Explanation:

In the given JavaScript code, a method calculate is declared, inside the method, three variable "s, x, and y" is declared, in which all variable assigns a value, that is "2, 2, and 3". In the next step, a conditional statement is defined, that check value, which can be described as follows:

  • In the, If the block, x variable checks its value is greater then 4 if it is true, it will add value 2 in s variable otherwise, it will go to else if block.
  • In this block it will check the value of y variable greater then 4 if it is true, it will add value 4 in s variable.
  • In both of the above conditions is false, it will go to else section, in this, variable  "s" add value 3 in its variable, and use an alert box to print its value.
You might be interested in
(within 200 words) analyzing the importance of information and communication technology in personal life.
Volgvan

Explanation:

Information technology is inescapable in modern day life, turn on the coffee pot and there are tiny microprocessor inside. Start your automobile and every aspect of operation is controlled by dozens of computer control modules. The current mobile phone amazing power and speed for the user. Technology is transforming every aspect of our life. Nowever is this more apparent than our place of employment. Developing of it makes our family to live happy because it helps the members of family to spend their most time with their family. It helps us to communicate the family member who live far from their family. It is also used in house hold work. It's saves our time to do more better and better

6 0
3 years ago
Suppose you want to delete an existing file from within word. What would you do?
Oksana_A [137]
Go in to ur files and find the file and delete it
5 0
3 years ago
Audience centered public speakers are inherently sensitive to the
DanielleElmas [232]
Diversity of their audiences
7 0
2 years ago
Read 2 more answers
Reed Hastings created Netflix. His inspiration came from the fact that he had to pay a sizeable late fee for returning a DVD bey
noname [10]

Answer:

Which statement accurately describes his key to success?

Explanation:

The success in Netflix lies in offering:

1. Entertainment;

2. fun;

3. originality;

4. innovation and

5. happiness.

Netflix learning is:

1. Bet on your content.

2. Brand Personality.

3. Visual universe.

4. Customization

5. Big Data helps Netflix continue to grow and improve customer service.

3 0
3 years ago
What determines gravitational pull?<br><br> volume<br><br> mass<br><br> the sun<br><br> acceleration
Arte-miy333 [17]
C. The sun is correct!
8 0
3 years ago
Read 2 more answers
Other questions:
  • How do i unblock website on my school computer
    7·2 answers
  • When installing wire into a terminal it is important the stripped part of the wire
    13·1 answer
  • Data types influence the following in the workflow: (Select all that apply)a. the color choices and layout decisions around comp
    15·2 answers
  • In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism
    15·1 answer
  • Code the function definition for aNonclassFunction, picking up co. aNonclassFunction has no return value.
    8·1 answer
  • Use the drop-down menus to complete the steps to share a presentation through OneDrive.
    6·1 answer
  • computer is an electronic machine that is used for data processing to produce meaningful information explain in statement​
    5·1 answer
  • What is Microsoft Excel?​
    13·1 answer
  • How do you mark the brainiest?
    8·2 answers
  • Molly needs to access a setting in microsoft windows group policy to change the type of a network to which a computer is attache
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!