Created
May 25, 2014 00:27
-
-
Save TheEvilDev/89f55865763a69367857 to your computer and use it in GitHub Desktop.
My 7 year old son Drake's first FSharp program $$$
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Learn more about F# at http://fsharp.net | |
// See the 'F# Tutorial' project for more help. | |
[<EntryPoint>] | |
let main argv = | |
let nickels (x:float) = x * 0.05; | |
let pennies (x:float) = x * 0.01; | |
let dimes (x:float) = x * 0.10; | |
let quarters (x:float) = x * 0.25; | |
let loonies (x:float) = x * 1.00; | |
let toonies (x:float) = x * 2.00; | |
let answer = dimes 170.0 + quarters 305.0 + pennies 105.0; | |
System.Console.WriteLine("5 Tonnies and 3 quarters and 100 dimes equals: "); | |
System.Console.Write(answer); | |
System.Console.Read(); | |
0 // return an integer exit code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment