Skip to content

Commit

Permalink
Update Person_Task1.h
Browse files Browse the repository at this point in the history
  • Loading branch information
saif86 authored Jan 5, 2019
1 parent bac8168 commit 123686c
Showing 1 changed file with 80 additions and 21 deletions.
101 changes: 80 additions & 21 deletions Person_Task1.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,82 @@
#ifndef Person_HEADER_Task1
#define Person_HEADER_Task1

#include <iostream>
using namespace std;

class Person {
char* Name;
int Age;
char Gender;
public:
Person(char* = NULL, int = 0, char = '\0');
Person(const Person&);
~Person();
Person& operator = (const Person&);

void eat();
void walk();
/** Person class to define persons in a C++ code.
*
* #include "Person_Task1.h" <BR>
* -llib
*
*/
#ifndef PERSON_TASK1_H
#define PERSON_TASK1_H

// SYSTEM INCLUDES
#include<iostream>


// Person class definition
class Person {
public:
// LIFECYCLE
/** Default + Overloaded constructor.
*/
Person(char* = NULL, int = 0, char = '/0', char* = NULL);

/** Copy constructor.
*/
Person(const Person&);

/** Destructor.
*/
~Person();

/** assignment operator.
*/
Person& operator =(const Person&);


const char * getName()const;
};

#endif
// OPERATIONS
/** function that depicts eating of Person.
*
* @param void
*
* @return void
*/
void Eat();

/** function that depicts walking of Person.
*
* @param void
*
* @return void
*/
void Walk();

// ACCESS
// setters
void SetName(char* = NULL);
void SetAge(int = 0);
void SetGender(char = '/0');
virtual void SetDesignation(char* = NULL) = 0;
void SetPerson(char* = NULL, int = 0, char = '/0');
/**
# @overload void SetPerson(const Person& aPerson);
*/
void SetPerson(const Person& aPerson);

// getters
char* GetName() const;
int GetAge() const;
char GetGender() const;
const Person& GetPerson()const;

// DATA MEMBERS
protected:
char* mDesignation;

private:
char* mName;
int mAge;
char mGender;
};
// end class Person
#endif
// _PERSON_TASK1_H_

0 comments on commit 123686c

Please sign in to comment.