Professional Documents
Culture Documents
Assignment Feedback
Formative Feedback: Assessor to Student
Action Plan
Summative feedback
II
REVIEWERS
Assignment Feedback
Formative Feedback: Reviewer to Student
Action Plan
Summative feedback
III
ACKNOWLEDGMENTS
First of all, a special thank you goes to my family for giving encouragement,
enthusiasm and invaluable assistant to me. Without all this, I might not be able to
complete this assignment properly.
Secondly, I would like to express my gratitude and appreciation to my
supervisor, Dr. Hoai Phuong DANG, who has given his full effort in guiding me in
achieving the learning outcomes as well as his support during working on this
assignment.
Besides, I have also been helped greatly by many discussions with fellow
classmates at BTEC FPT International College. Therefore, many thanks go to them.
Finally, I would also like to acknowledge the crucial role of the staff of BTEC,
who gave me permission to use the necessary facilities and material to complete the
assignment.
IV
ASSURANCE
I certify that this assignment is my own work, based on my personal study and
that I have acknowledged all material and sources used in its preparation, whether
they be books, articles, reports, lecture notes, and any other kind of document,
electronic or personal communication. I also certify that this assignment has not
previously been submitted for assessment in any other unit, except where specific
permission has been granted from all unit coordinators involved, or at any other time
in this unit, and that I have not copied in part or whole or otherwise plagiarised the
work of other persons.
Learners declaration
I certify that the work submitted for this assignment is my own and research
sources are fully acknowledged.
Student signature: Date:
V
TABLE OF CONTENT
ACKNOWLEDGMENTS iv
ASSURANCE v
TABLE OF CONTENT vi
LIST OF TABLES, PICTURES viii
LIST OF ACRONYM ix
Chapter 1: Algorithm.....................................................................................................1
1.1. Algorithm................................................................................................1
1.1.1. Definition of an algorithm....................................................................1
1.1.2. Characteristics of an algorithm...........................................................1
1.1.3. Criteria to measure a good algorithm.................................................1
1.1.4. Example of an algorithm.....................................................................2
1.2. The process of building an application..................................................3
1.2.1. Feasibility Analysis.............................................................................3
1.2.2. Analysis and Requirements Specification..........................................3
1.2.3. Design (Algorithm)..............................................................................3
1.2.4. Coding.................................................................................................4
1.2.5. Testing and Debugging.......................................................................4
1.2.6. Deployment.........................................................................................4
1.2.7. Maintenance.......................................................................................4
1.3. The steps taken from writing code to execution in general and in C#...4
1.4. The relationship between the written algorithm and the code variant...5
Chapter 2: Programming paradigm...............................................................................6
2.1. Procedure-oriented programming (POP)...............................................6
2.2. Object-oriented programming (OOP).....................................................6
2.3. Event-driven programming.....................................................................6
2.4. An example............................................................................................7
2.4.1. Procedure-oriented programming.......................................................7
2.4.2. Object-oriented programming.............................................................8
2.4.3. Event-driven programming.................................................................9
Chapter 3: Integrated Development Environment.......................................................10
3.1. Definition of an IDE..............................................................................10
3.2. Common features of an IDE................................................................10
3.2.1. GUI designer.....................................................................................10
3.2.2. Code editor.......................................................................................11
3.2.3. Debugger..........................................................................................11
3.2.4. Compiler............................................................................................12
3.2.5. Code completion...............................................................................12
VI
Chapter 4: Electricity Account Management Software...............................................14
4.1. Introduce the software.........................................................................14
4.2. Requirement analysis..........................................................................14
4.3. Develop the program using Microsoft Visual Studio............................16
4.3.1. Design the GUI.................................................................................16
4.3.2. Write and manage code...................................................................17
4.4. Debugging Evaluation..........................................................................19
4.4.1. Debugging process in Visual Studio.................................................19
4..4.2. Debugging evaluation.......................................................................21
4.5. IDE Evaluation.....................................................................................22
4.6. Coding standard evaluation.................................................................22
4.6.1. Benefits of coding standard..............................................................22
4.6.2. Coding standard used in coding the software..................................24
CONCLUSION.............................................................................................................26
REFERENCES
VII
LIST OF TABLES, PICTURES
VIII
Figure 4-14 Example of being inconsistent in naming..............................................23
Figure 4-15 Example of how to present code............................................................23
Figure 4-16 White space...........................................................................................24
Figure 4-17 Write comments.....................................................................................25
LIST OF ACRONYM
IX
Developing Electricity Account Management Software
Chapter 1: Algorithm
1.1. Algorithm
1.1.1. Definition of an algorithm
An algorithm is a finite sequence of clearly defined instructions to achieve a
predetermined purpose. There are three methods for performing an algorithm:
natural language, flowchart, and pseudocode.
Natural language or everyday language is used to list the steps of the algorithm.
A flowchart is a visual tool, using different symbols to represent the sequence of
activities or operators needed to solve the problem.
Pseudocode is created from borrowing the syntax of a programming language
to represent the algorithm.
1.1.2. Characteristics of an algorithm
Definiteness: Each step of an algorithm must be determined accurately, clearly
and closely for each case. The result of each step is unique and depends only on the
inputs and the results of the previous steps.
Finiteness: The total number of steps in an algorithm must be finite. The
commands are not repeated indefinitely.
Effectiveness: Each step of an algorithm must be basic and essential so that
they can be implemented accurately and within a finite period of time. It means that
after putting in the data, the algorithm works and produces the desired result.
Input and Output: The algorithm receives input, processes and produces output.
An algorithm may have no input but it must produce at least one output.
Generality: An algorithm can be applied to inputs that are different data sets
within a specific domain. The algorithm can solve all cases of the problem, not only
for certain individual cases.
1.1.3. Criteria to measure a good algorithm
To solve a problem, there can be many different ways. There is a need to
choose the "best" way in a sense. Two criteria for evaluating the algorithm are listed
below:
- Simple, easy to understand, easy to program.
- For quick solutions, use fewer computer resources.
Unfortunately, it is often impossible to guarantee both. Depending on the
situation, the first or second standard is applied. If only using algorithms for a few
times, the first standard is more important than the second one. In contrast, if this is a
very common problem, the algorithm will be used many times, then the second
standard is more important.
The purpose of algorithmic research is to build effective programs. The second
standard is the effectiveness of algorithms. An algorithm is called effective if it saves
space and time. Space efficiency is taking up less memory during execution. Time
efficiency which is prime importance is needing less time for execution. Assessing
the complexity of the algorithm is to evaluate the time taken.
1.1.4. Example of an algorithm
The algorithm for calculating the sum of first n natural numbers S = 1 + 2 + 3 +
… + n performed in natural language is given below:
Step 1: Enter the value of n.
Step 2: Assign S 0 and i 1.
Step 3: If i > n then jump to step 6.
Step 4: S S + i.
Step 5: i i + 1 and go back to step 3.
Step 6: Display the value of S.
Step 7: End of the algorithm.
The flowchart of the algorithm:
1.3. The steps taken from writing code to execution in general and in
C#
Step 1: Write source code in the chosen programming language using a code
editor or an appropriate Integrated Development Environment (IDE).
Step 2: Preprocess using the preprocessor which instructs the compiler to do
required pre-processing before actual compilation starts.
Step 3: Compile the program using a software program called a compiler that
translates the code written in a programming language to machine code such as
binary code, which can be understood by the computer.
Step 4: Link the program with functions from the library, which are essential for
executing the program. The compiler automatically calls the linker the final step in
compiling the program. It also links user-defined functions to user-defined libraries.
Step 5: Load machine codes of a program into the system memory using a
loader, which is part of the Operating System responsible for loading programs. It
places programs into memory and prepares them for execution.
Step 6: Execute the program. The Central Processing Unit (CPU) carries out
the instructions of a computer program by performing the basic arithmetic, logical,
control and input/output (I/O) operations specified by the instructions.
1.4. The relationship between the written algorithm and the code
variant
Algorithms provide a general approach towards a problem, often ignoring
implementation details which can surpass the original problem in complexity.
Algorithms are developed in so-called pseudocode, a language that mimics
programming languages but has the writer's desired form.
Pseudocode Code
Read (n); Console.Write("Enter n = ");
S 0; int n = Convert.ToInt32(Console.ReadLine());
i 1; int S = 0, i = 1;
while i ≤ n
S S + 1; while (i <= n)
i i + 1; {
return S; S = S + i;
i = i + 1;
}
2.4. An example
2.4.1. Procedure-oriented programming
A function to show information of a book is written in POP. This technique
focuses on functions as well as action sequences rather than data. In other words,
data is only for executing functions. So POP has no access specifiers and data can
move freely in the program. Any function can use data that leads to non-security, as
well as the ability to reuse the code is not achieved. Moreover, data is not managed,
so adding new data is not easy.
3.2.3. Debugger
Debugging tools support users to identify and fix errors in source code. They
often simulate real-life scenarios to test functionality and performance. Developers
can check different code segments, identify logic and syntax errors and where they
are.
3.2.4. Compiler
The compiler converts entire source code into machine code such as binary
code so that it can be run as its own individual program file. The machine code is
analyzed to ensure its accuracy. The compiler then parses and optimizes the code to
optimize performance.
3.2.5. Code completion
Most IDEs have intelligent code completion features. They support
programmers by identifying and inserting common code components. These features
help developers save time writing code and reduce the possibility of typos and bugs.
Below is the analysis of methods of objects. The Electricity Account object has
only get and set methods, that is, it is possible to get information about an object and
can also set information to an object. The main functions of the program will be the
methods of the List Account object.
Breakpoints are locations where the program will temporarily stop executing so
that the programmer considers the changes of the variables to each command line,
thus detecting the location of the faulty code line. A breakpoint is denoted by a red
dot at the beginning of the code line. To create a breakpoint, simply click on the
beginning of the code line. To cancel a breakpoint, click on the breakpoint again. It is
also possible to create or cancel breakpoints with the F9 key.
Locals: The Locals window automatically displays all variables related to the
current code line.
Autos: Autos window displays the variables used in the previous code.
When the program stops at a breakpoint, the debugger provides the ability to
simply pass the code lines as follows:
Step Over (F10): Run step by step, skip the function (only receive the return
value of the function).
Step Into (F11): Run step by step, go to the content of the child function.
Step Out (Shift + F11): Jump to the next breakpoint. If no breakpoints are
available, the debugger will end. In addition, it also has the function of running
through the current subfunction.
4..4.2. Debugging evaluation
The debugging process provides the most useful information about data
structures and assists developers in minimizing useless and distracting information.
Debugging process helps programmers understand the program's implementation
better. Then it is possible to create more robust applications.
From the security perspective, it is the developer’s responsibility to ensure that
the code written would not contain security errors. Debuggers are designed so that
developers can monitor and control the execution state of the program, understand
the mechanism of action, and thereby detect application security vulnerabilities.
The coding standard also teaches how to write clean code, and comment for
important functions. This not only makes the code easier to understand but also
ensures that any developer looking at the code knows what to expect throughout the
application. It helps improve the readability of source code for other developers.
From making the code easy to understand, it also increases the ability to
maintain and correct errors for the application. It would be bad if developers had to
make changes to the code that required a lot of energy to search and decode.
Looking through unfamiliar code will be much easier if it is well presented and
everything is neatly commented. It helps in unit test implementation to avoid potential
errors. Potential errors can be limited right from the development stage of the
program.
CONCLUSION
REFERENCES
REFERENCES