Ask Question
15 August, 13:37

jа vascript

After the code that follows is executed, what is the value of discountAmount?

var discountAmount;

var orderTotal = 200;

if (orderTotal > 200) {

discountAmount = orderTotal *.3;

} else if (orderTotal > 100) {

discountAmount = orderTotal *.2;

} else {

discountAmount = orderTotal *.1;

}

a) 0.0

b) 20.0

c) 40.0

d) 60.0

+3
Answers (1)
  1. 15 August, 17:34
    0
    C. 40

    Explanation:

    The code uses IF and ELSE statements to carry execute a block of code if any of the statements hold true

    OrderTotal here is greater than 100, and this allows the second IF ELSE block to be executed.

    The code to be executed is discountAmount = OrderTotal * 0.2

    This will be discountAmount = 200 * 0.2

    therefore, discountAmount = 40.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “jа vascript After the code that follows is executed, what is the value of discountAmount? var discountAmount; var orderTotal = 200; ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers