c 高階篇 c 實現員工管理系統

2021-10-13 13:13:25 字數 1928 閱讀 4621

用c++實現乙個員工管理系統,使該系統具備增、刪、改、查的基本功能,利用物件導向的程式設計思想實現。

主函式如下:

#include#include#include "manager.h"

using namespace std;

int main()

else if(input_num==1)

else if(input_num==2)

manager.show();

}else if(input_num == 3)

else

}else if(input_num == 4)

else

}else if(input_num == 5)

else

}else if(input_num == 6)

else

}return 0;

}

標頭檔案如下:

#include#includeusing namespace std;

class worker

;class manager

;

標頭檔案中成員函式的實現:

#include#include#include "manager.h"

using namespace std;

worker::worker(int id, string name, int score)

void worker::show()

else if(this->m_score>=90)

else

cout << "id:" << this->m_id

<< "\t姓名:" << this->m_name

<< "\t分數:" << this->m_score

<< "\t成績型別:" << rank

<< endl;

}manager::manager()

void manager::show_menu()

void manager::add()

}for(int i=0; i < add_num; i++)

cout << "成功新增了" << add_num << "個員工" << endl;

delete this->m_workerarray;

this->m_workernum = m_workernum_new;

this->m_workerarray = newspace;

}void manager::modify_worker(int id)

}cout << "請重新輸入員工的姓名:" << endl;

string name;

cin >> name;

cout << "請重新輸入員工的分數:" << endl;

int score;

cin >> score;

worker * worker = new worker(id, name, score);

this->m_workerarray[index] = worker;

}void manager::clear_system()

bool manager::is_exists(int id)

for(int i=0; im_workernum; i++)

}return false;

}void manager::move_worker(int id)

}for(int i=index; i < this->m_workernum-1; i++)

this->m_workernum--;

}void manager::find_worker(int id)

}}void manager::show()

}

記錄:供c++入門的小白學習。

C 實現管理系統

inkmacsystemfont,helvetica neue pingfang sc hiragino sans gb microsoft yahei arial font size 12px white space normal background color rgb 255,255,255 ...

C 陣列高階篇

陣列高階知識適合收藏 在陣列基礎知識上進一步提公升和鞏固 前提是 每行中的列數要相等 下面用 舉例說明 int row 2,colums 3 int nums 一維陣列 for int i 0 i row i cout endl 要給定陣列的行數 列數,可以只給定二維陣列列數 不給定行數 不能只給定...

員工管理系統實現批量刪除

empno,empname,job,mgr,hiredate,sal,comm,emp.deptno,deptname delete from emp where empno in empdao int deletebyids param dnos integer dnos 頁面 批量刪除 empa...