Ask Question
17 September, 21:58

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; }

+5
Answers (1)
  1. 17 September, 23:41
    0
    The answer to the following code is "40".

    Explanation:

    In the question there are two variable is given that is discountAmount and orderTotal. In the orderTotal variable, we assign a value that is 200. Then we use the if ... else Ladder conditional statement. In this statement, we use the if block in the if block we check condition that if orderTotal variable value is greater then 200. we calculate the 3 percent of orderTotal and put the value in the discountAmount. In the else-if block, we check that if orderTotal variable value is greater then 100. then we calculate the 2 percent of orderTotal that is 40 and put the value in the discountAmount. In the else part we calculate the 1 percent of orderTotal and put the value in the discountAmount. So the answer to this question is "40".
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “After the code that follows is executed, what is the value of discountAmount? var discountAmount; var orderTotal = 200; if (orderTotal > ...” 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