Ask Question
8 March, 22:31

A store applies a 15 percent service charge on all items with a price of at least$150. No service charge is otherwise applicable. Which of the following DOES NOTcorrectly compute the service charge? Select one:a. double serviceCharge = 0; if (cost > = 150) {serviceCharge = 0.15 * cost; }b. double serviceCharge = 0.15 * cost; if (cost < = 150) {serviceCharge = 0; }c. double serviceCharge; if (cost = 150) {serviceCharge = 0.15 * cost; }else{serviceCharge = 0; }

+5
Answers (1)
  1. 9 March, 01:43
    0
    The answer is "Option b"

    Explanation:

    In the given choices, in "option b" a double type variable "serviceCharge" is defined that multiply cost value by 0.15, in the next step, if the conditional statement is used, that checks cost value is less then equal to 150. If this condition is true, it will change the variable value, which is equal to 0, that's why this option is wrong because in this option the "serviceCharge" variable value is always 0, and other options are correct.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “A store applies a 15 percent service charge on all items with a price of at least$150. No service charge is otherwise applicable. Which of ...” 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