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

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question

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

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Asymptotic Analysis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr