Get beginning
Get end
Set total to end - beginning
If total <= 1000 then
   Set cost to total * 0.06
Else
   Set cost to 1000 * 0.06 + (total - 1000) * 0.08
Output cost
If total < 500 then
Output "Thanks for conserving energy"
Stop