Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "TinhCach.h"
- class TamLyNguoi {
- private:
- TraiNghiem* tn;
- TuChu* tc;
- HuongNgoai* hn;
- HoaDong* hd;
- BatOn* bo;
- public:
- TamLyNguoi() {
- tn = new TraiNghiem();
- tc = new TuChu();
- hn = new HuongNgoai();
- hd = new HoaDong();
- bo = new BatOn();
- }
- // Câu 1: Nhập thông tin đánh giá kết quả tâm lí 1 người
- void Nhap() {
- tn->Nhap();
- tc->Nhap();
- hn->Nhap();
- hd->Nhap();
- bo->Nhap();
- }
- void Xuat() {
- tn->XuatKetQua();
- tc->XuatKetQua();
- hn->XuatKetQua();
- hd->XuatKetQua();
- bo->XuatKetQua();
- }
- bool LuuY() {
- return tc->GetChiSo() <= 30 || bo->GetChiSo() >= 70;
- }
- };
- class DanhSachTamLyNguoi {
- private:
- TamLyNguoi** DSTL; // Danh sach tam lí
- int n;
- public:
- int GetSoLuong() { return n; }
- void Nhap() {
- cout << "Nhap so luong nguoi: ";
- cin >> n;
- DSTL = new TamLyNguoi * [n];
- for (int i = 0; i < n; i++) {
- cout << endl << "Nhap thong tinh nguoi thu " << i + 1 << endl;
- DSTL[i] = new TamLyNguoi();
- DSTL[i]->Nhap();
- }
- }
- void XuatKetQuaNguoi(int i) {
- DSTL[i]->Xuat();
- }
- void XuatDSNguoiLuuY() {
- cout << endl << "Danh sach so thu tu nhung nguoi nha tuyen dung can luu y: ";
- for (int i = 0; i < n; i++) {
- if (DSTL[i]->LuuY()) {
- cout << i + 1 << " ";
- }
- }
- cout << endl;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement