1
1
Fork 0
AtomicKotlinCourse/Usability/Named & Default Arguments/Exercise 2/task.md

427 B

Named & Default Arguments (#2)

Define a class SimpleTime that stores the time elapsed from the beginning of the day. SimpleTime's constructor takes four parameters: hours, minutes, seconds and nanoseconds. Each parameter has a default value of zero.

Implement two member functions, toSecondOfDay() and toNanoOfDay(), that return the number of seconds or nanoseconds elapsed since the beginning of the day.