Updated for Xcode 13.3
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 Spend less time managing in-app purchase infrastructure so you can focus on building your app. RevenueCat gives everything you need to easily implement, manage, and analyze in-app purchases and subscriptions without managing servers or writing backend code.
Link copied to your pasteboard.