# Checkpoint 1

Paul Hudson    @twostraws

Updated for Xcode 14.2

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:

1. Creates a constant holding any temperature in Celsius.
2. Converts it to Fahrenheit by multiplying by 9, dividing by 5, then adding 32.
3. Prints the result for the user, showing both the Celsius and Fahrenheit values.

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.

Still here? Okay, here are some hints:

1. Use `let` to make your constant. You can call it whatever you want, but I think `celsius` would be an appropriate name.
2. Celsius is commonly stored as a decimal, so make sure and create it as one. This might mean adding “.0” to the end – using 25.0 rather than 25, for example.
3. We use `*` for multiplication and `/` for division.
4. Use `\(someVariable)` to activate string interpolation.
5. If you want to get fancy with `print()`, you can use Option+Shift+8 to get the degrees symbol: °. This means you can write something like 25°F.

SPONSORED From March 20th to 26th, you can join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer!

Sponsor Hacking with Swift and reach the world's largest Swift community!