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
Q56: Which of the following conditions will correctly
Q96: What is the output of the following
Q97: Assuming that the valid cost should be
Q99: What is the output of the following
Q100: What is the output of the following
Q102: What will be printed by the statements
Q104: Which of the following performs the same
Q105: Which of the following conditions tests for
Q106: Which of the following conditions can be
Q111: Which of the following options checks that
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