Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Durham Taxi Fare Calculator
- '(c) Dominic McGough September 2011
- '(~Small Basic~)
- TextWindow.Title = "DCC Taxi Fare Calculator ~ Dominic McGough 2011"
- 'Change Font display colours here:-
- 'main:-
- pen1 = "gray"
- 'result:-
- pen2 = "darkred"
- 'header:-
- pen3 = "darkgray"
- 'user ink:-
- pen4 = "darkyellow"
- TextWindow.ForegroundColor = pen3
- TextWindow.WriteLine("Durham County Council Taxi Fare Calculator")
- TextWindow.WriteLine("---- Dominic McGough ~ September 2011 ----")
- 'TextWindow.WriteLine(" ")
- TextWindow.WriteLine("------------------------------------------")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine(" ")
- start:
- TextWindow.ForegroundColor = pen1
- TextWindow.Write("Input Distance (in miles): ")
- TextWindow.ForegroundColor = pen4
- Miles = TextWindow.Read()
- TextWindow.ForegroundColor = pen1
- 'convert miles to yards
- yards = Miles * 1760
- TextWindow.WriteLine(" ")
- TextWindow.Write("Input Tariff (1-6): ")
- TextWindow.ForegroundColor = pen4
- Tariff = TextWindow.Read()
- TextWindow.ForegroundColor = pen1
- TextWindow.WriteLine(" ")
- If Tariff = 1 Then
- 'below: (((yards - [1st x number of yards])/'[per y unit distance thereafter]' *[z pence])
- '+ [£2.55 (for the first 500 yards or less)]
- Price = (((yards - 500)/101.8)* .10) + 2.55
- 'below: formula for getting 1 decimal place!!
- Price = Math.Floor(Price*Math.Power(10,1))/Math.Power(10,1)
- TextWindow.Write("The fare will be ** " )
- TextWindow.ForegroundColor = pen2
- TextWindow.Write("£")
- TextWindow.Write(Price)
- TextWindow.ForegroundColor = pen1
- TextWindow.WriteLine(" **")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("(As set by Durham County Council, September 2011)")
- TextWindow.WriteLine(" ")
- EndIf
- 'all other Tariff options follow above formula format using their own respective values
- If Tariff = 2 Then
- Price = (((yards - 500)/112) * .15) + 3.15
- Price = Math.Floor(Price*Math.Power(10,1))/Math.Power(10,1)
- TextWindow.Write("The fare will be ** " )
- TextWindow.ForegroundColor = pen2
- TextWindow.Write("£")
- TextWindow.Write(Price)
- TextWindow.ForegroundColor = pen1
- TextWindow.WriteLine(" **")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("(As set by Durham County Council, September 2011)")
- TextWindow.WriteLine(" ")
- EndIf
- If Tariff = 3 Then
- Price = (((yards - 500)/97.4) * .20) + 4.40
- Price = Math.Floor(Price*Math.Power(10,1))/Math.Power(10,1)
- TextWindow.Write("The fare will be ** " )
- TextWindow.ForegroundColor = pen2
- TextWindow.Write("£")
- TextWindow.Write(Price)
- TextWindow.ForegroundColor = pen1
- TextWindow.WriteLine(" **")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("(As set by Durham County Council, September 2011)")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("Hey, it's Christmas-time for er... goodness' sake!!")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("Do you really think I want to be out here driving you around when I could be at home getting sozzled, stuffing my face & spending time with people whom I ")
- TextWindow.WriteLine ("actually care about?!")
- EndIf
- If Tariff = 4 Then
- Price = (((yards - 500)/101.8) * .15) + 3.35
- Price = Math.Floor(Price*Math.Power(10,1))/Math.Power(10,1)
- TextWindow.Write("The fare will be ** " )
- TextWindow.ForegroundColor = pen2
- TextWindow.Write("£")
- TextWindow.Write(Price)
- TextWindow.ForegroundColor = pen1
- TextWindow.WriteLine(" **")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("(As set by Durham County Council, September 2011)")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("No joke- it really is this price for a six-seater run!")
- EndIf
- If Tariff = 5 Then
- Price = (((yards - 500)/112) * .20) + 4.15
- Price = Math.Floor(Price*Math.Power(10,1))/Math.Power(10,1)
- TextWindow.Write("The fare will be ** " )
- TextWindow.ForegroundColor = pen2
- TextWindow.Write("£")
- TextWindow.Write(Price)
- TextWindow.ForegroundColor = pen1
- TextWindow.WriteLine(" **")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("(As set by Durham County Council, September 2011)")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("No joke- it really is this price for a six-seater run!")
- EndIf
- If Tariff = 6 Then
- Price = (((yards - 500)/97.4) * .35) + 5.50
- Price = Math.Floor(Price*Math.Power(10,1))/Math.Power(10,1)
- TextWindow.Write("The fare will be ** " )
- TextWindow.ForegroundColor = pen2
- TextWindow.Write("£")
- TextWindow.Write(Price)
- TextWindow.ForegroundColor = pen1
- TextWindow.WriteLine(" **")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("(As set by Durham County Council, September 2011)")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("Hey, it's Christmas-time for er... goodness' sake!!")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("Do you really think I want to be out here driving you around when I could be at home getting sozzled, stuffing my face & spending time with people whom I ")
- TextWindow.WriteLine ("actually care about?!")
- EndIf
- If Tariff < 1 Or Tariff > 6 then
- TextWindow.WriteLine("Error! Insert a number between 1 and 6!")
- Goto start
- EndIf
- 'code for 'Retry' option (to recalculate using different values)
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine(" ")
- TextWindow.Write("Go again? (y/n): ")
- AgainOrQuit = TextWindow.Read()
- TextWindow.WriteLine(" ")
- If AgainOrQuit = "y" Then
- Goto start
- Else
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine("No? OK- See ya later, Navigator!")
- TextWindow.WriteLine(" ")
- TextWindow.WriteLine(" ")
- 'pic
- TextWindow.WriteLine(". --- [\")
- TextWindow.WriteLine(". ------ .----' `-----.")
- TextWindow.WriteLine(". --- --- --- //^^^^;;^^^^^^`\")
- TextWindow.WriteLine(". - ---- _______//_____||_____()_\________")
- TextWindow.WriteLine(". ------ /3363 : : ___ `\")
- TextWindow.WriteLine(". ---- |> ____; ; |/\><| ____ _<)")
- TextWindow.WriteLine(". ---- {____/ \_________________/ \____}")
- TextWindow.WriteLine(". \ '' / \ '' /")
- TextWindow.WriteLine(". |> <> /\/\ '--' '--'")
- TextWindow.WriteLine(". ")
- TextWindow.WriteLine(". ")
- EndIf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement