Consider a situation where you are buying books online. The bookseller charges $19.95 as the price per book and $4.95 as the handling cost for up to three books. For every book purchased in addition to three books, there is a handling charge of $1.50. In addition, there is a 7 percent tax on the cost of the books but not on the handlingCharges. Assuming that numBooks represents the number of books you are purchasing, which of the following is the correct algorithm for calculating the total cost of your purchase?
A) Total charge for books = 19.95 * numBooks
Tax on the books = numBooks * .7
If (books <= 3) then handlingCharges = 4.95
Else handlingCharges = 1.50 * numBooks
Total cost of order = total charge for books + tax + handlingCharges
B) Total charge for books = 19.95 * numBooks
Tax on the books = total charge for books * .07
If (books = 3) then handlingCharges = 4.95
Else handlingCharges = 1.50 * numBooks
Total cost of order = total charge for books + tax + handlingCharges
C) Total charge for books = 19.95 * numBooks
Tax on the books = numBooks * .07
If (books < 3) then handlingCharges = 4.95
Else handlingCharges = 4.95 + 1.50 * (numBooks - 3)
Total cost of order = total charge for books + tax + handlingCharges
D) Total charge for books = 19.95 * numBooks
Tax on the books = total charge for books * .07
If (books <= 3) then handlingCharges = 4.95
Else handlingCharges = 4.95 + 1.50 * (numBooks - 3)
Total cost of order = total charge for books + tax + handlingCharges
Correct Answer:
Verified
Q40: Every Java program consists of one or
Q41: What is the purpose of the following
Q42: Imagine you are planning to purchase a
Q43: Consider a situation where you are buying
Q44: Imagine you are planning to buy a
Q46: What is the purpose of the following
Q47: While developing a program, the programmer adds
Q48: UML Supermarket has different ways of awarding
Q49: Which one of the following errors represents
Q50: When a compiler finds a syntax error
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