Skip to content

Instantly share code, notes, and snippets.

Poppin' Bottles

You've just been hired at Lighthouse Markets, a reputable (and thoroughly fictional) grocery store chain. One of the primary features of Lighthouse Markets is their recycling program on pop bottles. Here is how the program works:

  • For every two empty bottles, you can get one free (full) bottle of pop
  • For every four bottle caps, you can get one free (full) bottle of pop
  • Each bottle of pop costs $2 to purchase

Given these parameters, write a program so that you can figure out how many total bottles of pop can be redeemed given a customer investment.