Ask Question
4 September, 16: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; }

+1
Answers (1)
  1. 4 September, 17:03
    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 & 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