mirror of
https://github.com/bootdotdev/fcc-learn-golang-assets.git
synced 2025-12-18 19:21:17 +00:00
first
This commit is contained in:
13
course/5-interfaces/exercises/2-implements/readme.md
Normal file
13
course/5-interfaces/exercises/2-implements/readme.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Interface Implementation
|
||||
|
||||
Interfaces are implemented *implicitly*.
|
||||
|
||||
A type never declares that it implements a given interface. If an interface exists and a type has the proper methods defined, then the type automatically fulfills that interface.
|
||||
|
||||
## Assignment
|
||||
|
||||
At Textio we have full-time employees and contract employees. We have been tasked with making a more general `employee` interface so that dealing with different employee types is simpler.
|
||||
|
||||
Add the missing `getSalary` method to the `contractor` type so that it fulfills the `employee` interface.
|
||||
|
||||
A contractor's salary is their hourly pay multiplied by how many hours they work per year.
|
||||
Reference in New Issue
Block a user