[swift-users] Swift BMI

Gage Morgan gagemorgan at outlook.com
Mon Dec 14 23:49:50 CST 2015


And a more polished version:https://gist.github.com/MGageMorgan/c2166174be878e9cea78

Sent from Outlook Mobile




On Mon, Dec 14, 2015 at 7:20 PM -0800, "Gage Morgan via swift-users" <swift-users at swift.org> wrote:





For most languages I try out, my own version of "Hello World!" is a BMI calculator. Swift has passed, I encourage you to try it out.
There are two methods called towards the end of file:1) bmi.pounds(weight, height) - Replace numbers inside with your own if you want to test out in US Customary units.
2) bmi.kilograms(weight, height) - Replace numbers inside with your own if you want to test out in Metric units used everywhere outside the US.
You already get the gist, the bits can be found here:https://gist.github.com/anonymous/9284017644567c29c7f8
If there's a bug please let me know, but it works in IBM's Sandbox. (Yes, ALL code was written by me without help. Very close to C, just a bit laid back.)
--MGage--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151215/0f26987d/attachment.html>
-------------- next part --------------
_______________________________________________
swift-users mailing list
swift-users at swift.org
https://lists.swift.org/mailman/listinfo/swift-users


More information about the swift-users mailing list