Skip to content

Instantly share code, notes, and snippets.

@TheEvilDev
Created May 25, 2014 00:27
Show Gist options
  • Save TheEvilDev/89f55865763a69367857 to your computer and use it in GitHub Desktop.
Save TheEvilDev/89f55865763a69367857 to your computer and use it in GitHub Desktop.
My 7 year old son Drake's first FSharp program $$$
// 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