GitThub Address: https://github.com/Pr1ncew/wc
WC project-related requirements:
wc.exe is a common tool, you can count the number of characters of text files, words, and lines. The project asked to write a command line program, to mimic the function of the existing wc.exe, and be expanded, given the number of characters in a programming language source files, words, and lines.
Related functions:
basic skills:
-c count the number of characters in the file
-w number of words statistics file
-l file statistics the number of rows
extensions:
Under -s Process directories recursively have to file qualifying
-a line of code returns the file / empty line / comment lines
Wildcard support various files (* ,?)
Advanced Features
The basic operation of Windows GUI programs
PSP table
PSP2.1 | Personal Software Process Stages | Estimated time consuming (minutes) | The actual time-consuming (minutes) |
---|---|---|---|
Planning | plan | 100 | 200 |
· Estimate | • Estimate how much time this task requires | 30 | 40 |
Development | Develop | 1200 | 1300 |
· Analysis | · demand analysis | 150 | 155 |
· Design Spec | Generate design documents | 40 | 45 |
· Design Review | · Design Review | 40 | 40 |
· Coding Standard | · Code Specification | 30 | 30 |
· Design | · Specific design | 50 | 50 |
· Coding | · Specific coding | 1000 | 1000 |
· Code Review | · Code Review | 40 | 40 |
· Test | · Test (self-test, modify the code, submit modifications) | 80 | 80 |
Reporting | report | 150 | 150 |
· Test Report | · testing report | 100 | 100 |
· Size Measurement | · Computing workload | 20 | 30 |
· Postmortem & Process Improvement Plan | · Hindsight, and propose process improvement plan | 40 | 40 |
total | 3070 | 3300 |
Difficulties encountered and solutions
Programming analysis, the need to clarify the function of each part and its associated program integration; functional analysis, statistical character when, for how different format character statistics; text reading, which method uses the read operation; test analysis, how to test, testing process and test modifications. And again by analyzing the various problems that may be encountered resolved, the final completion of the program, if the harvest is to integrate this function, clear understanding of the program after deepening.
Key Code
Program design, the program consists of three parts, one is the main function testMain, a function call, the required test functions; addition is the text reading function fileUnit, read text, there is also the number of lines of complex statistics and extended functionality row statistical functions; Finally, there is the text statistics Total, character counts work carried out in different formats.
Project Summary
In fact, the program itself is not too difficult, as long as clarify program structure, which is to read the text of all the characters, and then screened statistics, and then use the code to implement them can be broken down all aspects of the function, to achieve their purpose, then integration. Believe that this time the project-based learning, so that their experience has increased, after then encountered a similar project design, able to think calmly, then analyze the design, the overall can be a lot easier. So I think, is a very important project experience, the knowledge can be practical operation, their level will increase a lot.