Question: Diagram below shown a pseudo code to calculate and print the new price after a discount of 10% is given if quantity buying (quantity) greater

Diagram below shown a pseudo code to calculate and print the new price after a discount of 10% is given if quantity buying (quantity) greater than 5 or total amount (totalAmount) greater than 100.

Start

Get unitPrice and quantity

totalAmount = unitPrice * quantity

if(quantity > 5) or (totalAmount > 100) then

discount = 0.1

else

discount = 0

endif

discountAmount = discount * totalAmount

totalAmount = totalAmount discountAmount

display totalAmount

Stop

Write a C code segmnet to calculate the discount using the function named as computeDiscount(). The function will return the total amount after discount

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!