Coursework 1

Megabyte Energy Bars Question

The SnackShack convenience store sells Megabyte energy bars according to the following pricing rules: To answer this question, write a Python program that takes one input, which is the number of Megabyte bars a customer wants to buy, and gives 1 output, which is the total cost in pounds of buying that number of Megabyte bars.

Examples

Num Bars (input) Cost in £s (output) Cost Breakdown
3 3.75 3 single bars
12 10 2 six packs
15 13.75 2 sixpacks and 3 single bars
26 20.25 4 sixpacks, 2 singles (22.50), 10% discount (-2.25).

Notes:

Template file: