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 endir 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
Get step-by-step solutions from verified subject matter experts
