Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Human{
- string name;
- string nation;
- int age;
- public:
- Human(string nam, string nati, int age);
- string getName();
- string getNation();
- };
- Human::Human(string nam, string nati, int ag)
- {
- name = nam;
- nation = nati;
- age = ag;
- cout << name << " was born " << nation << ".\n";
- }
- string Human::getName()
- {
- return name;
- }
- string Human::getNation()
- {
- return nation;
- }
- int main () {
- Human maxwell("Maxwell", "brazilian", 15);
- cout << "\n";
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment