0% found this document useful (0 votes)
123 views83 pages

ASM2 PhanLamQuocViet IT16102 Programming

The document is an assignment submission for a programming unit. It includes coversheets with the student's information and declarations. The table of contents outlines that it will analyze programming paradigms like procedural, object-oriented, and event-driven programming. It will also discuss using an integrated development environment to implement algorithms, manage the development process, and facilitate debugging. The document evaluates using an IDE versus not using one and stresses the importance of coding standards for development.

Uploaded by

hoangvu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views83 pages

ASM2 PhanLamQuocViet IT16102 Programming

The document is an assignment submission for a programming unit. It includes coversheets with the student's information and declarations. The table of contents outlines that it will analyze programming paradigms like procedural, object-oriented, and event-driven programming. It will also discuss using an integrated development environment to implement algorithms, manage the development process, and facilitate debugging. The document evaluates using an IDE versus not using one and stresses the importance of coding standards for development.

Uploaded by

hoangvu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 83

BTEC FPT INTERNATIONAL COLLEGE

INFORMATION TECHNOLOGY
ASSIGNMENT 1
UNIT: PROGRAMMING

STUDENT : PHAN LAM QUOC VIET


CLASS : IT16102
STUDENT ID : BDAF200035
SUPERVISOR : NGUYEN HOANG ANH VU

Da Nang, August 2021

Perform by Quoc Viet


ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 4 HND Diploma in Business

Unit number and


Unit: Programming
title

Date received (1st


Submission date 14/08/2021 14/08/2021
submission)

Re-submission Date received (2nd


date submission)

Student name Phan Lam Quoc Viet Student ID BDAF200035

Class IT16102 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:

Quoc Viet

Grading grid:

P2 P3 P4 P5 M2 M3 M4 D2 D3 D4

Perform by Quoc Viet


❒Summative Feedbacks: ❒Resubmission Feedbacks:

Grade: Assessor Signature: Date:


Internal Verifier’s Comments:

Signature & Date:

Perform by Quoc Viet


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: 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!

Perform by Quoc Viet


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:

Quoc Viet

Perform by Quoc Viet


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 Procedural-oriented programming (POP)......................................2

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

2.1.3 Event 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

Perform by Quoc Viet


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

Perform by Quoc Viet


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

Perform by Quoc Viet


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

Perform by Quoc Viet


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

Perform by Quoc Viet


LIST OF THE ACRONYM

IDE Integrated Development Environment


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

Perform by Quoc Viet


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)

Perform by Quoc Viet 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 Procedural-oriented programming (POP)


❖ 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.

Perform by Quoc Viet 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


- 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

Figure 2-4: Result of an example


Perform by Quoc Viet 3
2.1.2 Object-oriented programming system (OOPs)
❖ Object-oriented programming system (OOPs):
- The Object-Oriented Programming (OOP) System is a programming paradigm that
emphasizes the use of classes and objects in your code.

- Object-Oriented Programming (OOP) is a


programming language that divides a language into
small, reusable chunks of code called classes, which we
may use as a user-defined Data Type to construct objects. Figure 2-5: OOP
❖ The characteristics of OOPs:
▪ Class:
- A class can be used to turn things into user-defined data types.
- A class is a group of things that have the same attributes, behave in the same
way, and have the same connection.
- Once a class has been specified, any
number of objects belonging to that class can be created.
User-defined data types are known as classes.
- Data and functions can both be stored in
a class. Animal class, for example, includes dog class,
cat class, and cow class. Figure 2-6: Example of Class
▪ Objects:
- Objects are the fundamental building elements of every software.
- A collection of data members and related member functions is referred to as an
object.
- A person, a place, or a table of data can all be
represented as an object.
- A unique name is assigned to each object.
Each item must belong to a certain class.
- The objects of the class, for example, are a
chair, a table, and a whiteboard (class). Figure 2-7: Example of Objects
▪ Data Abstraction:
- The technique of expressing key properties without providing background details or
explanations is known as data abstraction.

Perform by Quoc Viet 4


▪ Data Encapsulation:
- Data encapsulation is the process of combining data and function into a single entity.
- Data encapsulation allows data and information to be hidden.

Figure 2-8: Example of Data Encapsulation


