Question 1/12: This code is valid Swift – true or false?
Hint: Click to show.
enum BuildingError: Error {
case tooHigh
case tooLow
}
func constructBuilding(floors: Int) throws {
if height < 10 {
throw BuildingError.tooLow
} else if height > 500 {
throw BuildingError.tooHigh
}
print("Perfect - let's get building!")
}
Link copied to your pasteboard.