Last active
January 30, 2017 13:53
-
-
Save fozoglu/68fee0928354b32d5c03284746ff1c1b to your computer and use it in GitHub Desktop.
YGS - LYS için net hesabı
This file contains hidden or 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
import UIKit | |
func calculateNet(correct:Int = 0 , wrong:Int = 0 , count:Int = 0) -> (Float) { | |
var result : Float = 0 | |
if (correct <= count && correct >= 0) && (wrong <= count && wrong >= 0) { | |
if (correct + wrong <= count){ | |
result = Float(correct) - Float(wrong)/4 | |
print("Net : \(result)") | |
} | |
} | |
return result | |
} | |
var test : Float = calculateNet(correct: 0, wrong: 10, count: 20) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Android versiyonu şu şekildedir :)