EE308_Lab1-2
目录
- Links
- Github link
- 1. PSP form
- 2. Problem-solving ideas
- 3. Code description
- testcode.cpp
- Keywords
- Count
- Output
- 4. Summary
Links
| The Link Your Class | https://bbs.csdn.net/forums/MUEE308FZU202201 |
|---|---|
| The Link of Requirement of This Assignment | https://bbs.csdn.net/topics/608734907 |
| The Aim of This Assignment | To achieve a program function, it can extract keywords of different levels from the C or C++ code files that are read in. |
| MU STU ID and FZU STU ID | 20123116_832001212 |
Github link
1. PSP form
| Personal Software Process Stages | Estimated time/minutes | Completed Time/minutes |
|---|---|---|
| Planning | 30 | 40 |
| Estimate | 15 | 30 |
| Development | 30 | 30 |
| Analysis | 90 | 120 |
| Design Spec | 10 | 20 |
| Design Review | 20 | 20 |
| Coding Standard | 30 | 35 |
| Design | 50 | 90 |
| Coding | 120 | 180 |
| Code Review | 10 | 15 |
| Test | 20 | 20 |
| Postmortem & Process Improvement Plan | 30 | 60 |
| Total | 455 | 660 |
2. Problem-solving ideas

3. Code description
testcode.cpp
#include <iostream>
using namespace std;
int main() {
int i = 1;
double j = 0;
long f;
switch(i) {
case 0:
break;
case 1:
break;
case 2:
break;
default:
break;
}
switch(i) {
case 0:
break;
case 1:
break;
default:
break;
}
if (i < 0) {
if (i < -1) {}
else {}
}
else if (i > 0) {
if (i > 2){}
else if (i == 2) {}
else if (i > 1) {}
else {}
}
else {
if (j != 0) {}
else{}
}
return 0;
}
Keywords
string Keyword[32]=
{
"auto", "break", "case", "char", "const", "continue", "default", "double",
"do", "else", "enum", "extern", "float", "for", "goto", "if", "int", "long",
"register", "return", "short", "signed", "sizeof", "static", "struct",
"switch", "typedef", "union", "unsigned", "void", "volatile", "while"
};
Count
for (int i = 0; i < 32; i++ ) {
if (match(str, Keyword[i]) == 1) {
total_num++;
break;
}
}
for (int i = 0; i < 32; i++ ) {
if (match(str, Keyword[i]) == 1){
if (match(str, "switch") ) {
Case_num.push_back(case_num);
switch_num++;
case_num = 0;
}
if (match(str, "case")){
case_num++;
}
break;
}
}
if (match(str, "else if" )){
top++;
stack[top] = 2;
}
else {
if (match(str, "else")) {
if (stack[top] == 1 ) {
if_else_num++;
top--;
}
else {
if (stack[top] == 2 ) {
if_elseif_else_num++;
top--;
}
}
}
else {
if (match(str, "if")) {
top++;
stack[top] = 1;
}
}
}
Output

4. Summary
I think this task is difficult. The time I finish the report is beyond the estimated time but I have learnt a lot, such as C++ programing and github.
相关推荐
EE-308 LAB4 final version.7z
这是本次实验的压缩包
工业互联网工控安全与工业质检AI大模型建设方案.pptx
工业互联网工控安全与工业质检AI大模型建设方案.pptx
2024 《计算机网络》实验教学指导书.doc
2024 《计算机网络》实验教学指导书.doc
不平衡电网下自抗扰顺序模型预测PWM整流器控制仿真模型(Simulink仿真实现)
内容概要:本文围绕面向城市空中交通的多无人机路径规划问题展开研究,提出了一套融合全局规划、动态避障与局部协同调整的综合路径规划方法。研究内容涵盖基于改进RRT算法与图论的全局路径规划、基于动态风险场和动态窗口法(DWA)的模型预测控制实现动态避障,以及基于分布式协同控制的多无人机局部路径协同策略。通过Matlab平台构建仿真环境,在多种典型城市交通场景下对所提方法进行了系统性验证,结果表明该方法在路径安全性、编队稳定性与任务效率方面表现优异。文章还深入探讨了算法的创新点与未来研究方向,为复杂城市环境下多无人机系统的自主协同提供了理论支撑与技术路径。; 适合人群:具备自动化、控制理论、计算机科学或相关领域基础知识,从事无人机系统、智能交通、路径规划、多智能体协同控制等方向研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①为城市空中交通系统中的多无人机安全、高效飞行提供可靠的路径规划解决方案;②支持在复杂、动态的城市场景中开展无人机自主导航、编队飞行与协同控制的技术研究与仿真验证。; 阅读建议:建议结合提供的Matlab代码进行实践操作,重点关注算法的具体实现细节、参数配置对性能的影响以及不同仿真场景下的实验设计,以深入理解各模块的集成逻辑与实际应用效果。
通信行业CentOS 7内核网络栈优化:高并发连接下UDP/TCP性能调优与系统资源管理
内容概要:本文聚焦于CentOS 7系统在通信行业高并发场景下的性能调优实践,重点围绕内核网络栈优化展开,涵盖UDP/TCP缓冲区调整、文件句柄与连接跟踪表扩容、TIME_WAIT状态复用、软中断分布优化及tuned工具的自动化调优。通过具体配置参数和实际案例(如VoIP软交换系统)深入解析各项调优措施的设计原理与实施效果,有效解决高CPS下丢包、连接失败等问题,并展望了向云化、eBPF等动态智能调优方向的发展趋势。; 适合人群:从事通信系统运维、网络开发或Linux系统性能优化的技术人员,具备一定操作系统和网络基础知识,工作经验1年以上的中初级工程师。; 使用场景及目标:①应用于软交换、媒体网关、信令网关等高并发通信设备的系统调优;②解决UDP丢包、conntrack表满、TCP连接队列溢出等典型性能瓶颈;③提升系统在小包高频、低时延要求场景下的稳定性和吞吐能力。; 阅读建议:建议结合实际生产环境或测试平台同步验证文中配置,重点关注参数背后的物理意义(如BDP、softirq、conntrack机制),并配合ss、conntrack、dmesg等命令进行调优前后对比分析,确保安全可控地实施变更。



