Professional Documents
Culture Documents
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 LUONG
Grading grid
P1 M1 D1
Summative Feedbacks: Resubmission Feedbacks:
i
TABLE OF CONTENT
TABLE OF CONTENT.................................................................................................................ii
LIST OF ACRONYM...................................................................................................................iv
INTRODUCTION........................................................................................................................1
1.1.1 Definition.............................................................................................................2
CONCLUSION..........................................................................................................................21
REFERENCES...........................................................................................................................22
ii
LIST OF TABLES AND FIGURES
Figure:1- 1 algorithm................................................................................................................2
Figure:1- 10 Flowchar..............................................................................................................8
Figure:1- 14 C#.......................................................................................................................14
iii
iv
LIST OF ACRONYM
v
INTRODUCTION
Programming plays a very important role in life. It will help us understand more deeply, what an
algorithm is, understand programming models such as procedural programming, object-oriented
programming, the structure of a program, data, basic data, and introduce
Give students knowledge of IDE rules of naming in code. At the same time, helping students have
the knowledge to build basic applications Coming to this report, we will learn about algorithms,
problems related to algorithms and basic programming. Let's find out in this assignment!
LO1 Define basic algorithms to carry out an operation and outline the process of pro-
gramming an application.
1 Provide a definition of what an algorithm is and outline the process in building an ap-
plication (P1)
1.1.1 Definition
The algorithm consists of specific and explicit steps, each of which has a certain effect and
conditions to perform. It can include basic math operations, conditional statements, loops, and
uses input data to produce the desired output.
The goal of an algorithm is to provide an efficient and accurate process for solving a prob-
lem or performing a task. It provides a clear instruction to take steps and process information in a
structured way, helping to achieve the desired result.Algorithms can be written and implemented
in many different programming languages and can run on different computers or systems.
Figure:1- 1 algorithm
Prepare the necessary ingredients and tools: sausage, cooking oil, pot or pan, stove, plate,
paper or towel.
Step 2:
Heat a pot or pan over medium heat. Make sure the pot or pan is large enough to comfort-
ably hold the sausage.
Fill a pot or pan with enough oil to cover the sausages while cooking. Wait for the oil to
reach frying temperature, which can be tested by dropping a small piece of sausage into the pot. If
it makes a sizzling sound and starts to brown, the oil has reached the right temperature.
Step 4:
Place the sausages slowly into the pot or pan. Take care to avoid hot oil spray. Arrange the
sausages so that they don't overlap and have space between them to spread the heat evenly.
Step 5:
Step 6:
Use a rack to remove the sausages from the pot or pan. Let the sausage drain for a few sec-
onds to remove excess oil.
Step 7:
Place the fried sausages on a plate covered with paper towels or washcloths to absorb ex-
cess oil. Serve hot fried sausages, garnish with ketchup, green onions, or seasonings to your liking.
Pseudocode is usually written in natural language, using keywords, simple syntax, and sim-
ple formatting conventions to describe the steps in the algorithm. It does not require precise syn-
tactic details, but focuses on presenting the logic of the algorithm in a clear and understandable
manner.
Pseudocode helps programmers and readers understand the logic of an algorithm without
worrying about the syntactic details of specific programming languages. It also helps in the analy -
sis, design and presentation of algorithms before implementing them in a particular programming
language.
Here's an example of pseudocode for a simple algorithm that finds the maximum number
in a list of integers:
In this pseudocode, we define a function called findMaximum that takes a list as input. The
function first checks if the list is empty and returns an appropriate message if it is. Otherwise, it as -
sumes that the first number in the list is the maximum and iterates through the remaining num-
Note that this pseudocode does not specify the syntax of a specific programming language
but focuses on expressing the logical steps involved in finding the maximum number. It can be eas-
ily translated into actual code in a programming language of your choice.
A flowchart, also known as a data flow diagram or process diagram, is a graphical tool used
to describe the process or workflow of a system, a workflow, or a program. computer. It provides
an intuitive way to understand and present the steps to be taken and the relationships between
those steps.
Flowcharts are commonly used in systems analysis, process design, programming, and
project management. It helps users to understand and clearly represent process steps, control
conditions and rules, expressions and data handlers.
Flowcharts are typically created using standard symbols and symbols to represent steps,
rules, and data flows. Commonly used symbols and symbols include rectangles to represent execu-
tion steps, circles to represent conditions, arrows to represent links between steps, and more.
Perfomed Student: HUYNH TAN LUONG 7
Using flowcharts, users can easily understand and analyze a process or program, detect er-
rors or optimize, and convey information clearly and uniformly to others.
Figure:1- 10 Flowchar
An algorithm is a logical and ordered set of rules or instructions for solving a problem or
performing a particular task. It is a widely used method in the field of computer science and math -
ematics to solve problems of computation, searching, sorting, data processing, etc.
Input: Each algorithm takes a set of input values. This can be user input, data sets, or other
parameters that the algorithm needs to perform the computation.
Output: The algorithm must produce results after performing the calculation steps. This is
the expected result or goal that the algorithm should achieve based on the input data and the pro-
cessing rules.
Efficiency: Algorithms need to be designed to work efficiently. This means it must use re-
sources such as time and memory optimally. Algorithm efficiency is often evaluated based on time
and space complexity.
Iterative Steps: An algorithm usually contains iterative steps to execute a process many
times until the exit condition is met. Iterative steps make it possible for an algorithm to efficiently
process large data sets or perform a task many times.
Problem Solving: The main goal of an algorithm is to solve a particular problem or perform
a task. The algorithm must provide the necessary steps to achieve this goal efficiently.
Problem Analysis: This step involves understanding the problem or task at hand and
identifying the requirements, constraints, and any other relevant information. It is important to
gather all the necessary details about the problem, including inputs, outputs, and any specific
requirements or limitations.
Design: In this step, a high-level design is created for the program. This includes outlining
the overall structure, modules, algorithms, data structures, and user interfaces. The design phase
helps in planning how the program will be organized and how different components will interact
with each other.
Implementation: The implementation phase involves writing the actual code for the
program based on the design. This is where the chosen programming language and platform are
used to translate the design into executable code. It involves using appropriate programming
constructs, such as functions, loops, and conditional statements, to implement the desired
functionality.
Testing: Once the code is implemented, it needs to be thoroughly tested. Testing involves
running the program with different inputs and scenarios to verify that it produces the expected
output and handles errors or exceptions correctly. This includes both unit testing, which tests
individual components or modules, and system testing, which tests the program as a whole.
Debugging: During testing, issues or bugs may be identified. The debugging phase involves
identifying and fixing these errors or bugs. It can be done using debugging tools, which help in
identifying the specific cause of the issue, or through manual inspection of the code to locate and
resolve the problem.
Identify the problem to be solved: We need to build a simple registration program to col-
lect user information and register them into the system.
Define functional requirements: The program needs to ask the user for a name, email and
password, and then perform the user registration by calling the RegisterUser() method.
Defining Non-Functional Requirements: For this example, we will assume that registration
simply checks that all fields are not null.
Program Algorithm:
Print out a welcome message and instruct the user to enter the registration information.
Use the Console.ReadLine() command to get the name, email, and password from the user.
In the RegisterUser() method, check that all fields are not null. If true, return true to indi-
cate successful registration. Otherwise, return false.
Based on the results returned from RegisterUser(), print a successful or failed registration
message.
Here we will use C# language to design the program and visual studio to run the program
User Interface Design: In this example, we use the simplest way to communicate with the
user via the command line. Use the Console.WriteLine() commands to print the message and Con -
sole.ReadLine() to get the user information.
Design the program structure: The program has two main methods:
RegisterUser() method: The function that registers the user. This function takes the user in-
formation and checks if they are valid.
Step 4: Programming
Program Code: The source code provided in the previous example is a complete version of
the program registered in C#.
Perfomed Student: HUYNH TAN LUONG 15
Figure:1- 17 Source code
Syntax and logical error checking: Use the integrated development environment (IDE) or
compiler to check the program syntax and see if there are any logical errors. This includes testing
variables, conditional statements, and loops to see if they work as expected.
Command using System; Allows the program to use the classes and methods available in
the System namespace, including the string data type.
After adding the using System; line, the program will recognize string as a valid data type
and the "string function declaration not found" error will be resolved.
The error "character '{'" not found occurs when the program is missing the { sign after the
method declaration Main(string[] args). This error occurs because of a syntax error in the
declaration of the Main method. To fix this error, you need to add { right after the Main method
declaration.
The { after the Main method declaration marks the beginning of the Main method's
execution block. You need to make sure that { is added after the Main(string[] args) method
declaration to ensure valid syntax.
Step 6: Test
Perform functional testing: Run the program and check if the user registration works as
expected. Make sure to test with different input values to ensure that the program works properly
in all situations.
Program Deployment: Copy or deploy the program to a real environment for use.
Maintenance and upgrades: Monitor the program post-deployment, fix bugs, and improve
functionality if necessary.
After completing this report, I would like to thank Mr. Nguyen Hoang Anh Vu for his help,
.Thanks to him, I understand how the devices around us work. That is very interesting and won-
derful. Thank you my mentor!
Objectives and Research Question: they are well-defined and aligned with the current
knowledge and issues in the field of programming. And of course, they are specific and measur -
able, allowing for clear conclusions and further academic research.
1. https://aws.amazon.com/vi/what-is/sdlc/#:~:text=The%20software%20development%20life -
cycle%20(SDLC,expectations%20during%20production%20and%20beyond.
2. https://stackify.com/what-is-sdlc/
3. https://www.softwaretestinghelp.com/software-development-life-cycle-sdlc/
4. https://www.javatpoint.com/software-engineering-software-development-life-cycle
5. https://www.techtarget.com/searchsoftwarequality/definition/systems-development-life-cy -
cle