can someone explain can solve this problem in kotlin? Thank you very much
var weight = rweight.text.toString().toFloat() var hct = rhct.text.toString().toFloat() var EBV :Float var ABL :Float if (rman.isChecked){ EBV = weight * 75 } else if (rwoman.isChecked) { EBV = weight * 65 } ABL = EBV * (10)/hct //error in here "EBV must be initialize"
var EBV: Float = 0.0? I think both your if and else if are not true so EBV is null in that line.