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 Operators Working With Operators: Part 2

Yen Ho
seal-mask
.a{fill-rule:evenodd;}techdegree
Yen Ho
Full Stack JavaScript Techdegree Student 4,708 Points

HOW CAN I SOLVE THIS PROBLEM? IM DO NOT QUITE UNDERSTAND THE QUESTION

WHAT ARE STEPS TO SOLVE THIS ONE?

THANKS

operators2.swift
// Enter your code below

var initialScore = 8
Ben Masel
Ben Masel
2,004 Points

if you need my help again just ask me : )

1 Answer

Ben Masel
Ben Masel
2,004 Points

Hi there! Firstly there is a variable called initialScore that holds the value of 8, in the instructions it says to add a constant named totalScore which is supposed to equal initialScore + 1. Now the new operators that i am sure you have learned are ++ and --. so you have to create a constant called totalScore and make it equal initialScore + 1. The catch is they both have to equal the same amount so you need to use the ++ operator to increment initialScore by 1 and then put the initialScore's value back into the totalScore.Hope this helps : )