# Answer to Question #41212 in C++ for Muhammad Lokman Darus

Question #41212

5.Assume that a software company sells a product that

￼retails RM99 per unit.

￼

Quantity

Discount

￼

10-19

20%

20-49

30%

50 and above

40%

Write a pseudocode/flowchart that asks for the number

of units sold and computes the total cost of the purchase

after discounted. (assume the number of unit is > 0).

￼retails RM99 per unit.

￼

Quantity

Discount

￼

10-19

20%

20-49

30%

50 and above

40%

Write a pseudocode/flowchart that asks for the number

of units sold and computes the total cost of the purchase

after discounted. (assume the number of unit is > 0).

Expert's answer

out("Please enter the number of units sold:");

in(int numberOfUnits);

int discount = 0;

if (numberOfUnits > 50)

discount = 40;

else if (numberOfUnits > 20)

discount = 30;

else if (numberOfUnits > 10)

discount = 20;

double total = numberOfUnits * 99 * (100 - discount) / 100;

out(total);

in(int numberOfUnits);

int discount = 0;

if (numberOfUnits > 50)

discount = 40;

else if (numberOfUnits > 20)

discount = 30;

else if (numberOfUnits > 10)

discount = 20;

double total = numberOfUnits * 99 * (100 - discount) / 100;

out(total);

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment