基于多态的职工管理系统(C++)

项目需求

职工管理系统可以用来管理公司内所有员工的信息

公司中职工分为三类:普通员工、经理、老板,显示信息时,需要显示职工编号、职工姓名、职工岗位、以及职责

  • 普通员工职责:完成经理交给的任务

  • 经理职责:完成老板交给的任务,并下发任务给员工

  • 老板职责:管理公司所有事务

管理系统中需要实现的功能如下:

  • 退出管理程序:退出当前管理系统
  • 增加职工信息:实现批量添加职工功能,将信息录入到文件中,职工信息为:职工编号、姓名、部门编号
  • 显示职工信息:显示公司内部所有职工的信息
  • 删除离职职工:按照编号删除指定的职工
  • 修改职工信息:按照编号修改职工个人信息
  • 查找职工信息:按照职工的编号或者职工的姓名进行查找相关的人员信息
  • 按照编号排序:按照职工编号,进行排序,排序规则由用户指定
  • 清空所有文档:清空文件中记录的所有职工信息 (清空前需要再次确认,防止误删)

分析设计

1.创建管理类

​ 管理类负责的内容如下:(app.c/app.h)

  • 与用户的沟通菜单界面
  • 对职工增删改查的操作
  • 与文件的读写交互

2.创建职工类

职工的分类为:普通员工、经理、老板(employ、manager、boss)

将三种职工抽象到一个类(worker)中,利用多态管理不同职工种类

职工的属性为:职工编号、职工姓名、职工所在部门编号

职工的行为为:岗位职责信息描述,获取岗位名称

3.执行文件

创建管理类的对象,调用里面的方法实现需求

4.注意事项

防止cin输入的数据类型不对导致代码崩溃

cout << “请输入您的选择:” << endl;
cin >> n;

//防止输入错误数据类型,导致死循环

int flag = 0;
while (cin.fail()) {
if (flag == 0)
cout << “请输入正确的数据类型” << endl;
cin.clear();
cin.ignore();
cin >> n;
flag++;
}

源码

职工管理系统.cpp

#include <iostream>
#include "app.h"using namespace std;int main() {app app;int n;while (true) {app.showMenu();cout << "请输入您的选择:" << endl;cin >> n;//防止输入错误数据类型,导致死循环int flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> n;flag++;}switch (n) {case 0: //退出系统app.exitSystem();break;case 1: //添加职工app.addWorker();break;case 2: //显示职工app.showWorker();break;case 3: //删除职工app.delWorker();break;case 4: //修改职工app.changeWorker();break;case 5: //查找职工app.findWorker();break;case 6: //排序职工app.sortWorker();break;case 7: //清空文件app.clearFile();break;default:system("cls");break;}}return 0;
}

app.cpp

#include "app.h"app::app()
{ifstream ifs(FILENAME, ios::in);//判断文件是否存在if (!ifs.is_open()) {cout << "文件不存在" << endl;this->workerNum = 0;this->workerArray = NULL;this->isEmpty = true;ifs.close();return;}//存在,是否为空char ch;ifs >> ch;if (ifs.eof()) {cout << "文件为空" << endl;this->workerNum = 0;this->workerArray = NULL;this->isEmpty = true;ifs.close();return;}//存在,且不为空int num = this->getFilewWorkerNum();this->workerNum = num;//测试代码//cout << "职工人数为:" << num << endl;this->workerArray = new worker * [this->workerNum];//开辟空间this->initWorker();//将文件中的数据,存到数组中//测试代码//for (int i = 0; i < workerNum; i++)//{//	cout << "职工号: " << this->workerArray[i]->getId()//		<< " 职工姓名: " << this->workerArray[i]->getName()//		<< " 部门: " << this->workerArray[i]->getDeptName() << endl;//}}app::~app()
{}/*
* @brief 显示菜单
* @param 无
* @return 无
*/
void app::showMenu() {cout << "********************************************" << endl;cout << "*********  欢迎使用职工管理系统! **********" << endl;cout << "*************  0.退出管理程序  *************" << endl;cout << "*************  1.增加职工信息  *************" << endl;cout << "*************  2.显示职工信息  *************" << endl;cout << "*************  3.删除离职职工  *************" << endl;cout << "*************  4.修改职工信息  *************" << endl;cout << "*************  5.查找职工信息  *************" << endl;cout << "*************  6.按照编号排序  *************" << endl;cout << "*************  7.清空所有文档  *************" << endl;cout << "********************************************" << endl;cout << endl;
}/*
* @brief 退出系统
* @param 无
* @return 无
*/
void app::exitSystem() {cout << "欢迎下次使用" << endl;system("pause");exit(0);
}/*
* @brief 添加职工
* @param 无
* @return 无
*/
void app::addWorker() {int addNum = 0;//添加职工数量cout << "请输入要添加的职工数量:" << endl;cin >> addNum;//防止输入错误数据类型,导致死循环int flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> addNum;flag++;}if (addNum > 0) {int newSize = this->workerNum + addNum;//计算新空间大小worker** newSpace = new worker * [newSize];//开辟新空间//将原空间下数据存放到新空间下if (this->workerArray != NULL) {for (int i = 0; i < this->workerNum; i++) {newSpace[i] = this->workerArray[i];}}//添加新数据for (int i = 0; i < addNum; i++) {int id;string name;int deptId;cout << "请输入第" << i + 1 << "个新职工编号:" << endl;cin >> id;//防止输入错误数据类型,导致死循环flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> id;flag++;}cout << "请输入第" << i + 1 << "个新职工姓名:" << endl;cin >> name;cout << "请选择该职工的岗位:" << endl;cout << "1、普通职工" << endl;cout << "2、经理" << endl;cout << "3、老板" << endl;worker* worker = NULL;//死循环,防止输入错误信息while (true) {cin >> deptId;//防止输入错误数据类型,导致死循环int flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> deptId;flag++;}switch (deptId){case 1://员工worker = new employee(id, name, deptId);break;case 2://经理worker = new manager(id, name, deptId);break;case 3://老板worker = new boss(id, name, deptId);break;default:cout << "输入有误,请重新输入" << endl;continue;}break;}//将创建的职工指针存放到数组中//该方法会提示缓冲区溢出,不过不影响程序执行,可以换成下面的语句解决//newSpace[this->workerNum + i] = worker;*(newSpace + this->workerNum + i) = worker;}delete[] this->workerArray;//释放原有空间this->workerArray = newSpace;//更改新空间的指向this->workerNum = newSize;//更新新的职工人数this->isEmpty = false;//更新文件状态cout << "成功添加" << addNum << "名新职工!" << endl;//提示信息this->saveFile();//保存数据到文件中}else {cout << "输入数据有误!" << endl;}system("pause");system("cls");
}/*
* @brief 保存文件
* @param 无
* @return 无
*/
void app::saveFile() {ofstream ofs(FILENAME, ios::out);//创建输出流对象//将每个人的数据写入到文件中for (int i = 0; i < this->workerNum; i++) {ofs << this->workerArray[i]->getId() << " "<< this->workerArray[i]->getName() << " "<< this->workerArray[i]->getDeptId() << endl;}ofs.close();//关闭文件
}/*
* @brief 获取文件中的职工人数
* @param 无
* @return 文件中的职工人数
*/
int app::getFilewWorkerNum() {ifstream ifs(FILENAME, ios::in);//创建输入流对象int id;string name;int deptId;int num = 0;//统计人数while (ifs >> id && ifs >> name && ifs >> deptId) {num++;}ifs.close();//关闭文件return num;
}/*
* @brief 初始化职工
* @param 无
* @return 无
*/
void app::initWorker() {ifstream ifs(FILENAME, ios::in);//创建输入流对象int id;string name;int deptId;int index = 0;while (ifs >> id && ifs >> name && ifs >> deptId) {worker* worker = NULL;if (deptId == 1) {//普通员工worker = new employee(id, name, deptId);}else if (deptId == 2) {//经理worker = new manager(id, name, deptId);}else {//老板worker = new boss(id, name, deptId);}this->workerArray[index] = worker;index++;}ifs.close();
}/*
* @brief 显示职工
* @param 无
* @return 无
*/
void app::showWorker() {if (this->isEmpty) {cout << "文件不存在或记录为空!" << endl;}else {for (int i = 0; i < this->workerNum; i++) {this->workerArray[i]->showInfo();}}system("pause");system("cls");
}/*
* @brief 删除职工
* @param 无
* @return 无
*/
void app::delWorker() {if (this->isEmpty) {cout << "文件不存在或记录为空!" << endl;}else {cout << "请输入要删除的职工编号:" << endl;int id;cin >> id;//防止输入错误数据类型,导致死循环int flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> id;flag++;}//查找职工是否存在int index = this->checkWorkerExist(id);if (index != -1) {for (int i = index; i < this->workerNum - 1; i++) {//数据前移this->workerArray[i] = this->workerArray[i + 1];}this->workerNum--;//更新数组中记录人员个数this->saveFile();//更新文件中的人员信息cout << "删除成功!" << endl;}else {cout << "删除失败,未找到该职工!" << endl;}}system("pause");system("cls");
}/*
* @brief 检测职工是否存在
* @param 职工编号
* @return 职工所在数组中的位置,不存在返回-1
*/
int app::checkWorkerExist(int id) {int index = -1;for (int i = 0; i < this->workerNum; i++) {if (this->workerArray[i]->getId() == id) {index = i;break;}}return index;
}/*
* @brief 修改职工
* @param 无
* @return 无
*/
void app::changeWorker() {if (this->isEmpty) {cout << "文件不存在或记录为空!" << endl;}else {cout << "请输入要修改的职工编号:" << endl;int id;cin >> id;//防止输入错误数据类型,导致死循环int flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> id;flag++;}//查找职工是否存在int index = this->checkWorkerExist(id);if (index == -1) {cout << "修改失败,查无此人" << endl;}else {delete this->workerArray[index];//删除原有职工int newId = 0;string newName = "";int newDeptId = 0;cout << "查到:" << id << "号职工" << endl;cout << "请输入新的职工号:" << endl;cin >> newId;//防止输入错误数据类型,导致死循环flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> newId;flag++;}cout << "请输入新的姓名:" << endl;cin >> newName;cout << "请输入新的部门:" << endl;cout << "1、普通员工" << endl;cout << "2、经理" << endl;cout << "3、老板" << endl;worker* worker = NULL;//死循环,防止输入错误信息while (true) {cin >> newDeptId;//防止输入错误数据类型,导致死循环flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> newDeptId;flag++;}switch (newDeptId){case 1://员工worker = new employee(newId, newName, newDeptId);break;case 2://经理worker = new manager(newId, newName, newDeptId);break;case 3://老板worker = new boss(newId, newName, newDeptId);break;default:cout << "输入有误,请重新输入" << endl;continue;}break;}this->workerArray[index] = worker;//保存新的职工信息cout << "修改成功!" << endl;this->saveFile();//更新文件中的职工信息}}system("pause");system("cls");
}/*
* @brief 查找职工
* @param 无
* @return 无
*/
void app::findWorker() {if (this->isEmpty) {cout << "文件不存在或记录为空!" << endl;}else {cout << "请输入查找的方式:" << endl;cout << "1、按职工编号查找" << endl;cout << "2、按姓名查找" << endl;int select = 0;while (true) {cin >> select;//防止输入错误数据类型,导致死循环int flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> select;flag++;}if (select == 1) {//按职工编号查找cout << "请输入要查找的职工编号:" << endl;int id;cin >> id;//防止输入错误数据类型,导致死循环flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> id;flag++;}int index = this->checkWorkerExist(id);if (index != -1) {cout << "查找成功!该职工信息如下:" << endl;this->workerArray[index]->showInfo();}else {cout << "查无此人!" << endl;}break;}else if (select == 2) {//按姓名查找cout << "请输入要查找的姓名:" << endl;string name;cin >> name;bool flag = false;//标志是否查到for (int i = 0; i < this->workerNum; i++) {if (this->workerArray[i]->getName() == name) {cout << "查找成功!该职工信息如下:" << endl;this->workerArray[i]->showInfo();flag = true;}}if (flag == false) {cout << "查无此人!" << endl;}break;}else {cout << "输入有误,请重新输入" << endl;continue;}}}system("pause");system("cls");
}/*
* @brief 排序职工
* @param 无
* @return 无
*/
void app::sortWorker() {if (this->isEmpty) {cout << "文件不存在或记录为空!" << endl;}else {cout << "请选择排序方式:" << endl;cout << "1、按职工号进行升序" << endl;cout << "2、按职工号进行降序" << endl;int select = 0;while (true) {cin >> select;//防止输入错误数据类型,导致死循环int flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> select;flag++;}//升序排序if (select == 1) {for (int i = 0; i < this->workerNum; i++) {int min = i;for (int j = i + 1; j < this->workerNum; j++) {//找到最小值if (this->workerArray[min]->getId() > this->workerArray[j]->getId()) {min = j;}}if (min != i) {//交换位置worker* temp = this->workerArray[min];this->workerArray[min] = this->workerArray[i];this->workerArray[i] = temp;}}cout << "排序成功!" << endl;this->saveFile();//更新文件中的职工信息this->showWorker();//显示排序后的职工信息break;}//降序排序else if (select == 2) {for (int i = 0; i < this->workerNum; i++) {int max = i;for (int j = i + 1; j < this->workerNum; j++) {//找到最大值if (this->workerArray[max]->getId() < this->workerArray[j]->getId()) {max = j;}}if (max != i) {//交换位置worker* temp = this->workerArray[max];this->workerArray[max] = this->workerArray[i];this->workerArray[i] = temp;}}cout << "排序成功!" << endl;this->saveFile();//更新文件中的职工信息this->showWorker();//显示排序后的职工信息break;}else {cout << "输入有误,请重新输入" << endl;continue;}}}system("pause");system("cls");}/*
* @brief 清空文件
* @param 无
* @return 无
*/
void app::clearFile() {cout << "确认清空?" << endl;cout << "1、确认" << endl;cout << "2、返回" << endl;int select = 0;while (true) {cin >> select;//防止输入错误数据类型,导致死循环int flag = 0;while (cin.fail()) {if (flag == 0)cout << "请输入正确的数据类型" << endl;cin.clear();cin.ignore();cin >> select;flag++;}if (select == 1) {ofstream ofs(FILENAME, ios::trunc);//删除文件中的内容ofs.close();//删除堆区中的数据if (this->workerArray != NULL) {for (int i = 0; i < this->workerNum; i++) {if (this->workerArray[i] != NULL) {delete this->workerArray[i];}}this->workerNum = 0;delete[] this->workerArray;this->workerArray = NULL;this->isEmpty = true;}cout << "清空成功!" << endl;break;}else if (select == 2) {break;}else {cout << "输入有误,请重新输入" << endl;continue;}}system("pause");system("cls");
}

app.h

#pragma once
#include <iostream>
#include <string>
#include <fstream>
#include "worker.h"
#include "employee.h"
#include "manager.h"
#include "boss.h"#define FILENAME "workerFile.txt"using namespace std;class app
{
public:int workerNum;//职工人数worker** workerArray;//职工数组bool isEmpty;//标志文件是否为空app();~app();void showMenu();//显示菜单void exitSystem();//退出系统void addWorker();//添加职工void saveFile();//保存文件int getFilewWorkerNum();//获取文件中的人数void initWorker();//初始化职工void showWorker();//显示职工void delWorker();//删除职工int checkWorkerExist(int id);//检测职工是否存在void changeWorker();//修改职工void findWorker();//查找职工void sortWorker();//排序职工void clearFile();//清空文件};

worker.cpp

#include "worker.h"void worker::setId(int id) {this->id = id;
}int worker::getId() {return this->id;
}void worker::setName(string name) {this->name = name;
}string worker::getName() {return this->name;
}void worker::setDeptId(int deptId) {this->deptId = deptId;
}int worker::getDeptId() {return this->deptId;
}

worker.h

#pragma once
#include <iostream>
using namespace std;class worker
{
private:int id; //职工编号string name; //职工姓名int deptId; //职工所在部门名称编号public://构造函数void setId(int id);int getId();void setName(string name);string getName();void setDeptId(int deptId);int getDeptId();virtual void showInfo() = 0; //显示个人信息virtual string getDeptName() = 0; //获取岗位名称
};

employ.cpp

#include "employee.h"employee::employee(int id, string name, int deptId) {this->setId(id);this->setName(name);this->setDeptId(deptId);
}string employee::getDeptName() {return string("员工");
}void employee::showInfo() {cout << "职工编号:" << this->getId()<< "\t职工姓名:" << this->getName()<< "\t岗位:" << this->getDeptName()<< "\t岗位职责:完成经理交给的任务" << endl;
}

employ.h

#pragma once
#include "worker.h"
class employee : public worker
{
public://构造函数,初始化信息employee(int id, string name, int deptId);//显示个人信息void showInfo();//获取岗位名称string getDeptName();
};

manager.cpp

#include "manager.h"manager::manager(int id, string name, int deptId) {this->setId(id);this->setName(name);this->setDeptId(deptId);
}string manager::getDeptName() {return string("经理");
}void manager::showInfo() {cout << "职工编号:" << this->getId()<< "\t职工姓名:" << this->getName()<< "\t岗位:" << this->getDeptName()<< "\t岗位职责:完成老板交给的任务,并下发任务给员工" << endl;
}

manager.h

#pragma once
#include "worker.h"
class manager : public worker
{
public:manager(int id, string name, int deptId);void showInfo();string getDeptName();
};

boss.cpp

#include "boss.h"boss::boss(int id, string name, int deptId) {this->setId(id);this->setName(name);this->setDeptId(deptId);
}string boss::getDeptName() {return string("老板");
}void boss::showInfo() {cout << "职工编号:" << this->getId()<< "\t职工姓名:" << this->getName()<< "\t岗位:" << this->getDeptName()<< "\t岗位职责:公司管理" << endl;
}

boss.h

#pragma once
#include "worker.h"class boss : public worker
{
public:boss(int id, string name, int deptId);void showInfo();string getDeptName();
};

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/13156.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Oracle 迁移 Hive 过程中遇到的问题总结

前言 最近一个小伙伴在做从 Oracle 到 Hive 的业务迁移工作,在迁移过程中属实遇到了一些坑,今天就来汇总一下这些坑,避免以后大家其他业务迁移的时候再出现类似的问题,即使出现了也可以拿过来进行对照解决。 问题1:Distinct window functions are not supported: count(…

图文教程:使用 Photoshop、3ds Max 和 After Effects 创建被风暴摧毁的小屋

推荐&#xff1a; NSDT场景编辑器助你快速搭建可二次开发的3D应用场景 1. 在 Photoshop 中设置图像 步骤 1 打开 Photoshop。 打开 Photoshop 步骤 2 我已经将小屋的图像导入到Photoshop中以演示 影响。如果您愿意&#xff0c;可以使用其他图像。 图片导入 步骤 3 由于小…

P5725 【深基4.习8】求三角形

题目描述 模仿例题&#xff0c;打印出不同方向的正方形&#xff0c;然后打印三角形矩阵。中间有个空行。 输入格式 输入矩阵的规模&#xff0c;不超过 9 9 9。 输出格式 输出矩形和正方形 1.题目分析 循环判断就可以解决&#xff0c;总的来说&#xff0c;是个比较简单的…

解决 tensorflow 出现的 ImportError: Could not find the DLL(s) ‘msvcp140_1.dll‘. 问题

在安装完tensorflow库后出现 问题详述&#xff1a; ImportError: Could not find the DLL(s) msvcp140_1.dll. TensorFlow requires that these DLLs be installed in a directory that is named in your %PATH% environment variable. You may install these DLLs by downlo…

自然语言处理从入门到应用——LangChain:模型(Models)-[聊天模型(Chat Models):基础知识]

分类目录&#xff1a;《自然语言处理从入门到应用》总目录 聊天模型是语言模型的一种变体。虽然聊天模型在内部使用语言模型&#xff0c;但它们公开的接口略有不同。它们不是提供一个“输入文本&#xff0c;输出文本”的API&#xff0c;而是提供一个以“聊天消息”作为输入和输…

深入浅出指南:Netty开发【NIO核心组件】

目录 ​Netty开发【NIO核心组件】 1.NIO基础概念 2.NIO核心组件 2.1.Channel&&Buffer简介 2.2.Selector 服务器的多线程版本 服务器的线程池版本 服务器的selector版本 2.3.Buffer 0.ByteBuffer的正确使用流程 1.ByteBuffer类型简介 2.ByteBuffer核心属性说…

记录vue的一些踩坑日记

记录vue的一些踩坑日记 安装Jq npm install jquery --save vue列表跳转到详情页&#xff0c;再返回列表的时候不刷新页面并且保持原位置不变&#xff1b; 解决&#xff1a;使用keepAlive 在需要被缓存的页面的路由中添加&#xff1a;keepAlive: true, {path: /viewExamine,nam…

ubuntu环境安装centos7虚拟机网络主机不可达,ping不通

【NAT模式下解决】1.首先vi /etc/sysconfig/network-scripts/ifcfg-ens33检查ONBOOTyes&#xff0c;保存 2.输入systemctl restart network命令重启网关

【Java||牛客】DFS应用迷宫问题

step by step. 题目&#xff1a; 描述 定义一个二维数组 N*M &#xff0c;如 5 5 数组下所示&#xff1a; int maze[5][5] { 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫&#xff0c;其中的1表示墙壁&#xff0c;0表示可…

flutter:轮播

前言 介绍几个比较有不错的轮播库 swipe_deck 与轮播沾边&#xff0c;但是更多的是一种卡片式的交互式界面设计。它的主要概念是用户可以通过左右滑动手势浏览不同的卡片&#xff0c;每张卡片上都有不同的信息或功能。 Swipe deck通常用于展示图片、产品信息、新闻文章、社…

第四代SHARC® ADSP-21479KBCZ-2A、ADSP-21479BSWZ-2A、ADSP-21479KSWZ-2A高性能DSP(数字信号处理器)

第四代SHARC Processors 现在内置低功耗浮点DSP产品&#xff08;ADSP-21478和ADSP-21479&#xff09;&#xff0c;可提供改进的性能、基于硬件的滤波器加速器、面向音频与应用的外设以及能够支持单芯片解决方案的新型存储器配置。所有器件都彼此引脚兼容&#xff0c;而且与以往…

Appium+python自动化(二十二)- 控件坐标获取(超详解)

简介 有些小伙伴或者是童鞋可能会好奇会问上一篇中的那个monkey脚本里的坐标点是如何获取的&#xff0c;不是自己随便蒙的猜的&#xff0c;或者是自己用目光或者是尺子量出来的吧&#xff0c;答案当然是&#xff1a;NO。获取控件坐标点的方式这里宏哥给小伙伴们分享和讲解三种方…

2024届IC秋招兆易创新数字IC后端笔试面试题

数字IC后端实现PR阶段设计导入需要哪些文件&#xff1f; 设计导入需要的文件如下图所示。这个必须熟练掌握。只要做过后端训练营项目的&#xff0c;对这个肯定是比较熟悉的。大家还要知道每个input文件的作用是什么。 在吾爱IC后端训练营Cortexa7core项目中&#xff0c;你认为…

数据结构--循环队列、链队

基础知识 //循环队列数据结构 typedef struct { QElemType data[MaxQSize];//数据域 int front,rear; //队头队尾指针 }SqQueue; //链队结点数据结构 typedef struct QNode { int data;//数据域 struct QNode* next;//指针域 }QNode, * QueuePtr; typedef struct { struct Q…

Jmeter接口自动化生成测试报告html格式

jmeter自带执行结果查看的插件&#xff0c;但是需要在jmeter工具中才能查看&#xff0c;如果要向领导提交测试结果&#xff0c;不够方便直观。 笔者刚做了这方面的尝试&#xff0c;总结出来分享给大家。 这里需要用到ant来执行测试用例并生成HTML格式测试报告。 一、ant下载安…

2022年全国职业院校技能大赛(高职组)“软件测试”赛项竞赛任务书

2022年全国职业院校技能大赛&#xff08;高职组&#xff09; “软件测试”赛项竞赛任务书 2022年7月 一、竞赛时间、内容及成绩组成 &#xff08;一&#xff09;竞赛时间 本阶段竞赛时间共为8小时&#xff0c;参赛选手自行安排任务进度&#xff0c;休息、饮水、如厕等不设专…

filebeat到kafka示例

docker run -d \ --namefilebeat_7.14_0 \ #filebeat名称 --userroot \ --volume"/data/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml" \ #映射filebeat.yml配置 --volume"/data/filebeat/log:/usr/share/filebeat/log" \…

整数0 强制转化为指针

整数0强制转化为指针的巧用 在工程中看到以下代码&#xff1a; #define my_container_of(ptr,type,member) \ ((type*)((char *) (ptr) - (unsigned long)(&((type*)0)->member))) ->的优先级高于&。 因此 &((type*)0)->member)的解…

微信小程序quickstartFunctions中云函数的应用

1、在quickstartFunctions文件中新建文件夹和文件 2、index.js 文件书写 const cloud require(wx-server-sdk);cloud.init({env: cloud.DYNAMIC_CURRENT_ENV }); const db cloud.database();// 链表查询试卷和对应的题库 exports.main async (event, context) > {retu…

Terraform学习日记-AWS-EC2

terraform install https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli 这里我们使用 aws-linux-2022 作为执行环境 # sudo yum install -y yum-utils# sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/…