• 全部
...

EE308 LAB1_2

taohhoat 2022-10-28 06:02:36

EE308 LAB1_2 2022

Catalogue

  • EE308 LAB1_2 2022
  • PSP form
  • Basic Idea
  • Design & Implement
  • Code Explanation
  • Result
  • Summary

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 Keywords extraction and counting
MU STU ID and FZU STU ID20124066 & 832002123

MY GITHUB:https://github.com/taohhoat/EE308_LAB12

PSP form

Personal Software Process StagesEstimated Time/minutesCompleted Time/minutes
Planning2530
Estimate2530
Development5040
Analysis3030
Design Spec3020
Design Review1010
Coding Standard1510
Design1010
Coding7085
Code Review Planning2020
Test1030
Reporting6570
Test Report1530
Size Measurement1520
Postmortem & Process Improvement4040
total430475

Basic Idea

I use c++ to solve the problem.
I know the most different part in the project is that we need frequently use String and char [] to solve the problem.
First, i review the information about Import a directory usage and how to deal with the content in a ".txt" line by line.
Second, i clearly draw a picture which shows the connection between 4 steps.
I use draw.io to picture a link map.

在这里插入图片描述

Design & Implement

在这里插入图片描述


step 1 and 2:
It is easy to think that we can just use a String array to carry all the keywords, and order to find the words same as the word in the array;
The same way to find the "switch ".

step 3 and 4:
It is hard to discuss because "if else " and "if else if " have same part. So we can use a double loops. First loop is to judge whether " if else if " is finding. If is found, no more operation. Else judge the another "else ".

Code Explanation

在这里插入图片描述


This is where I started using the stack structure. A stack is a data structure in which items are arranged in order, and items can only be inserted and deleted at one end (called the top of the stack). When I find cases, I will sum them up and calculate the number of cases. When I traverse to default, I will end the sum up. Or when I encounter the next switch, I will add the switch and re-stack the number

在这里插入图片描述

when the second one finds the else and then finds the if, if follows, it will print the Boolean to false. I check to see if there is an if or else if form stored at the top of the stack, and count if there is, otherwise it doesn't work

Result

在这里插入图片描述


在这里插入图片描述


在这里插入图片描述


在这里插入图片描述

Performance optimization:
stack using is not a better way than loop, it cause more time because of it's mechanism .Then i may use two loop to replace the process of dealing with the step3 and 4.

Summary

It is the first time i use Git. I know the advantages of Git well which allow me to change and optimize my code better in the next time. And i use github to save my code, it is better to see the change in my process.

...全文
给本帖投票
175 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
FASMARM v1.42 This package is an ARM assembler add-on for FASM. FASMARM currently supports the full range of instructions for 32-bit and 64-bit ARM processors and coprocessors up to and including v8. Contents: 1. ARM assembly compatibility 2. UAL and pre-UAL syntaxes 3. IT block handling 4. Alternate encodings 5. Output formats 6. Control directives 7. Data definitions 8. Defining registers lists inside macros 9. Half-precision number formatting 10. Variants supported 11. Further information 12. Version history _______________________________________________________________________________ 1. ARM assembly compatibility There are a few restrictions how the ARM instruction set is implemented. The changes are minor and mostly have a minor impact. For the most part the basic instruction outline is the same. Where possible the original style is used but there are some differences: Not everything matches the ARM ADS assembly style, where possible the original style is used but there are some differences 1) label names cannot begin with a digit 2) CPSIE and CPSID formats are changed, use "iflags_aif" form instead of "aif" (eg. "CPSIE iflags_i" instead of "CPSID i") 3) SRS with writeback must have a separating space after the mode number and before "!" (eg. "SRSDB 16 !" instead of "SRSDB 16!") 4) macro, rept, irp, format, if, virtual etc. are all significant changes from the ARM ADS, so you will need to re-write those sections of existing code Original ARM Syntax | fasmarm Syntax ----------------------+---------------------- cpsie a | cpsie iflags_a | srsdb #29! | srsdb #29 ! ;or, | srsdb 29 ! _______________________________________________________________________________ 2. UAL and pre-UAL syntaxes fasmarm supports the original pre-UAL syntax and the newer UAL syntax. These two syntaxes only affect THUMB encodings. UAL stands for: Universal Assembly Language. pre-UAL syntax is selected wi

285

社区成员

发帖
与我相关
我的任务
社区描述
福州大学 梅努斯国际工程学院 软件工程(2022秋) 教学
软件工程 高校
社区管理员
  • LinQF39
加入社区
社区公告
暂无公告

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

手机看
关注公众号

关注公众号

客服 返回
顶部