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 trialDomenico Mazzella Di Bosco
2,357 PointsI am lost.
I seriously do not know what this is asking me to do
struct Location {
let latitude: Double
let longitude: Double
}
class Business {
let name: String
let location: Location
init(name: String, location: Location) {
self.name = name
self.location = Location
}
}
let someBusiness = Business(name: "1pf", location: Location)
2 Answers
Steve Hunter
57,712 PointsHi there,
You're preetty much there!!
When you call the new object of Business
you want to create a new Location
in the constructor. So, after where you've typed Location
add a set of brackets and pass in a latitude: 1.23
and a longitude: 53.1
and your code is fine!
My numbers are just examples of type Double
.
I hope that helps,
Steve.
Domenico Mazzella Di Bosco
2,357 Pointsfinished it with this
html <p>This is code!</p>
struct Location {
let latitude: Double
let longitude: Double
}
class Business {
let name: String
let location: Location
init(name: String, location: Location) {
self.name = name
self.location = location
}
}
let someBusiness = Business(name: "domenic", location: Location(latitude:12.2,longitude: 12.4))
Steve Hunter
57,712 PointsLooks good!
Domenico Mazzella Di Bosco
2,357 PointsDomenico Mazzella Di Bosco
2,357 Pointsthat does help! thanks Steve
Steve Hunter
57,712 PointsSteve Hunter
57,712 Points