LAB 2 Individual programing work (EE308 IEC MU 2021 Fall)

REP1USONE 助教 2021-09-17 16:53:40

Task

1.To achieve a program function, it can extract keywords of different levels from the C or C++ code files that are read in.

2. Write a blog to record your work content and process.

DDL

2021.9.24 00:00am

Work Procedure

1.Create a GitHub repository for the job.

2.Write the program and commit actively.

3.Iteratively update and optimize the code.

4.Complete your work and write a blog.

Program Requirements

1. Basic requirement: output "keyword" statistics

2. Advanced requirement: output the number of "switch case" structures, and output the number of "case" corresponding to each group

3. Uplifting requirement: output the number of "if else" structures

4. Ultimate requirement: output the number of "if, else if, else" structures

Before completing the more difficult requirements, you need to complete the Lower requirements.

Coding Requirements

1.Use any of C++, Java, Python to complete the work.

2.Develop appropriate code specifications and conduct tests.

3.Use Git for version control.

Blog Requirements

1.Give the PSP form for this work.

2.Description of problem-solving ideas. This is the process of how to think and how to find information after getting the title at the beginning.

3.Design and implementation process. The design includes how the code is organized and the flow chart of the key functions.

4.Code description. Show the key code of the project and explain the idea.

5.Unit test screenshots and description.

6.Unit test coverage optimization and performance testing, performance optimization screenshots and descriptions.

7.Summarize this assignment.

Prerequisites

1. github first use

In order to ensure that your code can help more people, and can be effectively managed and open source shared, please learn how to use GitHub first:

(1).Download Git.

(2).Learn basic Git commands.

(3).Create a repository on GitHub and upload this assignment, complete the requirements, and make at least 10 commits.

2. Code specification development

In order for other colleagues to read your code easily, please formulate your own code specifications and require that they not deviate from the mainstream code specifications: please refer to alibaba-java-style-guide/Google-C++-style-guide/Python PEP8, Develop your programming specifications from the following perspectives and write them into Markdown files.

- indentation

- Variable naming

- Maximum number of characters per line

- Maximum number of function lines

- Function and class naming

- constant

- Blank line rule

- Annotation rules

- Space before and after operator

- Other rules

SAMPLE

c language test file:

#include <stdio.h>
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;
}

Format Requirement

 Output format: The code above is used as an example

total num: 35
switch num: 2
case num: 3 2
if-else num: 2
if-elseif-else num: 2

Tips:

1. TA can’t notice all students. If your blog can impress TA, you can get higher remark.

2. If you have some question, you should ask directly in the QQ group and you’d better not make a private chat with TAs or tutor.

3. Please issue your homework in the section of assignment on CSDN.

4. The Link of each assignment you would accomplish must be submit to Moodle, or you will lose the score of the assignment.

5. Each assignment submitted to CSDN must be completed in English.

  • A total of 32 keywords are defined:

autobreakcasecharconstcontinuedefaultdo
doubleelseenumexternfloatforgotoif
intlongregisterreturnshortsignedsizeofstatic
structswitchtypedefunionunsignedvoidvolatilewhile
...全文
2463 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
内容概要:本文研究了一种应用于太阳能发电系统的多级逆变器,旨在通过采用正弦脉宽调制(SPWM)技术有效降低输出电压的总谐波失真(THD),从而提升电能质量。研究基于Simulink平台构建了完整的仿真模型,系统地实现了SPWM信号生成、驱动逻辑控制以及多电平输出波形合成等关键环节,验证了该多级逆变器在不同运行工况下具备优异的动态响应能力和稳定性。仿真结果表明,所设计的逆变器能够输出接近理想正弦波的电压波形,显著抑制高次谐波,满足可再生能源并网对电能质量的严苛要求,体现出多级逆变拓扑在光伏发电系统中的技术先进性与工程应用价值。; 适合人群:电气工程、自动化、新能源科学与工程及相关专业的本科生、研究生,以及从事光伏逆变器设计、电力电子变换技术和可再生能源并网系统研发的工程技术人员。; 使用场景及目标:①深入理解多级逆变器的工作原理及其在太阳能发电系统中的关键作用;②掌握SPWM调制技术的理论基础与实现方法,并分析其对改善THD的核心机制;③借助Simulink仿真平台开展电力电子电路的建模、参数调试与性能评估,服务于课程设计、毕业设计、科研课题或实际工程项目开发。; 阅读建议:建议读者结合提供的Simulink仿真模型进行同步操作与验证,细致调整调制比、载波频率等关键参数,观察其对输出波形和THD指标的影响,以深化对系统动态特性的理解,并尝试优化控制策略以进一步提升系统性能。

183

社区成员

发帖
与我相关
我的任务
社区描述
福州大学 梅努斯国际工程学院 软件工程 教学
软件工程 高校
社区管理员
  • 单步调试
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