Solved

A Company Applies a Discount Based on the Size of the Order

Question 101

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents