You already know enough to start writing your first useful code, albeit fairly simple: we’re going to convert temperatures from Celsius to Fahrenheit.
Your goal is to write a Swift playground that:
You already know everything you need to solve that problem, but if you’d like some hints then I’ll add some below.
Hacking with Swift+ subscribers can get a complete video solution for this checkpoint here: Solution to Checkpoint 1. If you don’t already subscribe, you can start a free trial today.
Note: I really do encourage you to try building this playground before reading any hints or trying my solution. I know it might seem simple, but the course does start to get harder soon and it’s important to be sure you’ve learned all the fundamentals.
Please go ahead and try building the playground now.
Still here? Okay, here are some hints:
letto make your constant. You can call it whatever you want, but I think
celsiuswould be an appropriate name.
*for multiplication and
\(someVariable)to activate string interpolation.
print(), you can use Option+Shift+8 to get the degrees symbol: °. This means you can write something like 25°F.
SPONSORED Join a FREE crash course for iOS devs who want to become complete senior developers — from October 18th to 24th. Learn how to apply iOS app architecture patterns through a series of lectures and practical coding sessions.
Link copied to your pasteboard.