OOP HomeWork
This commit is contained in:
32
oop_hw4/hw123/walker.cpp
Normal file
32
oop_hw4/hw123/walker.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <iostream>
|
||||
#include "thief.h"
|
||||
#include "walker.h"
|
||||
#include "police.h"
|
||||
|
||||
|
||||
using std::string;
|
||||
using std::cout;
|
||||
using std::cin;
|
||||
using std::endl;
|
||||
|
||||
walker::walker() {
|
||||
name = "";
|
||||
money = -1;
|
||||
stolen = false;
|
||||
}
|
||||
walker::walker(string n, double m, bool c = false) {
|
||||
name = n;
|
||||
money = m;
|
||||
stolen = c;
|
||||
}
|
||||
double walker::money_print() {
|
||||
return money;
|
||||
}
|
||||
walker& walker::zero() {
|
||||
money = 0;
|
||||
stolen = true;
|
||||
return *this;
|
||||
}
|
||||
void walker::display() {
|
||||
cout << name << " " << money << " " << "If stolen :" << stolen << endl;
|
||||
}
|
Reference in New Issue
Block a user