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
Bcghxdfghncfghndfgxdfgjfjgktyerdgftguj
IgorLugansk [536]

Answer:

Okay

Explanation:

4 0
4 years ago
Read 2 more answers
WIN
Delicious77 [7]
The correct answer is D
6 0
3 years ago
Read 2 more answers
How are devices connected to each other via Bluetooth? Choose two answers.
Olegator [25]

Answer:

Pairing and Passkey or PIN

Explanation:

8 0
3 years ago
Insert XXX to output the student's ID. public class Student { private double myGPA; private int myID; public getID) { return myI
Aleonysh [2.5K]

Answer:

Explanation:

The question above is missing many details and are actually various questions in one. I will answer each one seperately below...

A. The piece of code to get the ID in this code snippet that needs to replace XXX would be the following ... System.out.println("Student ID: " + s.getID());

B. A static main() can declare and create objects. Once these objects are created their instance methods can then be called.

C. Integer score1 = 72;

    int score2 = 85;

    Character grade = 'C';

     In the above code snippet, the information stored in score1, score2, and grade are the following... obj reference, 85, obj reference. This is becasue both Integer and Character are classes and the values being passed to their variables are referencing that object class, while score2 is a primitive type of int and is therefore simply a number.

D. The statement that is true is ... Contents of a Double instance can be modified after initialization. Objects can be modified by calling its setter methods after initializing it.

7 0
3 years ago
Which step is first in changing the proofing language of an entire document?
Genrish500 [490]
Select the whole document by pressing Ctrl+a.
7 0
3 years ago
Other questions:
  • 2. a. Write pseudocode for a divide-and-conquer algorithm for finding valuesof both the largest and smallest elements in an arra
    11·1 answer
  • Which of the following is true of two-factor authentication?
    13·1 answer
  • Name types of operating system with example
    5·1 answer
  • Find two consecutive even integers such that twice the smaller is 16 more than the larger
    10·1 answer
  • A score of 3 or better on the exam administered at the end of which type of course usually means that you will earn college cred
    6·1 answer
  • These icons cannot be removed from the Dock. Finder e-mail music player Trash
    14·1 answer
  • Because people can easily upload information and share online, they tend to:
    15·1 answer
  • In this class, it is very common for your computer screen to look like this. What is this?​
    5·1 answer
  • You are part of the team assigned to implement new software at XYZ Inc. The employees at XYZ Inc. trust the results obtained fro
    7·1 answer
  • What’s the name of the technology that lets ryzen™ 5 series cpus access the entire gddr memory of radeon™ rx gpus?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!