Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago