Pure Programmer
Blue Matrix


Cluster Map

Project: Supermarket Sale

A supermarket is having a sale on 2-liter bottles of soda: 3 for $2.99. Write a program that prints the price for 1 through 12 bottles of soda. Remember to round prices to dollars and cents.

Output
$ perl SupermarketSale1.pl 1 bottle(s) is $1.00 2 bottle(s) is $1.99 3 bottle(s) is $2.99 4 bottle(s) is $3.99 5 bottle(s) is $4.98 6 bottle(s) is $5.98 7 bottle(s) is $6.98 8 bottle(s) is $7.97 9 bottle(s) is $8.97 10 bottle(s) is $9.97 11 bottle(s) is $10.96 12 bottle(s) is $11.96

Solution