Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialbecky hayes
2,226 PointsTrying to return a computed property that calculates fahrenheit using an input of celcius..think the error is in my sum
Think the error is in the celcius sum... as its not compiling. Or have i misunderstood the question?
class Temperature {
var celsius: Float = 0.0
var fahrenheit: Float {
return (celcius * 1.8 ) + 32))
}
}
2 Answers
Reed Carson
8,306 PointsYou misspelled celsius in the return statement. And you don't need parentheses, Swift will calculate in that order by default, but the challenges can be picky so it might need them, even though its correct without.
But yeh, celsius is misspelled.
Thats the nature of coding, you have to be super careful about tiny spelling mistakes, even a missing " or something, or a missing ) somewhere will utterly destroy your code and it can take hours to figure out you left off a / in the string of a URL request.
Keli'i Martin
8,227 PointsLooks like you've got your parentheses a little messed up. Try this:
return ((celsius * 1.8) + 32)
Hope this helps!
becky hayes
2,226 Pointsbecky hayes
2,226 PointsThanks Reed! Yes it's exercising my attention to detail skills! Many thanks Becks