Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I know this has something to do with loops but I cannot figure it out… I have to

ID: 3887087 • Letter: I

Question

I know this has something to do with loops but I cannot figure it out… I have to make it more efficient.

here is the problem:

// The QuickCopy company currently makes 60,000 copies per year

// at 15 cents each.

// They expect to increase the number of copies produced

// by 4 percent per year each year for the next 10 years,

// starting with this year.

// They also expect the price of each copy to increase

// by 3 cents per year, starting with this year.

// This program displays the company's expected

// income for each of the next 10 years.

// Modify it to be more efficient.

start

   Declarations

      num year = 1

      num copies = 60000

      num price = 0.15

      num total = 0

      num COPIES_INCREASE = 0.04

      num PRICE_INCREASE = 0.03

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

      year = year + 1

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

      year = year + 1

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

      year = year + 1

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

      year = year + 1

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

      year = year + 1

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

      year = year + 1

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

      year = year + 1

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

      year = year + 1

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

      year = year + 1

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total

stop

Explanation / Answer

start

   Declarations

      num year = 1

      num copies = 60000

      num price = 0.15

      num total = 0

      num COPIES_INCREASE = 0.04

      num PRICE_INCREASE = 0.03

while year <= 10         // this make a loop of 10 cycle for 10 years

do

      copies = copies + copies * COPIES_INCREASE

      price = price + price * PRICE_INCREASE

      total = total + copies * price

      output year, total              // display year and total amount

      year = year + 1

endwhile

stop