EE308 Lab1_2

EE308 Lab1_2

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 AssignmentKeywords extraction and counting
MU STU ID and FZU STU ID20124716 832001109

1. PSP

Personal Software Process StagesEstimated Time/minutesCompleted Time/minutes
Planning3045
Estimate1010
Development3030
Analysis6070
Design Spec2035
Design Review3035
Coding Standard2015
Design6080
Coding360420
Code Review1010
Test3045
Test Report1015
Postmortem & Process Improvement Plan6080
Total730890

2. Description of problem-solving ideas

When I first saw this problem, I had no idea where to start. I tried to extract useful parts from my previous c++ code according to the content of object-oriented programming learned last semester, and query the usage of some functions on the Internet and in books, and rewrite and expand them.

3. Design and implementation process

Main Design

在这里插入图片描述
· I roughly divide this code into three modules:

  1. The first one is to change all the contents in the file into strings, and divide the strings into words and store them in an array. During this period, determine whether it is a keyword, and complete the first level.
  2. On the basis of the first level, whether the input reaches the second level is determined. Once it is greater than or equal to the second level, the number of switches and cases will be calculated and output will be carried out.
  3. The third and fourth levels are related, so I put them together. In the case of the third level, we count the number of if_else and if_elseif_else structures and store them. After the answer of the third level is output, we judge whether it reaches the fourth level and decide whether to output it.
    在这里插入图片描述

4.Code description

(1) Code

· Enter two parameters and check在这里插入图片描述
· Save the keywords in an array. Extract all the contents of the file into a line string, split the words from the string, use the substr () function to extract the letters and save them to another array, compare the two arrays one by one, count the equal number and output.
在这里插入图片描述
· Judge whether the ith bit of array s is equal to switch, and judge the case after swicth on this basis, save the number, and output one by one at last.
在这里插入图片描述
· In the case of level 3 and 4, decide if else belongs to elseif, from the current position up to the if position, if elseif is in the middle, then decide if_elseif_else quantity +1, if not, then decide if_else.
在这里插入图片描述

(2)GitHub Link

The Link.

5.Unit test screenshots and description

· level 1 :在这里插入图片描述
· level 2 :
在这里插入图片描述
· level 3 :
在这里插入图片描述
· level 4 :
在这里插入图片描述

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

在这里插入图片描述
在这里插入图片描述

7.Summarize this assignment

I think this task is very difficult for me, and I also spent a lot of time and energy on this task. In this task, I realized that my mastery of C++ was not very proficient, which led me to consult a lot of materials and make some negligence in the process of writing code. Through this task, I reviewed the knowledge I learned last semester, and also learned some new functions and new writing methods. I hope I can finish the task proficiently in the next task.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值