Pure Programmer
Blue Matrix


Cluster Map

Project: Duration Class

Write a mutable class to represent a time duration. Your class should represent time durations in the following units: ns, µs, ms, s, min, hour, day, week, month, year. Use an enumeration to represent the time duration units. You should have a default constructor that sets the internal value to 0. Write a setter that takes a value and an enumeration value for units. Include a getter that takes an enumeration value for units and returns the value in that measurement unit.

Output
$ swiftc DurationClass.swift -I . -L . -lUtils error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution