Ask Question
6 June, 06:28

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. 6 June, 07:58
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers