Ask Question
23 January, 05:05

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

+1
Answers (1)
  1. 23 January, 05:10
    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?
Find 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 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