A company applies a discount based on the size of the order.If the order is over $50, the discount is 5%.If the order is over $100, the discount is 10%.Otherwise, there is no discount.If the integer variable order contains the size of the order, which of the following will assign the double variable discount the correct value?
A) if (order > 100)
discount =0.10;
else if (order > 50)
discount =0.05;
else
discount =0;
B) If (order > 100)
discount =0.10;
if (order > 50)
discount =0.05;
else
discount =0;
C) if (order > 100)
discount =0.10;
if (order >50 )
discount =0.05;
if (order <=50 )
discount =0;
D) if (order > 50)
discount =0.05;
else if (order > 100)
discount =0.10;
else
discount =0;
Correct Answer:
Verified
Q75: To which of the following coding techniques
Q76: Which of the following options refers to
Q77: Assuming that a user enters 10, 20,
Q78: Assuming that a user enters 5 as
Q79: When an if statement is nested inside
Q81: Which of the following operators is used
Q82: Assuming that a user enters 64 as
Q83: Which of the following operators compare using
Q84: The flow chart shows the order in
Q85: Consider the following code snippet:
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