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
Targeting encourages drivers to scan far ahead and _____________. A. focus their visual attention on the next point on the road
Colt1911 [192]
<span>A. focus their visual attention on the next point on the road.  A driver must have a target, it can be the car in front, a building pr a structure on the road.  Targeting enables the driver to look further ahead on the road and thus be ready for any obstacle on the road.</span>
3 0
3 years ago
Read 2 more answers
Ask how many apples the user wants. Ask how many people the user will share the apples with. Find out how many apples will remai
Sati [7]

Answer:

The program in Python is as follows:

apples = int(input("Apples: "))

people = int(input("People: "))

apples%=people

print("Remaining: ",apples)

Explanation:

This gets the number of apples

apples = int(input("Apples: "))

This gets the number of people to share the apple

people = int(input("People: "))

This calculates the remaining apple after sharing the apple evenly

apples%=people

This prints the calculated remainder

print("Remaining: ",apples)

5 0
3 years ago
A person who has a been exposed to technology at a young age is?
Dahasolnce [82]
Ok if lets say a young child at the age of like 6-7 was allowed to play grand theft auto by his/her parents maybe the child would understand incorrectly and start doing what the people do in the game this may cause to serious trouble jail time or even death. In this case dont let your kids play underrated games or watch underrated movies.
Hope that helped you understand more.
7 0
3 years ago
Please read !!!
prisoha [69]
Don’t stress. You’re no failure if you believe in yourself. Have some faith. Don’t give up and live your life to the fullest. Take care and stay safe!! :)
3 0
3 years ago
Write the definition of a method dashedLine, with one parameter, an int. If the parameter is negative or zero, the method does n
ZanzabumX [31]

Answer:

import java.util.Scanner;

public class DashLine {

public static void main(String[] args) {

// Declaring variables

int n;

/*

* Creating an Scanner class object which is used to get the inputs

* entered by the user

*/

Scanner sc = new Scanner(System.in);

// Getting the input entered by the user

System.out.print("Enter a number :");

n = sc.nextInt();

// calling the method by passing the user entered input as argument

dashedLine(n);

}

//This method will print the dashed line for number greater than zer

private static void dashedLine(int n) {

if (n > 0) {

for (int i = 1; i <= n; i++) {

System.out.print("-");

}

System.out.println();

}

}

}

Explanation:

5 0
3 years ago
Other questions:
  • In what year did commercial use of the Internet become available? 1991 1996 1999 2001
    9·1 answer
  • HURRY
    5·1 answer
  • An optimal solution to a linear programming problem MUST lie A. somewere on the line between two corner points. B. somewhere out
    12·1 answer
  • Which computer company was named after an orchard? dell, apple, or ibm
    11·1 answer
  • Comments should be written in what type of language
    6·1 answer
  • Typically, a DVD has how many times more capacity than a CD?
    12·1 answer
  • In the past, workers would usually complete ______. a. A variety of tasks on a daily basis b. The same tasks every day c. Thinki
    9·2 answers
  • Range paramters - for loop<br> question in picture
    13·1 answer
  • What are the value and data type (float, int, bool, or str) of this expression:<br> 5 // 2
    9·1 answer
  • The courts can adjust the penalties in lawsuits to reflect the fact that infringements may be _____.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!