Ask Question

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

+5
Answers (1)
  1. 5 June, 23:22
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers