A store provides 10 percent discount on all items with a price of at least $100. No discount is otherwise applicable. Which of the following DOES NOT correctly compute the discount?
A) double discount = 0;
If (price >= 100)
{
Discount = 0.10 * price;
}
B) double discount = 0.10 * price;
If (price <= 100)
{
Discount = 0;
}
C) double discount;
If (price < 100)
{
Discount = 0;
}
Else
{
Discount = 0.10 * price;
}
D) double discount = 10;
If (price >= 100)
{
Discount = 0.1 * price;
}
Else
{
Discount = 0;
}
Correct Answer:
Verified
Q9: Which of the following statements is (are)
Q10: Suppose one needs an if statement to
Q11: Assuming that the user provides 99 as
Q11: Which statement about an if statement is
Q12: Which of the following statements is correct
Q13: What can be done to improve the
Q17: Which of the following operators is used
Q17: Which of the following is the correct
Q18: What are the two parts of an
Q19: Assuming that a user enters 15 as
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