OOP HomeWork

This commit is contained in:
e2hang
2025-08-11 00:01:30 +08:00
commit e8a5ca2363
119 changed files with 3187 additions and 0 deletions

33
oop_hw4/hw4/man.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include <iostream>
#include "woman.h"
#include "man.h"
using std::string;
using std::cout;
using std::cin;
using std::endl;
man::man() {
name = "";
married = false;
w = NULL;
}
man::man(string n, bool m, woman* x) {
name = n;
married = m;
w = x;
}
void man::marry(woman* x) {
w = x;
married = true;
}
void man::devorce(woman* x) {
w = NULL;
married = false;
}
string man::display() {
return name;
}
woman* man::show() {
return w;
}