Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Example of CONSTRUCTOR and DESTRUCTOR in derived class ? ? ? Pin
CPallini10-Jun-12 21:06
mveCPallini10-Jun-12 21:06 
AnswerRe: Example of CONSTRUCTOR and DESTRUCTOR in derived class ? ? ? Pin
Eytukan11-Jun-12 4:42
Eytukan11-Jun-12 4:42 
AnswerRe: Example of CONSTRUCTOR and DESTRUCTOR in derived class ? ? ? Pin
Eytukan11-Jun-12 4:44
Eytukan11-Jun-12 4:44 
AnswerRe: Example of CONSTRUCTOR and DESTRUCTOR in derived class ? ? ? Pin
jschell11-Jun-12 8:02
jschell11-Jun-12 8:02 
QuestionData Encapsulation Pin
pix_programmer8-Jun-12 21:12
pix_programmer8-Jun-12 21:12 
AnswerRe: Data Encapsulation Pin
Richard MacCutchan8-Jun-12 22:07
mveRichard MacCutchan8-Jun-12 22:07 
AnswerRe: Data Encapsulation Pin
Aescleal9-Jun-12 9:40
Aescleal9-Jun-12 9:40 
QuestionMy assignment aggregation, composition and inheritance Pin
David96378-Jun-12 19:23
David96378-Jun-12 19:23 
Please help me solve it ..... urgent....
4 header files that serve as the class
specification file to implement the aggregation, composition and inheritance concept
for the Employee, Name, Addres and ShiftSupervisor.
employee
- number : string
- hireDate : string
+ Employee() :
+ Employee(string, string, string)
+ setName(string) : void
+ setNumber(string) : void
+ setHireDate(string) : void
+ getName() : string
+ getNumber() : string
+ getHireDate() : string

Name
- firstName : string
- lastName : string
+ setFirstName(string) : void
+ setLastName(string) : void
+ getFullName() :

Address
- street : string
- city : string
- state : string
- postcode : string
- country : string
+ setStreet(string) : void
+ setCity(string) : void
+ setState(string) : void
+ setPostcode(string) : void
+ setCountry(string) : void
+ getFullAddress() :

Shift
- salary : int
- bonus : double
+ ShiftSupervisor() :
+ ShiftSupervisor(string, string,
string, double, double) :
+ setSalary(double) : void
+ setBonus(dlouble) : void
+ getSalary() : double
+ getBonus() : double

i stuck until here

#ifndef NAME_H
#define NAME_H
#include<string>
using namespace std;


class Name
{
      
      private:
              string FirstName;
              string LastName;
              
      public:
             Name();
             Name(string FN, string LN);
                 
           
             void setFirstName(const string FN) { FirstName = FN; }
              string getFirstName() { return FirstName; }
     	      void setLastName(const string LN) { LastName = LN; }
              string getLastName() { return LastName; }
           	  void setFullName(const string FN, const string LN);
       	      string getFullName(){return FirstName,LastName;}
             };
#endif

C++
#ifndef ADDRESS_H
#define ADDRESS_H
#include<string>
using namespace std;



class Address
{
      private:
              string Street;
              string City;
              string State;
              string Postcode;
              string Country;
      public:
             Address();
             Address(String str,string ct,string st,string pc,string ctry);
             
             void setStreet(const string str) { Street = str; }
              string getStreet() { return Street; }
     	      
               void setCity(const string ct) { City = ct; }
              string getCity() { return City; }
             
              void setState(const string st) { Statet = st; }
              string getState() { return State; }
     	     
               void setPostcode(const string pc) { City = pc; }
              string getPostcode() { return Postcode; }
            
              void setCountry(const string ctry) { Country = ctry; }
              string getCountry() { return Country; }
     	    
              
           	  void setFullAdress(const string str, const string ct, const string st,const string pc
              const string ctry);
           	  string getFullAddress(){return Street, City, State, Postcode, Country}; 
           
             };
#endif

C++
#ifndef SHIFT_H
#define SHIFT_H
#include<cstring>
using namespace std;


class ShiftSupervisor
{
      
      private:
              double salary;
              double bonus;
      public:
           ShiftSupervisor()
           { salary=0;
              bonus=0;
           }
           ShiftSupervisor(char ,char ,char  ,double salary,double bonus);
           
           void setSalary(double);
           void setBOnus(double);
           double getSalary();
           double getBonus();
             };
#endif

C++
#ifndef EMPLOYEE_H
#define EMPLOYEE_H
#include<string>
#include"Name.h"
#include"Address.h"
#include"Shift.h"
using namespace std;


           
#endif

AnswerRe: My assignment aggregation, composition and inheritance Pin
Richard MacCutchan8-Jun-12 22:02
mveRichard MacCutchan8-Jun-12 22:02 
GeneralRe: My assignment aggregation, composition and inheritance Pin
David96379-Jun-12 0:13
David96379-Jun-12 0:13 
GeneralRe: My assignment aggregation, composition and inheritance Pin
Richard MacCutchan9-Jun-12 0:20
mveRichard MacCutchan9-Jun-12 0:20 
AnswerRe: My assignment aggregation, composition and inheritance Pin
Aescleal9-Jun-12 10:09
Aescleal9-Jun-12 10:09 
QuestionBuild error with Visual C++ 2010 Pin
Falconapollo8-Jun-12 17:10
Falconapollo8-Jun-12 17:10 
AnswerRe: Build error with Visual C++ 2010 Pin
Richard MacCutchan8-Jun-12 22:53
mveRichard MacCutchan8-Jun-12 22:53 
GeneralRe: Build error with Visual C++ 2010 Pin
Falconapollo8-Jun-12 23:05
Falconapollo8-Jun-12 23:05 
GeneralRe: Build error with Visual C++ 2010 Pin
Richard MacCutchan8-Jun-12 23:29
mveRichard MacCutchan8-Jun-12 23:29 
GeneralRe: Build error with Visual C++ 2010 Pin
Falconapollo8-Jun-12 23:35
Falconapollo8-Jun-12 23:35 
AnswerRe: Build error with Visual C++ 2010 Pin
Stephen Hewitt10-Jun-12 1:17
Stephen Hewitt10-Jun-12 1:17 
QuestionIf CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
ForNow8-Jun-12 2:31
ForNow8-Jun-12 2:31 
AnswerRe: If CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
«_Superman_»8-Jun-12 2:46
professional«_Superman_»8-Jun-12 2:46 
GeneralRe: If CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
ForNow8-Jun-12 10:52
ForNow8-Jun-12 10:52 
GeneralRe: If CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
«_Superman_»8-Jun-12 16:11
professional«_Superman_»8-Jun-12 16:11 
AnswerRe: If CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
Albert Holguin8-Jun-12 4:33
professionalAlbert Holguin8-Jun-12 4:33 
QuestionCorruption of the heap. Why ? Pin
sdancer757-Jun-12 23:49
sdancer757-Jun-12 23:49 
AnswerRe: Corruption of the heap. Why ? Pin
Rolf Kristensen8-Jun-12 2:01
Rolf Kristensen8-Jun-12 2:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.