Skip to content

Instantly share code, notes, and snippets.

@salihyalcin
Forked from fozoglu/calculateNet.swift
Created January 30, 2017 12:22
Show Gist options
  • Save salihyalcin/f7516a8c11bc1489a71c67a6e47c6948 to your computer and use it in GitHub Desktop.
Save salihyalcin/f7516a8c11bc1489a71c67a6e47c6948 to your computer and use it in GitHub Desktop.
YGS - LYS için net hesabı
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)
deneme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment