MaXwEllDeN

Untitled

Jul 21st, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Human{
  6.       string name;
  7.       string nation;
  8.      
  9.       int age;
  10.      
  11.       public:
  12.              Human(string nam, string nati, int age);
  13.              string getName();
  14.              string getNation();
  15.              
  16. };
  17.  
  18. Human::Human(string nam, string nati, int ag)
  19. {
  20.       name = nam;
  21.       nation = nati;
  22.       age = ag;
  23.      
  24.       cout << name << " was born " << nation << ".\n";
  25. }
  26.  
  27. string Human::getName()
  28. {
  29.        return name;
  30. }
  31.  
  32. string Human::getNation()
  33. {
  34.        return nation;
  35. }
  36.  
  37. int main () {
  38.     Human maxwell("Maxwell", "brazilian", 15);
  39.  
  40.     cout << "\n";
  41.     system("PAUSE");
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment