Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <iostream>
- #include <string>
- class Human {
- public:
- bool Alive;
- bool Happy;
- string Name;
- void kill(Human victim);
- void troll(Human victim);
- void email(Human recipient);
- }
- Human::Human(string n) {
- Alive = TRUE;
- Happy = TRUE;
- Name = n;
- }
- void Human::kill(Human victim) {
- if (victim.Alive == TRUE) {
- victim.Alive = FALSE;
- cout << Name << " killed " << victim.Name << endl;
- }
- else {
- cout << victim.Name << " is already dead!" << endl;
- }
- }
- void Human::troll(Human victim) {
- victim.Happy = FALSE;
- cout << Name << " trolled " << victim.Name << endl;
- }
- void Human::email(Human victim) {
- cout << Name << " emailed " << victim.Name << "." << endl;
- }
- int main() {
- Human Santi("Santi");
- Human Olivia("Olivia");
- Human SP("SP");
- Human Writer("Mr. Writer");
- Human Rachel("Rachel");
- Santi.email(Writer);
- SP.kill(Santi);
- Olivia.kill(Santi);
- Rachel.troll(SP);
- Rachel.troll(Olivia);
- }
Add Comment
Please, Sign In to add comment