I have an assignment where I really have no idea how to even begin. It is as follows:

•Create a destructor that prints a message before exiting.
•Create a new function called

void incrementMinutes( Time &, const int );

That increments the minutes by count.
• create a member function that increments the minutes by 1

I'm very new to this stuff, but from what I have learned (apparently) I'm assuming I need a constructor and that the beginning needs to be:

#include <iostream>

using namespace std;

class incrementMinutes


Assuming this is where I need to begin at least with a constructor function but I do not even really know what to incorporate into this code, any advice at all would be greatly appreciated

6 Years
Discussion Span
Last Post by VernonDozier

I think you have mis-understood the assignment. Read it again, it doesn't want you to create a class named incrementMinutes but that is jusst the name of one of the class's methods. The name of the class is probably Time.

I think you should post the exact wording of the assignment so that we are all on the same page. But be careful -- many instructors don't want you to post assignments here. So make sure it's ok before posting.


Your class wouldn't be called incrementMinutes. It would be called Time or something similar. Presumably it would have hours, minutes, and seconds as its data members, and it would have a METHOD called incrementMinutes.

class Time
        int hour;
        int minute;
        int second;

        Time(int hr, int min, int sec)
            hour = hr;
            minute = min;
            second = sec;

    // more functions here
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.