题目:办公室日常管理信息系统 系统功能基本要求: 文件管理信息:包括文件编号、文件种类、文件名称、存放位置等; 考勤管理:包括姓名、年龄、职务、日期、出勤情况等;查询员工的出勤情况。会议记录:包括会议时间、参会人、记录员、会议内容等; 办公室日常事务管理,包括时间、事务、记录人。按条件查询,统计(用c++编写程序vs2022编译器编写)程序代码

时间: 2023-07-10 14:35:29 浏览: 47
好的,以下是一个简单的办公室日常管理信息系统的C++程序示例,实现了文件管理、考勤管理、会议记录和办公室日常事务管理等基本功能,包括按条件查询和统计。 ```c++ #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; // 定义文件信息结构体 struct FileInfo { string id; // 文件编号 string type; // 文件种类 string name; // 文件名称 string location; // 存放位置 }; // 定义员工信息结构体 struct EmployeeInfo { string name; // 姓名 int age; // 年龄 string title; // 职务 vector<bool> attendance; // 出勤情况,true表示出勤,false表示缺勤 }; // 定义会议记录结构体 struct MeetingRecord { string time; // 会议时间 vector<string> attendees; // 参会人 string recorder; // 记录员 string content; // 会议内容 }; // 定义办公室日常事务结构体 struct OfficeTask { string time; // 时间 string task; // 事务 string recorder; // 记录人 }; // 文件管理信息 vector<FileInfo> fileInfos; // 员工信息 vector<EmployeeInfo> employeeInfos; // 会议记录 vector<MeetingRecord> meetingRecords; // 办公室日常事务 vector<OfficeTask> officeTasks; // 添加文件信息 void addFileInfo() { FileInfo fileInfo; cout << "请输入文件编号:"; cin >> fileInfo.id; cout << "请输入文件种类:"; cin >> fileInfo.type; cout << "请输入文件名称:"; cin >> fileInfo.name; cout << "请输入存放位置:"; cin >> fileInfo.location; fileInfos.push_back(fileInfo); cout << "添加成功!" << endl; } // 显示文件信息 void showFileInfo() { cout << "文件编号\t文件种类\t文件名称\t存放位置" << endl; for (auto fileInfo : fileInfos) { cout << fileInfo.id << "\t" << fileInfo.type << "\t" << fileInfo.name << "\t" << fileInfo.location << endl; } } // 添加员工信息 void addEmployeeInfo() { EmployeeInfo employeeInfo; cout << "请输入姓名:"; cin >> employeeInfo.name; cout << "请输入年龄:"; cin >> employeeInfo.age; cout << "请输入职务:"; cin >> employeeInfo.title; cout << "请输入出勤情况(1表示出勤,0表示缺勤):" << endl; for (int i = 0; i < 30; i++) { int attendance; cout << "请输入第" << i + 1 << "天的出勤情况:"; cin >> attendance; employeeInfo.attendance.push_back(attendance == 1); } employeeInfos.push_back(employeeInfo); cout << "添加成功!" << endl; } // 显示员工信息 void showEmployeeInfo() { cout << "姓名\t年龄\t职务\t出勤情况" << endl; for (auto employeeInfo : employeeInfos) { cout << employeeInfo.name << "\t" << employeeInfo.age << "\t" << employeeInfo.title << "\t"; for (auto attendance : employeeInfo.attendance) { cout << (attendance ? "出勤" : "缺勤") << " "; } cout << endl; } } // 查询员工出勤情况 void queryAttendance() { string name; cout << "请输入要查询的员工姓名:"; cin >> name; auto it = find_if(employeeInfos.begin(), employeeInfos.end(), [name](EmployeeInfo employeeInfo) { return employeeInfo.name == name; }); if (it != employeeInfos.end()) { cout << "姓名\t年龄\t职务\t出勤情况" << endl; cout << it->name << "\t" << it->age << "\t" << it->title << "\t"; for (auto attendance : it->attendance) { cout << (attendance ? "出勤" : "缺勤") << " "; } cout << endl; } else { cout << "未找到该员工信息!" << endl; } } // 添加会议记录 void addMeetingRecord() { MeetingRecord meetingRecord; cout << "请输入会议时间:"; cin >> meetingRecord.time; cout << "请输入参会人(以逗号分隔):"; string attendeesStr; cin >> attendeesStr; string attendee; for (int i = 0; i < attendeesStr.length(); i++) { if (attendeesStr[i] == ',') { meetingRecord.attendees.push_back(attendee); attendee = ""; } else { attendee += attendeesStr[i]; } } if (!attendee.empty()) { meetingRecord.attendees.push_back(attendee); } cout << "请输入记录员:"; cin >> meetingRecord.recorder; cout << "请输入会议内容:"; cin >> meetingRecord.content; meetingRecords.push_back(meetingRecord); cout << "添加成功!" << endl; } // 显示会议记录 void showMeetingRecord() { cout << "会议时间\t参会人\t记录员\t会议内容" << endl; for (auto meetingRecord : meetingRecords) { cout << meetingRecord.time << "\t"; for (auto attendee : meetingRecord.attendees) { cout << attendee << " "; } cout << "\t" << meetingRecord.recorder << "\t" << meetingRecord.content << endl; } } // 添加办公室日常事务 void addOfficeTask() { OfficeTask officeTask; cout << "请输入时间:"; cin >> officeTask.time; cout << "请输入事务:"; cin >> officeTask.task; cout << "请输入记录人:"; cin >> officeTask.recorder; officeTasks.push_back(officeTask); cout << "添加成功!" << endl; } // 显示办公室日常事务 void showOfficeTask() { cout << "时间\t事务\t记录人" << endl; for (auto officeTask : officeTasks) { cout << officeTask.time << "\t" << officeTask.task << "\t" << officeTask.recorder << endl; } } // 按条件查询 void queryByCondition() { int choice; cout << "请选择要查询的类型:" << endl; cout << "1. 文件信息" << endl; cout << "2. 员工信息" << endl; cout << "3. 会议记录" << endl; cout << "4. 办公室日常事务" << endl; cin >> choice; switch (choice) { case 1: { string id; cout << "请输入要查询的文件编号:"; cin >> id; auto it = find_if(fileInfos.begin(), fileInfos.end(), [id](FileInfo fileInfo) { return fileInfo.id == id; }); if (it != fileInfos.end()) { cout << "文件编号\t文件种类\t文件名称\t存放位置" << endl; cout << it->id << "\t" << it->type << "\t" << it->name << "\t" << it->location << endl; } else { cout << "未找到该文件信息!" << endl; } break; } case 2: { string name; cout << "请输入要查询的员工姓名:"; cin >> name; auto it = find_if(employeeInfos.begin(), employeeInfos.end(), [name](EmployeeInfo employeeInfo) { return employeeInfo.name == name; }); if (it != employeeInfos.end()) { cout << "姓名\t年龄\t职务\t出勤情况" << endl; cout << it->name << "\t" << it->age << "\t" << it->title << "\t"; for (auto attendance : it->attendance) { cout << (attendance ? "出勤" : "缺勤") << " "; } cout << endl; } else { cout << "未找到该员工信息!" << endl; } break; } case 3: { string time; cout << "请输入要查询的会议时间:"; cin >> time; auto it = find_if(meetingRecords.begin(), meetingRecords.end(), [time](MeetingRecord meetingRecord) { return meetingRecord.time == time; }); if (it != meetingRecords.end()) { cout << "会议时间\t参会人\t记录员\t会议内容" << endl; cout << it->time << "\t"; for (auto attendee : it->attendees) { cout << attendee << " "; } cout << "\t" << it->recorder << "\t" << it->content << endl; } else { cout << "未找到该会议记录!" << endl; } break; } case 4: { string time; cout << "请输入要查询的时间:"; cin >> time; auto it = find_if(officeTasks.begin(), officeTasks.end(), [time](OfficeTask officeTask) { return officeTask.time == time; }); if (it != officeTasks.end()) { cout << "时间\t事务\t记录人" << endl; cout << it->time << "\t" << it->task << "\t" << it->recorder << endl; } else { cout << "未找到该办公室日常事务!" << endl; } break; } default: cout << "请选择正确的选项!" << endl; break; } } // 统计 void statistics() { int choice; cout << "请选择要统计的类型:" << endl; cout << "1. 员工出勤情况" << endl; cin >> choice; switch (choice) { case 1: { int attendanceCount = 0; int absenceCount = 0; for (auto employeeInfo : employeeInfos) { for (auto attendance : employeeInfo.attendance) { if (attendance) { attendanceCount++; } else { absenceCount++; } } } cout << "出勤人数:" << attendanceCount << endl; cout << "缺勤人数:" << absenceCount << endl; break; } default: cout << "请选择正确的选项!" << endl; break; } } int main() { while (true) { cout << "请选择要执行的操作:" << endl; cout << "1. 添加文件信息" << endl; cout << "2. 显示文件信息" << endl; cout << "3. 添加员工信息" << endl; cout << "4. 显示员工信息" << endl; cout << "5. 查询员工出勤情况" << endl; cout << "6. 添加会议记录" << endl; cout << "7. 显示会议记录" << endl; cout << "8. 添加办公室日常事务" << endl; cout << "9. 显示办公室日常事务" << endl; cout << "10. 按条件查询" << endl; cout << "11. 统计" << endl; cout << "12. 退出" << endl; int choice; cin >> choice; switch (choice) { case 1: addFileInfo(); break; case 2: showFileInfo(); break; case 3: addEmployeeInfo(); break; case 4: showEmployeeInfo(); break; case 5: queryAttendance(); break; case 6: addMeetingRecord(); break; case 7: showMeetingRecord(); break; case 8: addOfficeTask(); break; case 9: showOfficeTask(); break; case 10: queryByCondition(); break; case 11: statistics(); break; case 12: return 0; default: cout << "请选择正确的选项!" << endl; break; } } } ``` 该程序使用了结构体来封装文件信息、员工信息、会议记录和办公室日常事务等数据,提供了添加、查询、统计等基本功能。其中,查询和统计使用了STL中的find_if和count_if算法。希望该程序能够帮助到您。

相关推荐

最新推荐

recommend-type

操作系统课程设计文件管理系统

本设计的目的是通过设计和调试一个简单的文件系统,主要是模拟文件操作命令的执行,来模拟文件管理,使学生对主要文件操作命令的实质和执行过程有比较深入的了解,掌握它们的基本实施方法。 二、 开发工具及环境 a...
recommend-type

美和易思 阶段测试 题目:外包人力资源管理系统(模糊查询、删除、新增).docx

使用环境:MyEclipse/Eclipse + Tomcat + MySQL。 使用技术:Spring MVC + Spring + MyBatis 或 JSP + Servlet + JavaBean + JDBC。
recommend-type

一级目录模拟文件系统实验报告

一级目录模拟文件系统的实验报告。 实验内容为使用一级目录结构,实现磁盘文件的操作。操作包括:创建文件、打开文件、读写文件、关闭和删除文件。
recommend-type

人事管理系统 数据库大作业.doc

数据库大作业 :人事管理系统 报告中包括:数据库的背景及功能需求、数据库的概念结构设计、数据库的逻辑结构设计、关键问题论述、自我总结 部分展示: 一、数据库的背景及功能需求 人事管理系统,属于ERP的一个部分...
recommend-type

基于SaaS的会务管理系统的设计与实现.doc

系统包括PC端和移动端,PC端包括登录注册、大会管理、人员管理、报名管理、弹幕管理、题库和考试管理这些功能模块。移动端包括发送弹幕、查看大会指南、答题闯关功能模块。在PC端,进入管理员界面,可以实现配置大会...
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

MATLAB柱状图在信号处理中的应用:可视化信号特征和频谱分析

![matlab画柱状图](https://img-blog.csdnimg.cn/3f32348f1c9c4481a6f5931993732f97.png) # 1. MATLAB柱状图概述** MATLAB柱状图是一种图形化工具,用于可视化数据中不同类别或组的分布情况。它通过绘制垂直条形来表示每个类别或组中的数据值。柱状图在信号处理中广泛用于可视化信号特征和进行频谱分析。 柱状图的优点在于其简单易懂,能够直观地展示数据分布。在信号处理中,柱状图可以帮助工程师识别信号中的模式、趋势和异常情况,从而为信号分析和处理提供有价值的见解。 # 2. 柱状图在信号处理中的应用 柱状图在信号处理
recommend-type

HSV转为RGB的计算公式

HSV (Hue, Saturation, Value) 和 RGB (Red, Green, Blue) 是两种表示颜色的方式。下面是将 HSV 转换为 RGB 的计算公式: 1. 将 HSV 中的 S 和 V 值除以 100,得到范围在 0~1 之间的值。 2. 计算色相 H 在 RGB 中的值。如果 H 的范围在 0~60 或者 300~360 之间,则 R = V,G = (H/60)×V,B = 0。如果 H 的范围在 60~120 之间,则 R = ((120-H)/60)×V,G = V,B = 0。如果 H 的范围在 120~180 之间,则 R = 0,G = V,B =
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。