add chapter 4
This commit is contained in:
11
chapter4/const/dates/dates.go
Normal file
11
chapter4/const/dates/dates.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package dates
|
||||
|
||||
const DaysInWeek = 7
|
||||
|
||||
func WeeksToDays(weeks int) int {
|
||||
return weeks * DaysInWeek
|
||||
}
|
||||
|
||||
func DaysToWeek(days int) float64 {
|
||||
return float64(days) / float64(DaysInWeek)
|
||||
}
|
||||
Reference in New Issue
Block a user