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 trial

iOS Swift 2.0 Basics Swift Types Recap: Swift Types

Swift 2.0 Basic

Challenge Task 1 of 2

For this challenge, let's pretend we're building a calculator that outputs a string with the result of a math operation.

Start by declaring two constants, firstValue and secondValue and to both of them assign some integer values (whatever you want! don't go too crazy though).

// Enter your code below

let firstValue: "whatever you want! dont go too crazy though" let secondValue: "whatever you want! dont go too crazy though"

3 Answers

Challenge Task 1 of 2

For this challenge, let's pretend we're building a calculator that outputs a string with the result of a math operation.

Start by declaring two constants, firstValue and secondValue and to both of them assign some integer values (whatever you want! don't go too crazy though).

let firstValue = 314159
let secondValue = 3141592 
let product = firstValue * secondValue 
let output = "The product of (firstValue) times (secondValue) is (product)"

Challenge Task 1 of 2

For this challenge, let's pretend we're building a calculator that outputs a string with the result of a math operation.

Start by declaring two constants, firstValue and secondValue and to both of them assign some integer values. (Try and keep the values within a sensible range. Extremely high values will time out the challenge editor).

let firstValue = 123
let secondValue = 456
let product = firstValue * secondValue
let output = "The product of (firstValue) times (secondValue) is (product)"

that was amazing and great.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^