▪ Inheritance:
- The process through which one object may acquire and utilise the attributes of
another object is known as inheritance.
- A base class or superclass is a class that already
exists.
- A derived class, often known as a subclass, is a new
type of class.
- Some of the attributes of the base class are shared
by the derived class. As a result, derived classes can reuse
code from base classes. Figure 2-9: Example of Inheritance
▪ Polymorphism:
- An operator's and a function's capacity to take
action.
- Polymorphism is the term for having many
forms.
- Operators are several forms of polymorphism.
- Overloading and function overloading are two.
Figure 2-10: Polymorphism
- An example of object-oriented programming: We create a class parents as
animals and in class parents there are two subclasses dog and cat.

Perform by Quoc Viet 5


Figure 2-11: Source code of OOP

Figure 2-12: Result of OOP


Perform by Quoc Viet 6
2.1.3 Event driven programming (EDP):
❖ Event driven programming (EDP):
- Event-driven programming is a system
design paradigm in which events such as user
actions, messages from other programs, GPS
signals, or hardware (sensor) inputs control the logic
flow inside the program. Figure 2-13: Event driven programming
- Inputs/outputs (I/O) are frequently used by programs to deal with external events.
Reading and writing from storage, managing touch events, drawing on a screen, sending
and receiving data over a network link, and so on are the basis of every computer system.
❖ The characteristics of event-driven programming (EDP):
▪ Service Oriented:
- Service oriented programming is a major element of event-driven programming that is used
to build programs for services.
- It does not slow down the computer since service oriented programming uses very little
processing power and generally runs in the background of the operating system.
▪ Time Driven:
- Time driven programming is a paradigm in event driven programming; it's code that
runs on a time trigger.

Figure 2-14: Example of EDP

Perform by Quoc Viet 7


- Time driven programming can be a specific code that runs at a specified time, such
as once an hour, once a week, or once a month; it's a pre-set to do job.
▪ Event Handlers:
- When a certain event is triggered, event handlers are a sort of function or method
that performs a specified action.
- For example, an event handler may be a button that displays a message when the
user clicks it and closes the message when the user clicks the button again.
▪ Functions of Triggers:
- In event-driven programming, trigger functions are functions that determine what
code to execute when a certain event happens.
- They are also used to determine which event handler to use when a specific event
occurs.
▪ Events:
- Mouse, keyboard, and user interface events must be triggered in the program for
them to occur, which means the user must interact with an item in the program, such as
clicking a button with a mouse, selecting a button with the keyboard, and so on.

Figure 2-15: EDP


▪ Ease of Development and Simplicity of Programming:
- Because event-driven programming is extremely visible, it is simpler and easier to
program than other types of programming. For example, you can add a button by just
selecting it, placing it on a form, and writing a code for it.
- Because it allows the user to stop the code while it is running, event-driven
programming makes it simple for users to integrate pre-written code scripts into an existing
application. As a result, creating using event-driven programming is simple.
- An example of Event driven programming:
Perform by Quoc Viet 8
• Create a winform in the project and create it like this: The following
example takes two integers from the user and adds, subtracts, multiplies, or
divides them using the keys A, S, M, and D, respectively. The text fields will
be cleared if you press C, and the form will be closed if you press X.

Figure 2-16: Example of EDP


• Give the controls the following attributes.
▪ TextBox1 Name: TxtNum1
▪ TextBox2 Name: TxtNum2
▪ TextBox3 Name: TxtResult
• In the form's keypress event, write the code.

Figure 2-13: Source code of EDP


2.1.4 The relationship among event driven programming (EDP) and object-
oriented programming system (OOPs) and procedural-oriented programming (POP).
Perform by Quoc Viet 9
Compare of OOP and POP:

Table 2-1: Compare of OOP and POP

Perform by Quoc Viet 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.

Figure 2-19: IDEs


Perform by Quoc Viet 11
- 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.
❖ Common Features of the IDE:

Figure 2-20: Features of the IDE


▪ Editor of text:

Figure 2-21: Editor of text


- Almost every IDE will have a text editor for writing and manipulating source code.
- Some programs feature visual components that allow you to drag and drop front-
end components, but most have a basic interface with syntax highlighting for each language.

Perform by Quoc Viet 12


▪ Debugger:

Figure 2-22: Debugger


