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 NOT correctly compute the service charge?
A) double servicecharge =0;
if (cos t>=150)
{
serviceCharge =0.15 * cost;
}
B) double serviceCharge =0.15^* cost;
if (cos t<=150)
{
serviceCharge =0;
}
C) double serviceCharge;
if (cost<150)
{
serviceCharge =0;
}
else
{
serviceCharge =0.15 * cost;
}
D) double servicecharge =15;
if (cost>=150)
{
serviceCharge =0.15 * cost;
}
else
{
serviceCharge =0;
}
Correct Answer:
Verified
Q20: The following code snippet contains an error.What
Q21: What is the output of the statements
Q22: What is the output of the statements
Q23: What is the output of the following
Q24: Which of the following operators is NOT
Q26: What is the output of the following
Q27: What is the output of the statements
Q28: Assuming that the user provides 49 as
Q29: What is the output of the following
Q30: The two strings "Aardvark" and "Aardvandermeer" are
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents