EE308_Lab1-2

Gen_power Gen_power 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

目录

  • Links
  • Github link
  • 1. PSP form
  • 2. Problem-solving ideas
  • 3. Code description
  • testcode.cpp
  • Keywords
  • Count
  • Output
  • 4. Summary

Links

The Link Your Classhttps://bbs.csdn.net/forums/MUEE308FZU202201
The Link of Requirement of This Assignmenthttps://bbs.csdn.net/topics/608734907
The Aim of This AssignmentTo 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 ID20123116_832001212

Github link

1. PSP form

Personal Software Process StagesEstimated time/minutesCompleted Time/minutes
Planning3040
Estimate1530
Development3030
Analysis90120
Design Spec1020
Design Review2020
Coding Standard3035
Design5090
Coding120180
Code Review1015
Test2020
Postmortem & Process Improvement Plan3060
Total455660

2. Problem-solving ideas

img

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

img

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

这是本次实验的压缩包

晨起剪桃花

技术转移平台在优化匹配算法时,需要收集哪些类型的成功案例数据作为训练样本?.docx

科易网(厦门科易网科技有限公司)创立于2007年,是技术转移与科技创新数智化服务平台,拥有国家科技成果转化服务示范基地、国家技术转移示范机构等资质。平台以“AI+科技成果转化”为核心,整合成果、专利、专家、政策等多维数据,构建知识图谱与科创智能体,面向企业、政府、高校院所提供成果转化、技术需求对接、产业服务等数智化解决方案。截至目前,已服务全国企业超43万家,推动落地项目11800余项,总金额逾80亿元。

BIZKEEN

《机器视觉之路》|杯子往哪儿动,TCLR先不看标签配套源码

《机器视觉之路》第 13 集配套源码:TCLR 时序对比学习示例,含完整可运行源码与 README。

应用市场

外盘期货高频tick字段说明外盘期货历史高频tick数据按合约记录,字段包括合约代码、交易所、时间戳、最新价、买一价、卖一价、买一量、卖一量、成交量、持仓量、开盘价、最高价、最低价、收盘价、结算价、昨

外盘期货高频tick字段说明 外盘期货历史高频tick数据按合约记录,字段包括合约代码、交易所、时间戳、最新价、买一价、卖一价、买一量、卖一量、成交量、持仓量、开盘价、最高价、最低价、收盘价、结算价、昨结算价。时间精确到tick,记录盘中价格和盘口买卖量变化,覆盖不同外盘期货合约的历史行情明细。 数据源:CMES金融数据库

2401_89140926

国有企业如何利用数智化工具对下属多家子公司的研发创新效能进行横向对比分析?.docx

国有企业如何利用数智化工具对下属多家子公司的研发创新效能进行横向对比分析?

BIZKEEN
评论
收藏 已收藏
分享
返回顶部