The price of 2 liters of milk was R14.99 in 2014. Using a rate of inflation of 6.3% per year, calculate and print each year since 2014 to 2020 with the price of milk in that year, up to and including 2020. Which of the following algorithms will solve this problem statement? Select one: a.DeterminePriceIncrease price = 14.99 for k = 2014 to 2020 display “Year: “, k, “ price: R”, price price = 14.99 * 0.063 next k end b.DeterminePriceIncrease for k >= 2020 display “Year: “, k, “ price: R”, price price = price * 1.063 next k end c.DeterminePriceIncrease for k = 2014 to 2020 display “Year: “, k, “ price: R”, price price = 14.99 * 1.063 next k end d.DeterminePriceIncrease price = 14.99 for k = 2014 to 2020 display “Year: “, k, “ price: R”, price price = 14.99 * 1.063 next k end
The price of 2 liters of milk was R14.99 in 2014. Using a rate of inflation of 6.3% per year, calculate and print each year since 2014 to 2020 with the price of milk in that year, up to and including 2020. Which of the following
price = 14.99
for k = 2014 to 2020
display “Year: “, k, “ price: R”, price
price = 14.99 * 0.063
next k
end
for k >= 2020
display “Year: “, k, “ price: R”, price
price = price * 1.063
next k
end
for k = 2014 to 2020
display “Year: “, k, “ price: R”, price
price = 14.99 * 1.063
next k
end
price = 14.99
for k = 2014 to 2020
display “Year: “, k, “ price: R”, price
price = 14.99 * 1.063
next k
end
Step by step
Solved in 2 steps