The following range-checking code works but is somewhat inefficient. Explain why and show how to revise it to be more efficient.
if (saleAmount >= 1000)
commissionRate = 0.08;
else if (saleAmount >= 500)
commissionRate = 0.06;
else if (saleAmount
commissionRate = 0.05;
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q25: What is the syntax of the conditional
Q27: What are four of the most frequent
Q30: List the four keywords used in a
Q30: Explain (in words) how bonuses are assigned
Q31: The optional keyword _ is used prior
Q33: Programmers often use _, a tool that
Q36: A(n) _ decision has two possible resulting
Q37: In C#, an error occurs if you
Q39: The conditional operator ?: is a(n) _
Q40: The NOT operator is written as _.
A)
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