ASM2 PhanLamQuocViet IT16102 Programming
ASM2 PhanLamQuocViet IT16102 Programming
INFORMATION TECHNOLOGY
ASSIGNMENT 1
UNIT: PROGRAMMING
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand
the consequences of plagiarism. I understand that making a false declaration is a form of
malpractice.
Student’s signature:
Quoc Viet
Grading grid:
P2 P3 P4 P5 M2 M3 M4 D2 D3 D4
First of all, I would like to thank my mentor Nguyen Hoang Anh Vu for his constant
support in my studies and research, for his patience, motivation, enthusiasm and rich
knowledge. His guidance has helped me throughout the time of studying and writing this
thesis. Without your wonderful help, I would not have been able to achieve this.
Last but not least, I would like to thank my family: my parents Phan Dinh Quy and
Lam Thi Tam, who gave birth to me from the beginning and supported me spiritually. They
are always behind to care and help me have more motivation to complete the work well!
I declare that this is my work, based on my research, and that I have recognized all
materials and sources utilized in its production, including books, papers, reports, lecture
notes, and any other type of document, electronic or personal communication.
I further declare that I have not previously submitted this assignment for assessment
in any other unit, except where explicit permission has been granted by all unit coordinators
involved, or at any other time in this unit, and that I have not duplicated or stolen ideas from
the work of others in any way.
I verify that the work I've submitted for this assignment is all my own, and that all
research sources have been properly credited.
Quoc Viet
REVIEWERS........................................................................................................................ii
ACKNOWLEDGMENTS......................................................................................................iv
ASSURANCE.......................................................................................................................v
TABLE OF CONTENT.........................................................................................................vi
LIST OF ACRONYM............................................................................................................xi
INTRODUCTION..................................................................................................................1
2.3 Critically evaluate the source code of an application which implements the
programming paradigms, in terms of the code structure and characteristics. (D2) ..............14
3.1 Write a program that implements an algorithm using an IDE. (P3) .........27
3.2 Use the IDE to manage the development process of the program. (M3).37
3.3 Evaluate the use of an IDE for development of applications contrasted with
not using an IDE (D3) ........................................................................................................41
3.4 Explain the debugging process and explain the debugging facilities
available in the IDE (P4)……………………………………………………………………...….43
3.5 Evaluate how the debugging process can be used to help develop more
secure, robust applications. (M4) .......................................................................................50
3.6 Critically evaluate why a coding standard is necessary in a team as well as
for the individual. (D4) ........................................................................................................53
3.7 Outline the coding standard you have used in your code. (P5) …….........53
3.8 Scenario…………………………………………..…………………………….55
3.9 Issues…………………….……………………………………………………..55
3.10 Idea…………………………………….…………………………………..….55
3.11 Describe the idea of the program algorithm….…………………..……….56
CRITICAL EVALUATION……………...………………………………………………………..70
CONCLUSION ...................................................................................................................71
REFERENCES...................................................................................................................72
- A global variable is one that may be used across the whole application.
- A procedural programming technique has the following structure:
❖ Structure of the main functions:
< level range> Static < return data type> < function’s name> (<parameters>) {
“The processing instructions are contained in the procedure body.”
<return> <return value>;
Perform by Quoc Viet 15
}
Definition If we wish to modify the value, we must There will be no changes to the
use the term "ref" or "out" before the variable in the function call.
data type in the argument position in the
declaration and the function call.
❖ Constructor:
- Constructors are divided into three categories:
▪ Constructor by default
Perform by Quoc Viet 19
▪ Method for copying the initialization
▪ Variables (parameters) are used to set up methods
▪ Destructor
Constructor by default:
- Because the IDE currently provides this default method, we may not need to
implement it.
- Structure:
<class name> () {
“Cancel values for attributes”.
}
❖ Encapsulate data with properties:
- The goal of properties is to encapsulate data in order to hide the object's underlying
details, yet the IDE Visual Studio allows you to code by highlighting the property.
- The return value is returned through the new property name with obtaining.
- The goal is to establish inheritance in order to minimize code; the base class may
be used to generate many more derived classes.
- Consider the cat class, which is derived from the animal class. The animal class is
also passed down to the dog class. As a result, the animal class only has to be written once
for the dog and cat classes to inherit, which helps to optimize the code.
- For the following reasons, a child class can only inherit one parent class:
▪ Because class A inherits class B, class B inherits class C, and class C inherits
class A, your program will be affected by a cycle of no breakpoints.
Perform by Quoc Viet 21
▪ Because a child class cannot inherit a large number of super classes, an
"interface" was created to allow multiple inheritances to be used.
▪ However, because the components in the interface are used to declare but
not to define, we must redefine in the subclass when inheriting.
▪ If the user or password is incorrect, a message box will appear informing the
user: "Incorrect information! Please login again".
Error CS0103: The name 'Console' does not exist in the current context.
- This is one of the most basic errors. it's a coder that hasn't added the System library
which is supported by microsoft. This leads to the software's keywords not being recognized.
-The simplest way is to add the System library to the program with the statement:
using System;
- Once we have added the System library, we see that our program has somewhat
reduced bugs.
- The above script of the program means that we may have entered the wrong
keyword syntax.
- All you need to do is point the cursor to that line and correct the syntax you got
wrong.
error CS0103: The name 'max' does not exist in the current context
- The above error means that we did not declare this variable, leading to its non-
existence.
- Now we just need to declare the correct data type of the max variable, the program
will run normally.
- After we have fixed all the errors of the program, we will run it again to see if the
program still has errors or not?
Perform by Quoc Viet 46
- If it continues to have errors, we will continue to fix until there are no more errors.
Figure 3-34: Look in the error list table for a syntax error
- Step 2: Look over the alert for any problems that may have occurred.
- When the teacher wants to delete any student's information, just select that student and
press delete. Before deleting the system will show a message to be sure of the user's choice
After completing this Assignment with my own efforts and with the help of my mentor.
During my study, he was very dedicated to teaching and always answered the questions
that I posed.
Because I have presented very fully the questions that the Assignment brief raised,
with clear examples, source code that I wrote myself. Moreover, I am confident that I can
self-study and can make a software process for business.