CSC 175 - Intermediate Programming

Dr. R. M. Siegfried

Assignment #11 - Writing An Immutable Class For Time

Due Wednesday, February 26, 2024

An immutable class is a class that has no mutators, so there is no way to change private properties. The way in which these are written and are used is a little bit different.

You are going to write a class called Time that has three private properties:

Both minutes and seconds have the usual meaning.

Your class will have 4 constructors:

Additionally write the following methods:

Write another class containing a main program that creates a Time object, and returns the time 4 hours, 27 minutes and 15 seconds later.

[Back to the Assignment Index]