Imagine you are developing an algorithm to calculate the total cost of a purchase order that contains several items. The cost of each item and the tax rate is known. The standard shipping charge for the entire order is $4.95, and the special delivery charge is $19.95. In addition, there is no tax on the shipping cost. Which of the following is the correct pseudocode for the required algorithm?
A) For each item on the purchase order:
Order cost = order cost + item cost
Total purchase order cost = order cost + tax rate + 4.95
B) For each item on the purchase order:
Order cost = order cost + item cost
If standard shipping
Shipping cost = 4.95
Else
Shipping cost = 19.95
Total purchase order cost = order cost * tax rate + shipping cost
C) If standard shipping
Shipping cost = 4.95
Else
Shipping cost = 19.95
For each item on the purchase order:
Order cost = order cost + item cost + shipping cost
Total purchase order cost = order cost * tax rate
D) If special delivery
Shipping cost = 4.95
Else
Shipping cost = 19.95
For each item on the purchase order:
Order cost = order cost + item cost
Total purchase order cost = order cost * tax rate + shipping cost
Correct Answer:
Verified
Q55: What is a logic error?
A) An error
Q56: The programmer, not the compiler, is responsible
Q57: What kind of error is created by
Q58: What kind of error is created by
Q59: Who or what is responsible for inspecting
Q61: What is the output of the following
Q62: In order to translate a Java program
Q63: The language developed by Sun Microsystems that
Q64: In order to run Java programs on
Q65: Which one of the following code snippets
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