7388 Se06201 BD00338 Asm1 Huynhtanbinh
7388 Se06201 BD00338 Asm1 Huynhtanbinh
7388 Se06201 BD00338 Asm1 Huynhtanbinh
INFORMATION TECHNOLOGY
ASSIGNMENT 1
UNIT: PROGRAMMING
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the con-
sequences of plagiarism. I understand that making a false declaration is a form of malpractice.
Student’s signature:
Tan Binh
Grading grid
P1 M1 D1
Summative Feedbacks: Resubmission Feedbacks:
i
TABLE OF CONTENT
TABLE OF CONTENT.............................................................................................. ii
LIST OF ACRONYM................................................................................................ vi
INTRODUCTION ...................................................................................................... 1
2. Determine the steps taken from writing code to execute. (M1) ....................... 20
ii
CONCLUSION ........................................................................................................ 27
REFERENCES ....................................................................................................... 28
iii
LIST OF TABLES AND FIGURES
Figure: 1- 8 Pseudocode........................................................................................... 5
Figure: 1- 10 Example............................................................................................... 7
Figure: 1- 11 Example............................................................................................... 8
Figure: 1- 24 Results............................................................................................... 19
Figure: 1- 25 Results............................................................................................... 19
iv
Figure: 1- 26 Results
................................................................................................................................ 19
v
LIST OF ACRONYM
IT Information Technology
vi
INTRODUCTION
Programming plays an extremely important role in life. Coming to this report, we will
learn about algorithms, problems related to algorithms and basic programming. It will help
us understand more deeply what is an algorithm, how is an algorithm defined? What is the
process of building an algorithm, and how does the algorithm work? Let's find out in this
assignment!
Algorithms are used in many different domains, including mathematics, computer sci-
ence, engineering, and everyday life. They serve as a blueprint for issue resolution and can
be applied in a variety of methods, including computer languages, pseudocode, flowcharts,
and even in human-readable form.
Figure: 1- 1 Algorithm
1.1.1 Example of algorithm
Step 6: While the tea is steeping, add sugar or milk to taste, if desired
Step 9: Allow the tea to cool down for a few moments before drinking, if necessary
Pseudocode bridges the gap between plain language and actual computer code,
allowing programmers to convey their thoughts and intents before delving into a
programming language's unique syntax. It provides a step-by-step exposition of the
algorithm's logic, making the overall structure and flow of the program easier to understand
and evaluate.
Figure: 1- 8 Pseudocode
Flowcharts aid in visualizing a program's or process's control flow and logic, making
it easier to discover potential bottlenecks, inefficiencies, or places for improvement. They
are often used in software development, process engineering, and problem-solving tasks to
clearly describe and communicate complicated processes.
Flowcharts help individuals comprehend the structure and flow of a program or pro-
cess by providing a visual depiction, assisting in the development, analysis, and document-
ing of various systems and procedures.
Figure: 1- 10 Example
Figure: 1- 11 Example
Perfomed Student: HUYNH TAN BINH 8
❖ Explanation:
This flowchart represents a simple ordering process. Here's the explanation of the
symbols and steps in the flowchart:
Algorithms have various distinguishing qualities that define their nature and function-
ality. Here are some significant algorithm characteristics:
Precise and unambiguous: Algorithms are written with explicit, step-by-step instruc-
tions that eliminate ambiguity and multiple interpretations. Each step must be carefully de-
fined in order for predictable execution to occur.
Finiteness: Algorithms have a clear beginning and end point. They are made up of
a finite number of steps that culminate in the intended result.
Determinism: Algorithms are deterministic in the sense that they always produce the
same output given the same input. There is no chance or variation in their execution.
Time and space efficiency: Algorithms are designed to be time and space efficient.
They aim to do the assignment with the fewest resources possible.
Correctness: For all legitimate inputs, algorithms must generate the proper output.
They must solve the problem as planned while also dealing with all possible edge cases and
exceptions
.
Figure: 1- 12 Characteristics of algorithm
1.3.1 Algorithm Advantages:
❖ Recognize the issue: Acquire a thorough understanding of the issue at hand. De-
termine the input, desired output, limitations, and any special needs or edge situa-
tions.
❖ Break it down as follows: Break the problem down into smaller, more manageable
tasks or subproblems. Determine the major stages required to solve the problem and
consider the algorithm's logical flow.
❖ Select the best algorithmic approach: Based on the problem requirements and
restrictions, choose the best algorithmic technique. Consider issues such as time
complexity, space complexity, and problem domain suitability.
To produce a software program, numerous critical processes are involved in the pro-
gram development process. The following are the typical steps:
Step 2: Planning
Examine the issue. The computer user must first identify the problem, then decide
how to address it - selecting a program. In this example, we must solve quadratic equations
using the keyboard inputs a, b, and c. Solve simple equations if a==0.
Otherwise (a! =0), compute the equation's delta. The equation has no solution if delta
is 0. The equation has a double solution if delta == 0. If delta is greater than zero, the equa-
tion has two unique solutions.
If any issues are discovered during testing, the code must be debugged to rectify
them. The IDE Microsoft Visual Studio in this software indicates that there are certain mis-
takes in the code of my program. As a result, I must identify and resolve the following issues:
Figure: 1- 26 No error
To guarantee that the code gives the right output for a variety of quadratic equations,
it should be tested with various input values.
Figure: 1- 28 Results
Figure: 1- 29 Results
The problem requires building a user account management program in C#. This pro-
gram allows users to create accounts, log in and display account information.
Figure:2- 1 Flowchart
The CreateAccount method is used to create user accounts. It asks the user for a
username and password and then creates a new UserAccount object with this information.
The UserAccount object is added to the accounts list to store account information.
The Login method is used to log into the account. User is required to enter username
and password. The program then searches the list of accounts to see if there are any ac-
counts that match the login information. If found, the program announces successful login
and displays the username. If it is not found, the program reports that the login failed.
The DisplayAccountInfo method is used to display the account information. The user
is asked to enter the username of the account to be displayed. The program then searches
the list of accounts to see if there are any accounts with the corresponding username. If
found, the program displays account information, including username and password. If not
found, the program says that the account cannot be found.
The UserAccount class represents a user account. It has two properties Username
and Password to store information respectively.
If any issues are discovered during testing, the code must be debugged to rectify them.
The IDE Microsoft Visual Studio in this software indicates that there are certain mistakes in
the code of my program. As a result, I must identify and resolve the following issues:
The second is that on the 39rd line, I misspelled "WriteLien" instead of "WriteLine."
To ensure that the code provides the right output for a variety of information, the code
needs to be tested with different input values.
Figure:2- 14 Result
Figure:2- 15 Result
After completing this report, I understood and grasped how to build a basic algorithm,
the process to execute a program, the life cycle of an algorithm, how to draw a flow chart
to explain How does the algorithm work?
https://www.techtarget.com/whatis/definition/algorithm
https://en.wikipedia.org/wiki/Pseudocode
https://www.techtarget.com/searchsoftwarequality/definition/systems-de-
velopment-life-cycle