- Debugging software aids users in locating and correcting problems in source code.
To evaluate functionality and performance, they frequently replicate real-world scenarios.
- Before an application is published, programmers and software engineers may
generally test the various parts of code and discover flaws.
▪ Compiler:
- Compilers are software components that convert programming languages into
machine-readable formats, such as binary code. To verify that the machine code is accurate,
it is examined. After that, the compiler parses and optimizes the code to improve
performance.
▪ Completion of the code:

Figure 2-23: Completion of the code


- Code completion capabilities help programmers by recognizing and adding common
code components intelligently. These features decrease the chance of mistakes and
problems while saving developers time while creating code.
▪ Support for programming languages:
Perform by Quoc Viet 13
Figure 2-24: Support for programming languages
- IDEs are usually dedicated to a single programming language, however some do
support several languages. As a result, the first step is to find out which languages you'll be
programming in and then limit down your IDE options appropriately. IDE tools for Ruby,
Python, and Java are examples.
▪ Plugins and integrations:
- It's no surprise that interconnections must be addressed while evaluating IDEs,
given the moniker integrated development environment. Because your IDE serves as your
development gateway, integrating all of your other development tools will enhance
development processes and productivity. Poor integrations may create a slew of problems
and hassles, so make sure you know how well a possible IDE integrates into your existing
tool ecosystem.

2.3 Critically evaluate the source code of an application which


implements the programming paradigms, in terms of the code structure
and characteristics. (D2)
- Every language has its own set of rules for coding. However, the essential portions
on the subject of evaluation and commenting on source code while developing programming
models will be nearly same.
- I'll utilize C # as a programming language to assess each programming model,
structure, and characteristic of the code
Perform by Quoc Viet 14
- I'll provide some examples using the Visual Studio 2019 IDE.

Figure 2-25: Microsoft visual studio and C#


- Regardless of the programming model used, they often have two essential
components:
• used to access pre-programmed or existing libraries
• namespace: This is a strategy for dividing identifiers, data types, and classes
into regions for simple management and to avoid conflicts while using various
libraries from different suppliers.
2.3.1 Procedural-oriented programming (POP):
- A program object class with a static method Main is generally found in the
namespace. This method is referred to as the class's primary function.
- When the program starts, the first main function of all functions is executed.
- Variables defined in separate functions can only be used inside the scope of that
function. As a result, it's possible that it has the same name. It can't, however, match the
global variable.
❖ In the C # procedural programming model, the structure of global variables is as
follows:

Static < datatypes> <variable’s name>;

- 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
}

An example of Structure of the main functions:

Public Static void Main(string[ ] args) {


“The processing instructions are contained in the procedure body.”
}

❖ The parameter: is a function's input.


- There are some sorts of parameters:
▪Parameters with names (C# 4.0 and above)
▪Parameter Ref (Passing Value Types by Reference)
▪Parameters for Output
▪Optional Arguments or Default Parameters (C# 4.0 and above)
▪Parameter that changes throughout time (dynamic keyword).
▪or a value parameter Value Types Are Passed by Value (Value Parameters
in C# Methods)
▪ Params (params)
The following table compares pass-by-reference value types:

Genres Pass by reference Pass by value


The variable in the function call will be Its value is only updated in the
modified if the value of the reference is function body if it is modified in the
changed in the function. function call.

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.

Table 2-2: Compare value types


- Variables or values contained in the function call are referred to as arguments.
- Formal parameters and actual parameters are the two sorts of arguments.
- The real parameter is a specific value that might be variable, constant, or actual
data.
- Because the value of the formal argument can be modified while the function is
being called, it is considered a variable.

Perform by Quoc Viet 16


- The function call is a formal parameter if the parameter in that function is a pass by
reference. The function call is the real parameter if the argument in the function is the pass
by value.
- Each generated function will have a specific function. The advantages of utilizing it
will make the program easier to maintain, modify, and update, and it will be used several
times.
- Nevertheless, there will be no need to rewrite. Scientists have developed a new
algorithm called recursion based on the procedural method.

Figure 2-26: Diagram recursion


2.3.2 Object-oriented programming (OOP)
❖ The program's structure is as follows: We can construct an object class in an existing
namespace or build a new one in the namespace containing the object class.
In Visual Studio, here's how to make a new class:
▪ Step 1: Select add from the context menu by right-clicking.

Figure 2-27: Create a new class


Perform by Quoc Viet 17
▪ Step 2: A new tab will open, and you'll need to pick a new item. Name the "class"
element that you just created.

Figure 2-28: Enter name


▪ Step 3: Select Add from the drop-down menu.
❖ Object-oriented programming's structure is as follows:
• Object-oriented programming techniques in source code have the following
characteristics:

<class access level> <Class name>: <Base class>


{
“Declare components (declare variables)”.
"Declare the class's methods and attributes."
}
- Because one solution may comprise several projects, the level of class access is
used to divide restricting the usage of this class in one project or utilized in another project.
- Base class: This is the class that derived classes utilize to inherit some attributes
and methods from the base class; polymorphism properties of object-oriented programming
will cover this.
- Class members refer to the data and methods that make up a class. The class's
data items are seen as global variables by the class's methods, and the class's methods
can access these data elements.
- Methods are identical to functions, however the function definition differs in that if
the function contains the static keyword, the data components with static are utilized.

Perform by Quoc Viet 18


❖ Levels of access:
▪ Members who are designated as public have access to all other class methods.
▪ Only that class may be used, and only that class is permitted to access the class's
components, therefore it can only be used in the class where it is declared.
▪ Protected: components from the base class will be used by derived classes.
▪ Internal members of class A can be accessed from any Assembly method.

Figure 2-29: Levels of access


➢ When we don't define an access level for a component, the default access level is
private.
There are two methods to utilize this class:
- Method 1:
▪ If the derived class has a connection with the base class, it inherits from this
class.
▪ To use the components of the base class while inheriting, we just need to
name that element in the base class.
- Method 2:
▪ This is used to define the same for large data types such an object, queue,
stack, and so forth.
Structure:
Class name <object name> = new <class name ();

The following is the syntax for creating an array:

Class name [] relative array name = new <class name [quantity];

❖ 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:

public <class name> () {


"Initialize property values".
}
Method for copying the initialization:
- Structure:

public <class name> (<class name> <object name>) {


"Initialize property values".
}
Variables (parameters) are used to set up methods:
- The constructor will be invoked immediately after the class object has been defined.
They are responsible for setting the initial settings as soon as the object is created.
- Structure:

public class name (parameters) {


“initialize values for properties”.
}
Destructor:
- This method will be called immediately after the application or program has been
closed. It is frequently employed to free up memory. In C#, however, this technique may not
be required because it is already supported by the IDE.

<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.

Perform by Quoc Viet 20


- It will receive the value assigned to the property by using the keyword "value" with
set.
- Structure:

public <data types> <new property name> {


get {
return <property name>;
}
set {
<property name> = value;
}
}
Forexample of encapsulate data with properties:

Figure 2-30: Encapsulation


❖ Characteristics of inheritance in object-oriented programming:
Class <parent class name>: <child class name> {
}

- 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.

Figure 2-31: Source code of Encapsulation

Perform by Quoc Viet 22


2.3.3 Event-driven programming (EDP)
- Event-driven programming is widely utilized in fields such as application
programming, winform, WPF (Windows Presentation Foundation), game development, and
so on.
- The event direction's feature is that it captures events from the device's keyboard,
mouse, or sensors.
- Each event is associated with a function, which the computer executes when the
event occurs.
- The object classes are also used to build the program's structure.
❖ The C # event capture structure is as follows:
- There will be a loop waiting for events to happen so that the statements in the
function connected with that event may be executed.
- The loop, on the other hand, waits for events that have already been created, so we
don't need to repeat it.
An example of event-driven programming in winform: Login – Register form
- Firstly, we create a new form like this figure:
▪ 3 labels
▪ 2 textboxs
▪ 2 buttons

Figure 2-32: Form Login and Register

Perform by Quoc Viet 23


- Next, we will code functions of button login and cancel like the following
image:

Figure 2-33: Source code of form Login and Register

Perform by Quoc Viet 24


- Finally, we test the functionality:
▪ You enter username and password information.

Figure 2-34: Form Login and Register

▪ If the user or password is incorrect, a message box will appear informing the
user: "Incorrect information! Please login again".

Figure 2-35: Invalid Form Login and Register

Perform by Quoc Viet 25


▪ if the user information is correct, the message will show: "login succeed"

Figure 2-36: Successful Form Login and Register

Perform by Quoc Viet 26


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 Quoc Viet 27


- 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 Quoc Viet 28


❖ These are source codes:

Figure 3-2: Source code of Casio

Perform by Quoc Viet 29


Figure 3-3: Source code of Casio

Perform by Quoc Viet 30


Figure 3-4: Source code of Casio

Perform by Quoc Viet 31


Figure 3-5: Source code of Casio

Figure 3-6: Source code of Casio

Perform by Quoc Viet 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 Quoc Viet 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?
idea:
- When checked in radiobox solve first order equation, input row c will be hidden
- when checked in radibox solve quadratic equation c will show up for user input.

Perform by Quoc Viet 34


- Definitely, the code did exactly what we wanted. and now we will enter 2 numbers
a and b to be able to solve the quadratic equation.
- Similar to addition, subtraction, multiplication, and division. When the user enters
the wrong data, we will also display a message asking the user to re-enter.

Figure 3-9: Testing


- Next, we continue to try to check whether the quadratic equation works the way we
want it to?
- Therefore, we will try each case in turn to test us as closely as possible:
▪ Case 1: enter a, b, c as three arbitrary numbers other than zero.
▪ Case 2: enter b, c as two arbitrary numbers other than zero and we let a equal
zero.
▪ Case 3: enter c as an arbitrary number other than zero and we let a, b equal
zero.
▪ Case 4: enter a, b, c as zero and see the result
- And finally we press solute for the answer to be displayed.
- Exactly. our algorithm worked efficiently and correctly!
- Last but not least, we will test the operation of the delete and exit buttons:
▪ Delete button is used to delete the calculation in progress.
▪ The exit button is used to exit the program.

Perform by Quoc Viet 35


Figure 3-10: Enter Value

Perform by Quoc Viet 36


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
different folder.
Perform by Quoc Viet 37
❖ 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 Quoc Viet 38


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 Quoc Viet 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:

Perform by Quoc Viet 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.3 Evaluate the use of an IDE for development of applications
contrasted with not using an IDE. (D3)
3.2.1 Evaluate the use of an IDE for development of applications
❖ The Benefits of Using an IDE: When creating a program, using an IDE will save you a
lot of time and work. Among the benefits are:
- Save time and effort:
▪ An IDE's main goal is to make development faster and easier.
▪ Its tools and features are meant to help you manage resources, prevent
mistakes, and give shortcuts.
- Enforce project or business standards:
▪ A group of programmers will adhere to a standard method of doing things just
by working in the same development environment.
▪ If the IDE provides predefined templates, or if code libraries are shared across
multiple team members/teams working on the same project, standards can be
enforced even further.
- Project management: There are two types of project management:

Perform by Quoc Viet 41


▪ To begin with, many IDEs offer documentation tools that either automate the
insertion of developer comments or compel developers to make comments in
several locations.
▪ Second, having a visual representation of resources should make it much
easier to understand how an application is built up rather than having to search
the file system for esoteric files.

Figure 3-18: IDEs


❖ The Drawbacks of Using an IDE: Be aware of some of the drawbacks of using an IDE,
since it may not be appropriate for everyone or in every circumstance.
- Learning curve: IDEs are difficult to master. It will take time and patience to
maximize their benefit.
- A powerful IDE may not be the best tool for new programmers:
▪ It may be extremely hard to learn how to program while also learning how to
use an IDE. Furthermore, for experienced programmers, features and
shortcuts frequently obscure essential but boring elements of a language.
▪ When learning a new language, it's important not to ignore the little things.
▪ Using an IDE might make learning a new language more difficult.
- Won't cure faulty code, processes, or design:
▪ You'll still need to be skilled and thorough.
▪ An IDE will not solve your application's efficiency or performance issues.
▪ Your ability and judgments will determine whether you build a software
3.2.2 Not using an IDE for development of applications
- However, programmers will find it tough to design and create an application if they
do not use an IDE.
- We must create the language's rules, which complicates the compilation of source
code into machine language and makes the task of controlling the application development
process more difficult.

Perform by Quoc Viet 42


- Regardless of whether compilers, editors, or support for a programming language
are available, the process of developing an application requires many more stages, and
users must manually transmit data from step to step for the computer to comprehend.
➢ IDE is an essential tool to make program creation easy, fast and convenient!
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.
❖ The following are some of the most frequent bugs techniques:

Figure 3-19: Bugs


Perform by Quoc Viet 43
- 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.

- Now we continue to look at the console screen to fix bugs.

Perform by Quoc Viet 44


Figure 3-21: Bug CS0117

error CS0117: 'Console' does not contain a definition for 'write'.

- 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.

Figure 3-22: Debug


- Here, as we see the keyword "Write" we misspelled as "write". so we just need to
correct it correctly, the error will be gone.

Figure 3-23: Bug CS0117


Perform by Quoc Viet 45
- Continue, we run the program to see if there are any errors?

error CS0117: 'string' does not contain a definition for 'Parse'

Figure 3-24: Debug


- When we look at it, we find that we entered the wrong type of the value of a.
- At first we declared a to have a float value type, but when we cast it, we set it as
string.
- So we just need to cast it to float so that a is the correct data type.

Figure 3-25: Bug CS0103

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-26: Testing

Figure 3-27: Result


➢ 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 Quoc Viet 47


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 Quoc Viet 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 Quoc Viet 49
3.5 Evaluate how the debugging process can be used to help
develop more secure, robust applications. (M4)
- 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.

Figure 3-33: Effects of the debugger


❖ 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 Quoc Viet 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 Quoc Viet 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 Quoc Viet 52


3.6 Critically evaluate why a coding standard is necessary in a team
as well as for the individual. (D4)
- As we all know, in order to build an application product or a program, we need a
team to collaborate, therefore each individual will be assigned to various duties. However,
after all of the members have completed their tasks, the project will be completed.
- To avoid issues, the code blocks will be integrated to produce a full program. To
accomplish so, we will need to establish standard
rules for naming expressions while development.

- Confusion occurs, and the process of


connecting code to build an application or program
is hampered. Not only that, but it has an impact on
the system maintenance software, coding rules, and
standards, which will allow maintenance personnel
to spend less time deciphering function definitions. Figure 3-38: Coding
standard

Figure 3-39: Standards


❖ What are the functions of the variables?
- Even for individuals, standard code will improve the presentation of the program,
making it easier for other programmers to comprehend when reading it in.
- In the future, development and maintenance will be completed more quickly.
Simultaneously, standardizing the code facilitates reuse and mistake detection.
- Some businesses will establish code standards for each item, such as presentation
when coding, naming variables, functions, and so on, in order to save the cost and time
required to build the part software, application, and so on.
3.7 Outline the coding standard you have used in your code. (P5)
Perform by Quoc Viet 53
❖ 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 Quoc Viet 54


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.8 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.9 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.
3.10 Idea:
Perform by Quoc Viet 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.11 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 Quoc Viet 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 Quoc Viet 57


❖ Source code form Login:

Figure 4-2: Source code of form login

Perform by Quoc Viet 58


- 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.
- 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 Quoc Viet 59
- 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 Quoc Viet 60


❖ Source code Student Management System:

Figure 4-5: Source code of student management system

Perform by Quoc Viet 61


❖ Soure code Personal Information:

Figure 4-6: Source code of personal information

Perform by Quoc Viet 62


- 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.

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 Quoc Viet 63
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:

Figure 4-11: Notification


Perform by Quoc Viet 64
- When the teacher wants to edit the student's student information, just select the
student, edit the information then press the “Update” button.

Figure 4-12: Update information

- 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

Figure 4-13: Delete information

Figure 4-14: Result


Perform by Quoc Viet 65
- Next, when the teacher sorts students by their name, just press the “Sort” button to
sort:

Figure 4-15: Sort information


- When you want to search for student information, the teacher will click on the search
bar and enter the name of the student to search:

Figure 4-16: Search information

Figure 4-17: Search information


Perform by Quoc Viet 66
❖ Source code Admin form:

Figure 4-18: Source code of Admin form

Perform by Quoc Viet 67


Figure 4-19: Source code of Admin form
Perform by Quoc Viet 68
Figure 4-20: Source code of Admin form

Perform by Quoc Viet 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 Quoc Viet 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 Quoc Viet 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 Quoc Viet 72

You might also like