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 trialJosh Smith
1,049 PointsWhere is this wrong?
I think this is very close to right? But i'm not sure where I'm wrong though?
struct Expense {
var description: String
var amount: Double
}
var travel = Expense(description: "Flight to Cupertino", amount: "500.00")
travel.Description
travel.Amount
1 Answer
Neil Docherty
10,418 PointsThe amount variable is set as a double, you therefore don't need the quotation marks.
struct Expense {
var description: String
var amount: Double
}
var travel = Expense(description: "Flight to Cupertino", amount: 500.00)
Josh Smith
1,049 PointsJosh Smith
1,049 PointsDamn it.. so close. Thnks Neil :)
Neil Docherty
10,418 PointsNeil Docherty
10,418 PointsNo worries. Took me a good bit of staring at to realise.
Remember - use the Code Challenge preview when you get something wrong as it give you an idea of where to look at for the problem.
Josh Smith
1,049 PointsJosh Smith
1,049 PointsHey Neil - yeah I usually do click on the preview button but I kind of find it doesn't really help me that much. I'm still really green to iOS dev stumbling my way through lol!