Time.cpp - Time.cpp Class for managing time information...

This preview shows page 1 - 3 out of 3 pages.

// Time.cpp // // Class for managing time information // // Version 01 // 28/02/2019 Vu Thanh Long Started //------------------------------------------------------------------------------ --- //---------------------------------------------------------------------------- // Includes #include <iostream> #include "Time.h" //---------------------------------------------------------------------------- // Global variables/defines using namespace std; //---------------------------------------------------------------------------- // Prototypes //---------------------------------------------------------------------------- // Functions implementation // default constructor to set to default time Time::Time() { hour = 0; minute = 0; } //---------------------------------------------------------------------------- // scecond constuctor to set time by parameters Time::Time(int h, int m) { hour = h; minute = m; } //---------------------------------------------------------------------------- // set the value of hour void Time::setHour(int h) { hour = h; } //---------------------------------------------------------------------------- // set the value of minute void Time::setMinute(int m) { minute = m; } //---------------------------------------------------------------------------- // set the value of full time void Time::setFullTime(int h, int m) { hour = h; minute = m; } //----------------------------------------------------------------------------
// return the value of hour int Time::getHour() const { return hour; } //---------------------------------------------------------------------------- // return the value of minute int Time::getMinute() const { return minute; } //----------------------------------------------------------------------------

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture