Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Trần Hữu Đức ASM2 Programming 2023

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 58

BTEC FPT INTERNATIONAL

COLLEGE

INFORMATION
TECHNOLOGY
ASSIGNMENT 2
UNIT: PROGRAMMING

STUDENT : TRAN HUU DUC


CLASS : SE06202
STUDENT ID : BD00423
SUPERVISOR : NGUYEN HOANG ANH VU

Da Nang, August 2023


ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 1 HND Diploma in Computing

Unit number and


Unit: Programming
title

Date received (1st


Submission date 07/08/2023 14/08/2023
submission)

Re-submission Date received (2nd


date submission)

Student name TRAN HUU DUC Student ID BD00423

Class SE06202 Assessor name Nguyen Hoang Anh Vu

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:

DUC

Grading grid:

P2 P3 P4 P5 M2 M3 M4 D2 D3

Perform by Quoc Viet


❒Summative Feedbacks: ❒Resubmission Feedbacks:

Grade: Assessor Signature: Date:


Internal Verifier’s Comments:

Signature & Date:

Performed Student: Tran Huu Duc


ACKNOWLEDGMENTS

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.

In addition to my mentor, I would like to thank my friends who have helped me


improve my knowledge of my subject. Not only that, they are always there to support me
when I need it. And besides, I would like to thank the school for creating all conditions for
me to have adequate facilities to help me complete my work.

Last but not least, I would like to thank my family, 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!

Performed Student: Tran Huu Duc


ASSURANCE

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.

Declaration of the learner

I verify that the work I've submitted for this assignment is all my own, and that all
research sources have been properly credited.

Signature of the student: Date:

Performed Student: Tran Huu Duc


TABLE OF CONTENT

INSTRUCTOR/ SUPERVISOR/ ASSESSOR.........................................................................i

REVIEWERS.........................................................................................................................ii

ACKNOWLEDGMENTS.......................................................................................................iv

ASSURANCE........................................................................................................................v

TABLE OF CONTENT..........................................................................................................vi

LIST OF TABLES AND FIGURES.....................................................................................viii

LIST OF ACRONYM.............................................................................................................xi

INTRODUCTION...................................................................................................................1

CHAPTER 2: PROBLEMS RELATED TO PROGRAMMING METHODS AND


INTEGRATED DEVELOPMENT ENVIRONMENT (IDE) ....2

2. Explain the characteristics of procedural, object-oriented and event-driven


programming, conductan analysis of a suitable Integrated Development Environment (IDE).
(LO2) 2

2.1 Give explanations of what procedural, object-oriented and event-driven


paradigms are; their characteristics and the relationship between them. (P2)......................2

2.1.1 edural-oriented programming (POP) ............................................. 2

2.1.2 ct-oriented programming system (OOPs)......................................4

2.1.3 ent driven programming (EDP).......................................................7

2.1.4 The relationship among event driven programming (EDP) and


object-oriented programming system (OOPs) and procedural-oriented programming
(POP)……………………………………………………………………………………………. 10

2.2 Analyse the common features that a developer has access to in an


Integrated Development Environment (IDE). (M2)...............................................................11

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

CHAPTER 3 THE PROCESS OF DEVELOPING A SOFTWARE USING AN


INTERGRATED DEVELOPMENT ENVIRONMENT(IDE) 27

Performed Student: Tran Huu Duc


3. Implement basic algorithms in code using an IDE (LO3) and determine the
debugging process and explain the importance of a coding standard (LO4)….................27

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

Performed Student: Tran Huu Duc


LIST OF TABLES AND FIGURES
Table 2-1: Compare of OOP and POP10..............................................................................2
Table 2-2: Compare value types………………………………………………………………...16
Table 4-1: Name objects......................................................................................................53

Figure 2-1: Procedural programming.....................................................................................2


Figure 2-2: The characteristics of POP..................................................................................3
Figure 2-3: Source code of POP............................................................................................3
Figure 2-4: Result of an example...........................................................................................3
Figure 2-5: OOP.....................................................................................................................4
Figure 2-6: Example of Class.................................................................................................4
Figure 2-7: Example of Objects.............................................................................................4
Figure 2-8: Example of Data Encapsulation..........................................................................5
Figure 2-9: Example of Inheritance........................................................................................5
Figure 2-10: Polymorphism....................................................................................................5
Figure 2-11: Source code of OOP.........................................................................................6
Figure 2-12: Result of OOP...................................................................................................6
Figure 2-13: Event driven programming................................................................................7
Figure 2-14: Example of EDP................................................................................................7
Figure 2-15: EDP...................................................................................................................8
Figure 2-16: Example of EDP................................................................................................9
Figure 2-13: Source code of EDP..........................................................................................9
Figure 2-18: Integrated Development Environments...........................................................11
Figure 2-19: IDEs.................................................................................................................11
Figure 2-20: Features of the IDE.........................................................................................12
Figure 2-21: Editor of text....................................................................................................12
Figure 2-22: Debugger.........................................................................................................13
Figure 2-23: Completion of the code....................................................................................13
Figure 2-24: Support for programming languages...............................................................14
Figure 2-25: Microsoft visual studio and C#.........................................................................15
Figure 2-26: Diagram recursion...........................................................................................17
Figure 2-27: Create a new class..........................................................................................17
Figure 2-28: Enter name......................................................................................................18
Figure 2-29: Levels of access..............................................................................................19
Figure 2-30: Encapsulation..................................................................................................21
Figure 2-31: Source code of Encapsulation.........................................................................22
Figure 2-32: Form Login and Register.................................................................................23
Figure 2-33: Source code of form Login and Register.........................................................24
Figure 2-34: Form Login and Register.................................................................................25
Figure 2-35: Invalid Form Login and Register......................................................................25
Figure 2-36: Successful Form Login and Register...............................................................26
Figure 3-1: Casio 570-VN....................................................................................................28

Performed Student: Tran Huu Duc


Figure 3-2: Source code of Casio........................................................................................29
Figure 3-3: Source code of Casio........................................................................................30
Figure 3-4: Source code of Casio........................................................................................31
Figure 3-5: Source code of Casio........................................................................................32
Figure 3-6: Source code of Casio........................................................................................32
Figure 3-7: Testing...............................................................................................................33
Figure 3-8: Invalid Value......................................................................................................34
Figure 3-9: Testing...............................................................................................................35
Figure 3-10: Enter Value......................................................................................................36
Figure 3-11: Open Project....................................................................................................37
Figure 3-12: Select Options.................................................................................................38
Figure 3-13: Create a new project.......................................................................................39
Figure 3-14: A new project...................................................................................................39
Figure 3-15: Create a new form...........................................................................................40
Figure 3-16: Form Login......................................................................................................40
Figure 3-17: Add new item...................................................................................................41
Figure 3-18: IDEs.................................................................................................................42
Figure 3-19: Bugs................................................................................................................43
Figure 3-20: Bug CS0103....................................................................................................44
Figure 3-21: Bug CS0117....................................................................................................45
Figure 3-22: Debug..............................................................................................................45
Figure 3-23: Bug CS0117....................................................................................................45
Figure 3-24: Debug..............................................................................................................46
Figure 3-25: Bug CS0103....................................................................................................46
Figure 3-26: Testing.............................................................................................................47
Figure 3-27: Result..............................................................................................................47
Figure 28: Form Login..........................................................................................................47
Figure 3-29: Bug..................................................................................................................48
Figure 3-30: Bug..................................................................................................................48
Figure 3-31: Fix bug.............................................................................................................49
Figure 3-32: Testing.............................................................................................................49
Figure 3-33: Effects of the debugger...................................................................................50
Figure 3-34: Look in the error list table for a syntax error....................................................51
Figure 3-35: Look over the alert for any problems..............................................................51
Figure 3-36: Effects of the debugger...................................................................................51
Figure 3-37: Command or suspect breakpoint.....................................................................52
Figure 3-34: Coding standard..............................................................................................51
Figure 3-35: Standards........................................................................................................51
Figure 3-36: Indent...............................................................................................................52
Figure 4-1: Form Login........................................................................................................57
Figure 4-2: Source code of form login.................................................................................57
Figure 4-3: Form student management system...................................................................58

Performed Student: Tran Huu Duc


Figure 4-4: Form Personal Information................................................................................58
Figure 4-5: Source code of student management system…...............................................59
Figure 4-6: Source code of personal information.................................................................60
Figure 4-7: Form admin.......................................................................................................61
Figure 4-8: Enter information...............................................................................................61
Figure 4-8: Buttons..............................................................................................................61
Figure 4-9: Student information...........................................................................................61
Figure 4-10: Enter information.............................................................................................62
Figure 4-11: Notification.......................................................................................................62
Figure 4-12: Update information..........................................................................................63
Figure 4-13: Delete information...........................................................................................63
Figure 4-14: Result..............................................................................................................64
Figure 4-15: Sort information...............................................................................................66
Figure 4-16: Search information..........................................................................................67
Figure 4-17: Search information..........................................................................................67
Figure 4-18: Source code of Admin form.............................................................................67
Figure 4-19: Source code of Admin form.............................................................................68
Figure 4-20: Source code of Admin form.............................................................................69

Performed Student: Tran Huu Duc


LIST OF THE ACRONYM

IDE Integrated Development Environment


POP Procedural-oriented programming
OOPs Object-oriented programming system
EDP Event driven programming

Performed Student: Tran Huu Duc


INTRODUCTION
Programming plays an extremely important role in life. Coming to this report, we will
learn about understanding programming models such as procedural programming, object-
oriented programming, and event-oriented programming.
As well as the structure of a program, data, and basic data, while also introducing
students to the use of an integrated development environment (IDE), its functions, and
some standard rules, such as naming in code. At the same time, it assists students in
learning how to create simple apps. Let's find out in this assignment!
This report includes the following:
CHAPTER 2: PROBLEMS RELATED TO PROGRAMMING METHODS AND
INTEGRATED DEVELOPMENT ENVIRONMENT (IDE)
2. Explain the characteristics of procedural, object-oriented and event-driven
programming, conductance analysis of a suitable Integrated Development
Environment
(IDE). (LO2)
CHAPTER 3 THE PROCESS OF DEVELOPING A SOFTWARE USING AN
INTERGRATED DEVELOPMENT ENVIRONMENT(IDE)
3. Implement basic algorithms in code using an IDE (LO3) and determine the
debugging process and explain the importance of a coding standard (LO4)

Performed Student: Tran Huu Duc 1


CHAPTER 2: PROBLEMS RELATED TO PROGRAMMING
METHODS AND IDE
2. Explain the characteristics of procedural, object-oriented and
event-driven programming, conduct an analysis of a suitable Integrated
Development Environment (IDE). (LO2)

2.1 Give explanations of what procedural, object-oriented and


event-driven paradigms are; their characteristics and the relationship
between them. (P2)

2.1.1 cedural-oriented programming (POP)


 Definition Procedural programming:
- Procedural programming is a
programming approach that allows for the
division of functions into a number of processes.
- A huge program is split down into smaller,
more manageable sections called procedures or
functions in procedural programming. Functions
take precedence over data in this case.
Figure 2-1: Procedural programming
- A program in a procedural programming language consists of a series of
instructions, each of which instructs the computer to perform a specific task, such as
reading user input, performing the necessary computation, and presenting the results.

 The characteristics of Procedural-oriented programming (POP):

- A big program is decomposed into smaller, more manageable processes or


functions. This minimizes code duplication, making the code more readable and
maintainable.
- Global variables allow different functions to exchange data. Because functions are
entirely separated, we must declare data in the higher scope if we wish to share it.
- Global data can be changed by functions. Because global data is passed from
function to function, global data in function chains may be changed throughout the
transformation.

Performed Student: Tran Huu Duc 2


- Methodology from the top down. As previously said, procedural programming
employs a top-down approach, with workflow moving from top to bottom.

Figure 2-2: The characteristics of POP


 Advantages, disadvantages procedural programming

 An example of procedural programming: Calculate the circumference, area


of a
Circle.

- To solve the problem, the programs are divided into subroutines, making the
problem simpler and easier to understand.

Figure 2-3: Source code of POP

Performed Student: Tran Huu Duc 3


Figure 2-4: Result of an example

Performed Student: Tran Huu Duc 4


2.1.2 Object-oriented programming system (OOPs)
 Object-oriented programming system (OOPs):
- Object-oriented programming (OOP) is a programming approach that emphasizes the
use of classes and objects to organize and structure code.
- In Object-Oriented Programming (OOP), code is organized into classes, which are small,
reusable units of code that can be used to create objects. These classes serve as user-
defined data types, which can be used to construct objects with specific properties and
behaviors.

Figure 5 OOP

 The characteristics of OOPs:


 Class:
- In object-oriented programming, a class is a template or blueprint that defines the properties
and behaviors of objects of a specific type, essentially allowing the creation of user-defined
data types.
- A class in object-oriented programming represents a collection of objects that share similar
characteristics and behaviors. It defines a set of properties and methods that are common
to all objects of that class.
- Once a class has been defined, multiple instances or objects of that class can be created. In
object-oriented programming, classes serve as user-defined data types that can be used to
create objects with specific attributes and behaviors.
- In object-oriented programming, a class can contain both data and functions, which are
encapsulated into a single unit. For example, the Animal class may include subclasses
such as Dog, Cat, and Fish, each with their own unique properties and behaviors.

Performed Student: Tran Huu Duc 10


 Objects:
- Objects are essential components of software development and serve as the foundation for
building complex programs. They encapsulate data and functions into a single unit, providing
a modular and reusable approach to programming.
- In object-oriented programming, an object is a unique instance of a class that encapsulates
data members and related member functions. The data members represent the state of the
object, while the member functions define its behaviors and actions.
- In object-oriented programming, any entity or concept that can be described by its properties
and behaviors can be represented as an object. This includes tangible objects such as a
person, a place, or a table of data, as well as abstract concepts such as a mathematical
equation or a set of instructions.
- In object-oriented programming, each object has a unique identity and is identified by a
reference to its memory address. Objects are also categorized based on the class they belong
to, which defines their attributes and behaviors. Therefore, each object is instantiated from a
class and is identified by a reference to its memory address.
- Class objects, for example classroom: chair, table, a whiteboard, a projection screen.

Figure 7 Example of Objects

 Data Abstraction:
-Abstraction is the process of hiding complex implementation details while revealing only
essential features.

Performed Student: Tran Huu Duc 10


 Data Encapsulation:
-Data encapsulation is the practice of hiding the internal workings of an object and restricting
access to its internal data, forcing access through well-defined methods.
-Data encapsulation enables the bundling of data and functions that operate on that data
within a single unit to hide data implementation details

Figure 8 Example of Data Encapsulation

 Inheritance:

- Inheritance is a mechanism that allows a new class to be created by inheriting


properties and characteristics from an existing class.
- A superclass or base class is a pre-existing class that can be inherited by other
classes.
- A derived class, also called a subclass, is a type of class that is created by inheriting
attributes and methods from a base or superclass.
-Derived classes inherit some of the properties and behaviors from the base class,
allowing them to reuse code from the base class.

Figure 9 Example of Inheritance


Performed Student: Tran Huu Duc 10
 Polymorphism:
-The ability of an operator or a function to perform actions.
-Polymorphism refers to the ability of objects to take on different forms or behaviors.
-Operators are a specific example of polymorphism.
-Two forms of polymorphism are operator overloading and function overloading.

Figure 10 Polymorphism

 Advantages, disadvantages OOP

- OOP provides a clear modular structure for programs which makes it good for defining
abstract datatypes where implementation details are hidden and the unit has a clearly
defined interface.
- OOP makes it easy to maintain and modify existing code as new objects can be
created with small differences to existing ones.
- OOP provides a good framework for code libraries where supplied software
components can be easily adapted and modified by the programmer. This is
particularly useful for developing graphical user interfaces.

Figure 11 Advantages, disadvantages OOP

Performed Student: Tran Huu Duc 10


 An example of OOP
- Countries, Capitals, and Cities: In this example, we have three object types:
countries, capitals, and cities. Each object type has its own properties and
methods.
- Students, Teachers, and Classes: In this example, we have three object types:
students, teachers, and classes. Each object type has its own properties and
methods.
- Professors: In this example, we create objects representing professors. Every
professor has some properties in common: they all have a name and a subject
that they teach.

2.1.3 Event driven programming (EDP):


- Event-driven programming is a programming paradigm where the program's behavior
is primarily determined by events that occur at runtime, such as user actions, system
events, or network activity.

Figure 12 Event driven programming

- Object-oriented programming system (EDP):Programs frequently utilize


inputs/outputs (I/O) to interact with the outside world. Reading and writing data to
storage, handling touch events, drawing on a display, sending and receiving data over a
network connection, and other similar activities are critical to the operation of every
computer system.


Definition
 The characteristics of EDP:
 Class:
 Objects:
 Data Abstraction:
 Data Encapsulation:
Performed Student: Tran Huu Duc 10
 Inheritance:
 Polymorphism:
 Advantages, disadvantages EDP
 An example of EDP

2.1.4 The relationship among event driven programming (EDP) and object-
oriented programming system (OOPs) and procedural-oriented programming (POP).

Performed Student: Tran Huu Duc 10


2.2 Analyse the common features that a developer has access to in
an Integrated Development Environment (IDE) (M2)
Integrated Development Environment (IDE):

Figure 2-18: Integrated Development Environments


- An integrated development environment (IDE) is a software package that brings
together the essential tools for writing and testing software.
- An integrated development environment (IDE) generally includes a code editor, a
compiler or interpreter, and a debugger, all of which are available through a single
graphical user interface (GUI). In the code editor, the user writes and changes source
code.
- The compiler converts the source code into a machine-readable language that can
be executed. The debugger, on the other hand, examines the software for any flaws or
problems.
 The following are some of the most important advantages of Integrated
Development Environments (IDE):
- Ensure that the development process runs smoothly.
- Boost developer productivity and happiness.
- On time delivery of high-quality software.
- Checks for mistakes automatically to guarantee high-quality code.
- The ability to complete code improves the programming process.
- Developers can use refactoring to perform thorough and error-free name changes.

Performed Student: Tran Huu Duc 11


Figure 2-19: IDEs

Performed Student: Tran Huu Duc 12


- Most, if not all, of a developer's needs, such as version control systems,
debugging tools, and Platform-as-a-Service, may be found in a single environment.

Perform by Tran Huu Duc 13


CHAPTER 3: THE PROCESS OF DEVELOPING A
SOFTWARE USING AN INTERGRATED DEVELOPMENT
ENVIRONMENT (IDE)
3. Implement basic algorithms in code using an IDE (LO3) and
determine the debugging process and explain the importance of a
coding standard. (LO4)
3.1 Write a program that implements an algorithm using an IDE. (P3)
 We will code a software of basic calculator. It includes:
- Solving 2 numbers using addition, subtraction, multiplication, division.
- Solving the first equation degree and the quadratic equation.
 We will divide interface into 2 blocks:
- on the top side, we will use to Solve 2 numbers using addition, subtraction,
multiplication, division.
- on the rest, we will use to Solve the first equation degree and the quadratic
equation.
 Preparation:
- We use winform and C# language to code this software.
- 4 buttons add, subtract, multiply, divide, 3 buttons solute, delete, exit.
- 7 labels and textboxes to input number and show result
- 2 radio buttons and a group box to group them together
 Algorithms:
 Addition, subtraction, multiplication, division algorithms:
- Firstly, we request user input two numbers which they want
- Then they will click buttons which they are addition, subtraction,
multiplication, division.
- And finally, the result will be visible to inform the user
 Solve first-order algorithms of the equation:
- First, in order of importance, we require user input 2 numbers a and b
- Next, shall we check if a is zero? If true, the result will be - b / a. And if not,
we will ask the user to re-enter.
 Quadratic equation solving algorithm:
- We keep asking the user to enter three numbers.
- Next, we will scan three numbers a, b, c to see if they are zero or not?

Perform by Tran Huu Duc 14


- If a, b, c = 0, there is no solution. on the other hand, if a, b = 0 and c is not
equal to 0, the equation has infinitely many solutions
- If a = 0 and b is not equal to 0, solutions of the quadratic equation x = - b /a.
- If a is not 0, we find delta using the formula: b * b - 4 * a * c and compare:
 if delta < 0, there is no solution.
 if delta = 0, Double roots of quadratic equation x = - b / 2 * a.
 if delta > 0, Solutions of the quadratic equation x1 = (-b - (Math.
Sqrt(delta)) / 2 * a) and double x2 = (-b + (Math. Sqrt(delta)) / 2 * a).

Figure 3-1: Casio 570-VN

Perform by Tran Huu Duc 28


 These are source codes:

Perform by Tran Huu Duc 32


 Testing:
- Now, we will test this software that we have created. We enter 2 two numbers, for
example, m = 2 and n = 3. perform addition, subtraction, multiplication, and division
operations in turn to check if the result is correct or not?

Figure 3-7: Testing

Perform by Tran Huu Duc 33


- Absolutely correct, the algorithm worked exactly as we expected. and in addition, if
the user enters the wrong data, the algorithm will display a message asking the user to re-
enter it.

Figure 3-8: Invalid Value


- Next, we continue to test the algorithm for solving first and second order equations but
before that we will check if the radiobox property is working as we want it to?

Perform by Tran Huu Duc 34


3.2 Use the IDE to manage the development process of the
program.
(M3)

- To utilize an IDE for application development management, make sure it supports


the language you're working with. In this part, I'll develop programs using the C #
programming language and Visual Studio to manage them.
- The first step is to install Visual Studio. This is an IDE that is well-known for its
application development and administration capabilities. To take use of new features, we
need upgrade to the most recent version. I'm using the visual 2019 version in this part.

Figure 3-11: Open Project


- The working interface displays once you launch the visual studio, as seen below:
- There will be two primary elements to this interface:
 It displays information about recent projects we've worked on the left side.
 There are functions to access files in other directories or create new files on
the right side.
- Start a project or find a solution: Previously, the project was opened in the default
location that Visual Studio had installed.
- Open a local folder: used to open a project that was downloaded or saved in a
Perform by Tran Huu Duc 35
different folder.

Perform by Tran Huu Duc 36


 Create a new project:
- this command is used to start a new project.
- We'll learn how to use the "make a new project" feature to start a new project.

Figure 3-12: Select Options


- The project templates that we used earlier will then show on the left side.
- Select tabs such as which language to program in, which operating system to work
in, and programming fields such as IoT, web, winform, desktop, game, library, and so on
will display in the middle section.
- In this part, we'll try to make a project with a console and a winform interface using
the C# language on the Windows operating system:
 After choosing a language, operating system, and programming system,
 We give the workspace a name,
 Choose a folder to save it in,
 Select the proper framework,
 Click "create" to have the IDE build the workspace for us.
 A new project has been created

Perform by Tran Huu Duc 37


Figure 3-13: Create a new project
The IDE will create code for us before we begin working in this interface.
We now have a working space. We'll start with a basic program that creates a new
login form.

Figure 3-14: A new project


Perform by Tran Huu Duc 39
Figure 3-15: Create a new form
- F5 is used to start the application. The end result is as follows:

Figure 3-16: Form Login


- The steps to create a new class, interface, or form are as follows:
 Press "ctrl + shift + a" or right-click and select "add -> new item." A new
window emerges after that:

Performed student Tran Huu Duc 40


Figure 3-17: Add new item
- You just need to choose what you want to add to your program, then give it a
name and press add to do it
 Perfect your program!
3.4 Explain the debugging process and explain the debugging
facilities available in the IDE. (P4)
- Debugging is one of the methods for resolving issues such as when source code
fails to compile due to a syntax error or the absence of any element in the structure of a
statement.
- A debugging process software will assist us in correcting frequent faults and
making the program more comprehensive.
- Definition Debugging.

- Debug process. (giải thích các bước)


Step 1: Locate the error

- Step 2: Find the cause of the error: syntax error, declaration error, algorithm

error...
Performed student Tran Huu Duc 40
- Step 3: Error handling

- Step 4: Run test and check

 The following are some of the most frequent bugs techniques:

Figure 3-19: Bugs

Performed student Tran Huu Duc 40


- The above code is an algorithm to find the largest number when the input is three
float numbers a, b, c.
- Let's take a closer look, thanks to the IDE when we write the wrong code or make
an error. The program will show a red dash at the bottom to help the coder to detect his
bug:

Figure 3-20: Bug CS0103


- First, when we press run program or debug program, the console window shows
countless errors that we have accidentally caused.
- Looking at the console window we see:

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.

Perform by Tran Huu Duc 43


 After fixing the bug, our program ran successfully!
 The following are some examples of picture errors:
To begin, I'll need a login form and the source code given below.

Figure 28: Form Login

Perform by Tran Huu Duc 44


Figure 3-29: Bug
- Sometimes, we will get this bug. The reason for the problem is because we
inadvertently removed it because when we double-click on the form, it produces the code
for us, but when we delete a method, the statements for this form are still present.
- After all, it's gone, so it complains that it doesn't know what
“textBox1_TextChanged” means in the source code it creates.
We need to erase the error line it reports to solve it.

Figure 3-30: Bug

Perform by Tran Huu Duc 48


- We click on this link. it will show like that

Figure 3-31: Fix bug


- It will indicate "no problems discovered" once you delete it. Now we can see the
software performing as expected.

Figure 3-32: Testing

Perform by Tran Huu Duc 49


3.5 Evaluate how the debugging process can be used to help
develop more secure, robust applications. (M4)

- Giới thiệu về quá trình gỡ lỗi trong Visual Studio

- Đưa ra đánh giá về quá trình gỡ lỗi trong Visual Studio

+ Ưu điểm

+ Nhược điểm

Đưa ra các ví dụ cụ thể

- When a program confronts the testers and gives erroneous results or fails to
execute, one of the processing duties is debugging. The debugging process improves the
program's robustness and completeness, and it requires it to handle any input or events it
may face.
- To stop hackers clashing and plugging data or crashing systems, apps, powerful
programs will build a restricted detection of weaknesses...
 As a result, the debugger is quite useful in our job. Diagnose problems and,
in certain cases, give a solution for the programmer to implement.
- Most IDEs have a debugger, which assists programmers in writing quicker source
code and eliminating as many errors as possible.

 Effects of the debugger:

Perform by Tran Huu Duc 50


Figure 3-33: Effects of the debugger
- It allows programmers to examine or update variables, code, or any statement
while the program is still running. It prompted me to cease manual debugging so that I
may modify.
- The debugger can readily show and comprehend complicated data structures that
can be managed for multithreading or stacking.
- The debugger is usually connected to the IDE, resulting in a more comprehensive
integrated development environment...
- If we pay attention, the debugger will assist us in learning more and more, learning
more while encountering difficulties.
- Aids in the understanding of issues and the prevention of unintended mistakes.

Perform by Tran Huu Duc 50


 The following debugging technique, in my view, can be used to assist in the
development of more secure, resilient applications:
- Step 1: Look in the error list table for a syntax error.

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.

Figure 3-35: Look over the alert for any problems


Step 3: Run tests for each instance to check the findings on a case-by-case basis.

Figure 3-36: Effects of the debugger


Perform by Tran Huu Duc 51
- Step 4: If anomalous results but no faults are found in steps 1 and 2, we will
personally verify each command or suspect breakpoint from start to end to see each step
variant program.

Figure 3-37: Command or suspect breakpoint


- Step 5: Repeat steps 3 and 4 until the outcome is flawless.

 Examine how processes are debugged:


- Error in direct display:
+ Advantages:
 Show the mistake right away.
 Identify the location and cause of the mistake.
 Make suggestions for proper syntax.
 You will save time.
+ Negative aspects:
 Doesn't allow you to look for errors within the application.
- Manually locate the bug:
+ Benefits include:
 Look for mistakes that occur within the software.
 Keep an eye on the program's progress.
+ Negative aspects:
 A complete waste of time.
 It's a pain to use.

Perform by Tran Huu Duc 52


3.6 Outline the coding standard you have used in your code. (P5)
 Variable:
- Use global variables only when absolutely necessary.
- Explain each function and variable in the comments section.
- Variable names are named as follows:

Use a camel uppercase letter beginning with a tiny letter to identify local
variables in a meaningful and easy-to-understand way.
 Constants should be capitalized
 Global variable names should start with capital letters at the beginning of
each word
 Don't name your variables with numbers.
 This function's name is:
- It must be succinct when describing its function.
- Capitalize the first two letters.
 Indent:
- Each sub-instruction in a block must be indented, making the source code simpler
to understand.
- The opening bracing and closing brace must form a straight column.
If possible, avoid using cryptic code, the functions' lengths should be kept to a
minimum.

Figure 3-40: Indent


 In Winform, there are a few different methods to name objects:

Perform by Tran Huu Duc 53


OBJECT NAME SET NAME FOR OBJECT EXAMPLE

Button btn btnHome

Check Box chk chkGender

Data View dvw dvwInforStudent

Form frm frmLogIn

Label lbl lblNameUser

Link Label llbl llblFacebook

List View lsvw lsvwInforStudent


Numeric Up nud nudHour
Down
Picture Box pic picLogo

Scroll Bar sbr sbrTable

Tab Control tab tabDesign

Textbox txt txtPassword

Timer tmr tmrDeadline

ToolTip tip tipCopy

Tree View tre treBooks

Table 3-1: Name objects


3.7 Scenario:
- You have applied for a post as a trainee with a software development company
and have been invited for an interview. You have been passed the presentation to
demonstrate your problem solving and basic programming skills.
- Now you are given a more challenge task to create a fully working, secure
application that has been developed using an IDE and adheres to coding standards for a
detailed business problem.
3.8 Issues:
- With the current complex condition of the covid epidemic, information technology is
becoming increasingly popular among all people, particularly in education.
- Developing an application that can assist instructors and students in better
managing their time and learning is an unavoidable requirement at this time.

Perform by Tran Huu Duc 54


3.9 Idea:

Perform by Tran Huu Duc 55


- The initial plan was for me to build a score input application to assist teachers in
better managing student scores. The system would have additional commands for adding,
editing, deleting, and searching for students.
- This program will be created in C#, and the integrated development environment
(IDE) will be used by Microsoft Visual Studio is a program that has a number of essential
features that make coding more easy and more convenient.
3.10 Describe the idea of the program algorithm:
- We'll start by creating a log-in form with username, password and login, and
cancel buttons. There will also be checkboxes for show and remember password:
 Users may quickly see if their password is accurate or wrong by using the
show button.
 Remember me button so they don't have to input my password the next time
they log in.
- In addition, I'll redesign the login form to make it more attractive and stylish.
- If we have more time to develop the product in the future, we will split user accounts into
two categories:
 The admin function of the teacher's account allows them to alter grades and
manage students.
 And the student's account includes the ability to check class schedules,
study, and so forth.

Perform by Tran Huu Duc 56


- And before you want to exit the software, the system will display a message to remind
you: "Do you want to exit this program?".

Figure 4-1: Form Login

Perform by Tran Huu Duc 57


 Source code form Login:

Figure 4-2: Source code of form login


- Then we'll go on to the second kind, which is a student management system. This
form was created using BTEC FPT International College's color scheme:
 The school's logo and contact information will appear in the header.
 There will be two primary options in the navigation section: admin and
account information.
 This form's content is broken down into three sections to inform
instructors and students of recent school events:
 Learning information
 Activity information
 Regulation

Figure 4-3: Form student management system


- Personal information and logout are both included in account information:
 Log out allows you to log out of your account and return to the initial login
form.
 The customer's account information is represented by personal information,
which includes the username, account, and password, as well as a new
password changing feature.
display an error notice to the user when they hit update.
Perform by Tran Huu Duc 59
- If the user wishes to update their password, they must first input the new password
and then re-enter it to ensure that they are changing the correct password.
- If the user leaves it blank or re-enters the erroneous password, the program will

display an error notice to the user when they hit update.


Perform by Tran Huu Duc 60
- If they use the right software, they will receive notification that their password has
been successfully changed.

Figure 4-4: Form Personal Information

Perform by Tran Huu Duc 60


 Source code Student Management System:

Figure 4-5: Source code of student management system


 Soure code Personal Information:

Figure 4-6: Source code of personal information


- Admin form will display when you hit the admin button. This is a form designed to make it
easier for teachers to submit student results.

Figure 4-7: Form admin


- This is where each student's information is entered.

Figure 4-8: Enter information


- This section has buttons for adding students, editing, removing, sorting, and
searching students.

Figure 4-8: Buttons


- The student's score input information is displayed in this area.

Perform by Tran Huu Duc 63


Figure 4-9: Student information
- Now let's try to enter a student's information and click “Create” button to add a new
student.

Perform by Tran Huu Duc 64


Figure 4-10: Enter information
- When we enter the wrong information or do not fill in some information, the system
will display a small prompt and then point the cursor to the line to enter:

Perform by Tran Huu Duc 69


CRITICAL EVALUATION

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.

In addition, I have firmly grasped the basic knowledge of programming so I can


definitely create software. Help many people and make life better!

Perform by Tran Huu Duc 70


CONCLUSION
After completing this report, I understood and grasped how to build a basic
algorithm, models such as procedural programming, functional procedures, object-oriented
and event- oriented programming, IDE capabilities, program debugging, and compilation
processes are all covered.

Programming is really amazing! thanks to it I understand how the devices around us


work. This is very interesting and fantastic. Thankyou my Mentor!

Perform by Tran Huu Duc 71


REFERENCES
1. hnglobal.highernationals.com (2021). Cloud Computing, Computing & Digital
Technologies Resource Library [online]. Available:
https://hnglobal.highernationals.com/subjects/computing/resource-library. [Accessed 1
August 2021].

Perform by Tran Huu Duc 72

You might also like