Boss: update the price in place

Complete the previous lesson to unlock this one.

Back to the path

Boss: update the price in place

Level 3: Parameters. The procedure has to change the caller’s price. The rate is only an input. That is BYREF for one parameter and by value for the other.

Write ApplyDiscount(BYREF Price, Rate). It sets

Price ← Price × (100 − Rate) DIV 100

Read a price and a rate, call the procedure, and output the new price.

Example: 200 then 10 → 180. Use DIV, not /, so the result is an integer.