Answer:
See Explanation
Step-by-step explanation:
Required
Modify the program
To modify the program, we simply make use of an iterative statement.
To do this, I'll make use of a do while loop.
So, we have:
Declarations
num year = 1
num copies = 100000
num price = 0.15
num total = 0
num COPIES_INCREASE = 0.04
num PRICE_INCREASE = 0.03
do:
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
while year<=10
The above do while loop enables the program to repeat the statements in the following block:
do:
----
---------
---
-
while year <=10
The loop calculates the copies & price in each year and also updates the values of the variables; so that they can be used for the nexr iteration