Posted by: prankster April 12, 2011
C++ Desperately need help!!!
Login in to Rate this Post:     0       ?        

Namaskarr!!

class NumDays
{
      int hours;
      
      1) create constructor with numHours as parameter and set it to hours
       2) create getter and setter for hours
       3) make method getDays() something like below
        public float getDays() {return hours/8;}
      4) overload operators + something like below
int::operator+(NumDays &rhs)
 {
      return this.hour + rhs.hour

 }

overload other operators similarly

 

 

 

Last edited: 12-Apr-11 04:33 PM

 

Last edited: 12-Apr-11 04:34 PM
Read Full Discussion Thread for this article