-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Excercise05_01 (Show solution)
ext fun endDateGreaterThanStartDate(c: Course) : boolean {
if c.endDate.year - c.startDate.year > 0 then true
else if c.endDate.year - c.startDate.year < 0 then false
else if c.endDate.month - c.startDate.month > 0 then true
else if c.endDate.month - c.startDate.month > 0 then true
else if c.endDate.month - c.startDate.month < 0 then false
else if c.endDate.day - c.startDate.day >= 0 then true else false
}
the line "else if c.endDate.month - c.startDate.month > 0 then true" is duplicated.
Should month be replaced with day?
ext fun endDateGreaterThanStartDate(c: Course) : boolean {
if c.endDate.year - c.startDate.year > 0 then true
else if c.endDate.year - c.startDate.year < 0 then false
else if c.endDate.month - c.startDate.month > 0 then true
else if c.endDate.month - c.startDate.month < 0 then false
else if c.endDate.day - c.startDate.day >= 0 then true else false
}
Metadata
Metadata
Assignees
Labels
No labels