We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class BMI { typealias BMIValue = Double var userName: String var userWeight: BMIValue var userHeight: BMIValue var BMIResult: String { get { let bmiValue = (userWeight * userWeight)/ userHeight let bmiStatus = bmiValue < 18.5 ? "저체중" : "정상 이상" return "\(userName)님의 BMI 지수는 \(bmiValue)으로, \(bmiStatus)입니다." } set { userName = newValue } } init(userName: String, userWeight: Double, userHeight: Double){ self.userName = userName self.userWeight = userWeight self.userHeight = userHeight } } let bmi = BMI(userName: "JACK", userWeight: 50, userHeight: 160) bmi.BMIResult = "Minsu" // Minsu님의 BMI 지수는 15.625으로, 저체중입니다.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: