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 trialBen Drago
Courses Plus Student 2,937 Points"Why Are Protocols Useful?" section missing Teacher's Notes
The video references a code snippet that should be in the Teacher's Note section.
The download with the solutions for this course appear to be outdated, and do not contain this code either.
8 Answers
Alexandru Stefanescu
2,195 PointsHope this helps:
import Foundation
enum EmployeeType {
case Manager
case NotManager
}
class Employee {
let name: String
let address: String
let startDate: NSDate
let type: EmployeeType
var department: String?
var reportsTo: String?
init(fullName: String, employeeAddress: String, employeeStartDate: NSDate, employeeType: EmployeeType) {
self.name = fullName
self.address = employeeAddress
self.startDate = employeeStartDate
self.type = employeeType
}
func pay() -> (basePay: Double, benefits: Double, deductions: Double, vacationTime: Int) {
return (0, 0, 0, 0)
}
}
func payEmployee (employee: Employee) {
let paycheck = employee.pay()
}
class HourlyEmployee: Employee {
var hourlyWage: Double = 15.00
var hoursWorked: Double = 0
let availableVacation = 0
override func pay() -> (basePay: Double, benefits: Double, deductions: Double, vacationTime: Int) {
return (hourlyWage * hoursWorked, 0, 0, availableVacation)
}
}
Matthew McCurdy
2,276 PointsThis was flagged a month ago and hasn't been corrected. What's going on, guys? Come on.
David Rynn
10,554 PointsPasan Premaratne put the code snippet in the next section (I'm assuming by accident).
JT Keller
12,731 Points+1 for making sure that any teacher's notes that are referenced in the video are provided.
Joel Grissom
5,166 PointsNow it's been 2 months since @David Rynn mentioned the code snippet issue. Please correct this.
David Hernandez
4,358 PointsIt's now been 4 months, I know it's not a big deal, but it would be helpful to correct this please.
Charlie O'Shea
18,737 Points6 months and counting. This means that every single person to take the Swift 2.0 track has now been faced with this unnecessary distraction at a point in the course where the complexity is stepping up.
Abraham Juliot
47,353 PointsEmail treehouse support or tweet the teacher directly. That's the best method to correct course errors.
Josh Patnode
5,916 PointsAnyone interested in starting a Slack group where we can complain about this and chat in real-time?
Misha Holtz
4,655 PointsMisha Holtz
4,655 PointsI second this post.