Skip to content

Instantly share code, notes, and snippets.

@jacobh
Created October 20, 2011 20:01
Show Gist options
  • Save jacobh/1302166 to your computer and use it in GitHub Desktop.
Save jacobh/1302166 to your computer and use it in GitHub Desktop.
"Pseudocode"
# set prices
adult_prices = {
1: 46,
2: 84,
3: 120,
4: 150,
5: 175
}
child_prices = {
1: 23,
2: 42,
3: 60,
4: 80,
5: 95
}
family_prices = {
1: 115,
2: 210,
3: 320,
4: 400,
5: 480
}
# inputs
tours = input('please enter the number of tours')
family_passes = input('please enter the number of family passes')
adult_passes = input('please enter the number of adult passes')
child_passes = input('please enter the number of child passes')
total = 0
if tours > 0:
if family_passes > 0:
family_total = family_price[family_passes] * tours
print family_passes, '* Family Pass(es) for', tours, '= $', family_total
total = total + family_total
if adult_passes > 0:
adult_total = adult_price[adult_passes] * tours
print family_passes, '* Adult Pass(es) for', tours, '= $', family_total
total = total + adult_total
if child_passes > 0:
child_total = child_price[child_passes] * tours
print child_passes, '* Child Pass(es) for', tours, '= $', family_total
total = total + child_total
if total > 0:
gst = total / 11
print 'Total Cost = $', total
print 'GST = $', gst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment