You are on page 1of 31

BTEC FPT INTERNATIONAL COLLEGE

INFORMATION TECHNOLOGY

ASSIGNMENT 1
UNIT: PROGRAMMING

STUDENT:NGUYEN TRINH ANH TUAN

CLASS:IT05102

STUDENT ID:BD00096

SUPERVISOR: NGUYEN HOANG ANH VU

Da Nang, July 2022


ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 4 HND Diploma in Business

Unit number and title Unit: Programming

15/06/2022 15/06/2022
Date received (1st
Submission date
submission)

Date received (2nd


Re-submission date
submission)

NGUYEN TRINH ANH BD00096


Student name TUAN Student ID

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

Grading grid

P1 M1 D1

Performed by …..
❒ Summative Feedbacks: ❒Resubmission Feedbacks:

Grade: Assessor Signature: Date:

Internal Verifier’s Comments:

Signature & Date:

Performed by P
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.

Performed by P
ASSURANCE

I declare that this is my work, based on my research, and that I have recognized all materials
and sources utilized in its production, including books, papers, reports, lecture notes, and any other
type of document, electronic or personal communication. I further declare that I have not previously
submitted this assignment for assessment in any other unit, except where explicit permission has
been granted by all unit coordinators involved, or at any other time in this unit, and that I have not
duplicated or stolen ideas from the work of others in any way.

Declaration of the learner

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

Signature of the student: Date:

Performed by P
TABLE OF CONTENT
INSTRUCTOR/ SUPERVISOR/ ASSESSOR ........................................................................................... i
REVIEWERS ..................................................................................................................................... ii
ACKNOWLEDGMENTS .................................................................................................................... iv
ASSURANCE ................................................................................................................................... v
TABLE OF CONTENT ...................................................................................................................... vi
LIST OF TABLES AND FIGURES .......................................................................................................vii
LIST OF THE ACRONYM.................................................................................................................. ix
INTRODUCTION.............................................................................................................................. 1
CHAPTER 1: ALGORITHMS, ISSUES RELATED TO ALGORITHMS AND BASIC PROGRAMMING .............. 2
1. Define basic algorithms to carry out an operation and outline the process of programming an
Application (LO1) .......................................................................................................................2
1.1 Provide a definition of what an algorithm is and outline the process in building an
Application (P1). ..................................................................................................................... 2
1.1.1 Define Algorithms .................................................................................................... 2
1.1.2 The process in building an application ..................................................................... 11
1.2 Determine the steps taken from writing code to execution ( M1). ................................... 16
CRITICAL EVALUATION ................................................................................................................18

CONCLUSION............................................................................................................................... 19
REFERENCES ................................................................................................................................. 20

Performed by P
LIST OF TABLES AND FIGURES

Figure 1-1: Algorithms ..................................................................................................................... 2


Figure 1-2: Prepare chicken ............................................................................................................ 2
Figure 1-3: Pour water in to boil the chicken ................................................................................... 2
Figure 1-4: wait for the chicken to cook ........................................................................................... 3
Figure 1-5: Check if the chicken is cooked ....................................................................................... 3
Figure 1-6: Finish the boiled chicken ................................................................................................ 3
Figure 1-7: Flowchart symbols ......................................................................................................... 4
Figure 1-8: Quadratic inequality ...................................................................................................... 4
Figure 1-9: Determine which number is the biggest ........................................................................ 5
Figure 1-10: Sum of a and b ............................................................................................................. 5
Figure 1-11: Characteristic of Algorithms ........................................................................................ 5
Figure 1-12: Solve first-degree equations
....................................................................................................................................................... 6
Figure 1-13: Source code solve first-degree equations ...................................................................... 6
Figure 1-14: Output solve first-degree equations

....................................................................................................................................................... 6
Figure 1-15: Flowchart symbols........................................................................................................ 7
Figure 1-16: Determine which number is the biggest ....................................................................... 8
Figure 1-17: Sum of a and b ............................................................................................................ 8
Figure 1-18: Solve first-degree equations ......................................................................................... 9
Figure 1-19: Source code solve first-degree equations .................................................................... 10
Figure 1-20: Output solve first-degree equations............................................................................ 10
Figure 1-21: The software development cycle
...................................................................................................................................................... 11
Figure 1-22: Analyzing the Problem ............................................................................................... 11
Figure 1-23: The Algorithms .......................................................................................................... 11
Figure 1-24: Execution of the test ................................................................................................... 12
Figure 1-25: Final Documentation .................................................................................................. 12
Figure 1-26: The software development cycle ................................................................................ 12
Figure 1-27: The software development cycle ................................................................................ 13

Performed by P
Figure 1-28: Design and Prototyping .............................................................................................. 13
Figure 1-29: Source code ............................................................................................................... 14
Figure 1-30: Try three random numbers ......................................................................................... 15

Performed by P
LIST OF THE ACRONYM
CLR Common Language Runtime
CSC Common Service Center
GUI Graphical User interface
IBM International Business Machines
JSC Joint Stock Company
I/O Input/Output
PE Portable Executable
RAM Random Access Memory

Performed by P
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!
 This report includes the following:
Chapter 1: Algorithms, issues related to algorithms, and basic programming.

1. Define basic algorithms to carry out an operation and outline the process of programming

an application.

1.1 Provide a definition of what an algorithm is and outline the process in building an

Application.

1.2 Determine the steps taken from writing code to execution.

1.3 Examine the implementation of an algorithm in a suitable language. Evaluate the


relationship between the written algorithm and the code variant.

Performed Student: 1
CHAPTER 1: ALGORITHMS, ISSUES RELATED TO ALGORITHMS
AND BASIC PROGRAMMING
I.Define basic algorithms to carry out an operation and outline the process of
programming an application. (LO1)
1Provide a definition of what an algorithm is and outline the process in building
an application. (P1)
1.1Define Algorithms
- An algorithm is a method or technique that is
used to solve a problem. It works by having your
computer do a series of predefined actions that define
how to accomplish something, and your computer will
execute it exactly the same way every time.

imples of algorithms in real life: Figure 1-1: Algorithms


Example of algotithm : steps to boil chicken
Step1 : Eliminate the smell of chicken

Figure 1-2Prepare chicken

Step 2: Boil Chicken - Fill the whole chicken with water and cook for 20 minutes

Performed Student: 2
Figure 1-2Pour water in to boil the chicken

Step 3: Note while boiling the chicken

Figure 1-3wait for the chicken to cook

Step 4: Check if the chicken is cooked or not

Figure 1-4Check if the chicken is cooked

Step 5: Finish the delicious boiled chicken

Performed Student: 3
Figure 1-5Finish the boiled chicken

1.2: Ways to demonstrate algotithms


 We generally use one of two methods to represent the algorithm:
The first way: Using Pseudocode.
-Pseudocode is a plain text description of a piece of code or algorithm. It's not really
programming, no scripts, no files and no programs. As the name suggests, it is “pseudocode”.
Pseudocode is not written in any particular programming language.
Example:

Figure 1-6Using Pseudocode

I have an example of a simple natural language face washing algorithm:

 Flowchart symbols:

Performed Student: 4
The second way: Using flowchart .

Figure 1-8: Flowchart symbols


- is a diagrammatic representation of an algorithm
- It uses a variety of symbols to describe the steps necessary to solve an issue.
-A flowchart is a type of diagram or flowchart that represents an algorithm or a workflow. Flowcharts come
in many different forms, and the main purpose of using this type of chart is to give the clearest overview of
the workflows that need to be addressed.

Example: Quadratic inequality

Performed Student: 5
Figure 1-9Quadratic inequality

More information:
he shape of the oval indicates whether the algorithm is at its beginning or end. Its materialis
generally divided into two sections: "beginning" and "ending."

 The following are some examples of flow charts in schematic form:

Performed Student: 6
-Given two numbers a, b enter from the keyboard to calculate the

sum of 2 numbers. ( Figure 1-10)

Figure 1-10: Determine which number is the biggest

~ Given 2 numbers a and b entered from the keyboard compare to.

find the largest number. (Figure 1-11)

Figure 1-11: Sum of a and b

Performed Student: 7
1.3 Characteristic of Algorithms

-Input: An algorithm that takes input values from a specified set.


- Output: From each set of input values, the algorithm will generate output values. The output values are
the solutions of the problem.
- Calculation stopping: After a finite number of steps, the algorithm must stop.
- Determination: At each step, the operation steps must be very clear, without causing ambiguity. To be
more specific, under the same condition two processors performing the same step of the algorithm must
give the same results.
- Correctness (efficiency): First of all, the algorithm needs to be correct, that is, after putting data into the
algorithm, the algorithm works and gives the desired results.
- Universality: The algorithm can solve any problem in the class of problems. In particular, the algorithm can
have inputs that are different tuples in a given domain.

Algorithms always have a beginning and an end: every algorithm starts in an initial state with a particular
set of data and ends with a solution or output. They operate in sequence: an algorithm is made up of a
series of ordered steps. The sequences are specific: each step is clear and there is no room for ambiguity.
Algorithms are abstract: they are models or instructions for ordering processes. The number of steps of an
algorithm is finite.

Figure 1-12Characteristic of Algorithms

Step1 :Feel the problem description. This step is quite difficult and requires a headache to think about it.
Performed Student: 8
Step2: Analyze the problem…
Step3:Build a higher order algorithm…
Step4: Refine the algorithm by adding more detail…
Step5:Review the algorithm.

Problem solving first-degree equations:


Input: Enter number a and b.
Output: Display the solution of the equation.

Figure 1-13: Solve first-degree equations

Performed Student: 9
 Source code:

Figure 1-14: Source code solve first-degree equations

Figure 1-15: Output solve first-degree equations

Performed Student: 10
 Note: When multiple algorithms are used to solve a problem, the solution is the same. We
should select the most efficient algorithm. It will aid in the faster and better performance of our
software.
1.4The process in building an application.
 A set of basic algorithm steps for carrying out a task:
 Step1: Analyze and define the problem
 Step2:Create a solution (with example
algorithm)
 Step3: Program design
 Step4: Code program
 Step5: Debugging the program
 Step6: Testing
 Step7: Deployment and Maintenance

Figure 1-16: The software development cycle

 Defining and Analyzing the Problem:

-We investigates the issue in this stage. we determine the


most effective method for resolving these issues. Studying an
issue is also important since it aids a programmer in making
decisions concerning the following: Figure 0-7-22: Analyzing the Problem
 The data and statistics required for the program's development.
 The way the program will be put together.
 In addition, the language in which the program will work best.
 What is the desired output and in what format is it required, …etc.
 Example of the software development cycle: Solve quadratic equation

Figure 1-17: The software development cycle


Performed Student: 7
 Step 1: Planning. We will use IDE Microsoft visual studio with C# programming language.

Figure 1-18: The software development cycle


 Step 2: Define Requirements.
 Input: Three numbers: a, b, c of the quadratic equation
 Output: The solutions of the equation
 Step 3: Design and Prototyping.
Flow chart:
Start

Input a,b,c

true
valid equation false
X=b/a a=0

true
the equation
has no solution false b=0

Start Equation with infinite


solutions

Figure 1-19: Design and Prototyping


Performed Student: 8
 Step 4: Software Development
Source code:

Figure 1-20: Source code


Performed Student: 9
Step 5: Testing
 Firstly, I try three random numbers to see if the equation works like it should?

Figure 1-21: Try three random numbers


 Next, I let a = 0, b and c be 2 random numbers.

Figure 1-22: a = 0, b and c be 2 random numbers


 Next, I let a = 0, b = 0 and c be a random number.


Figure 1-23: a = 0, b = 0, c be a random number.
 a = 0, b = 0 and c = 0.

 Step 6: Deployment

Figure 1-24: Deployment

Performed Student: 10
When building a website, you'll always have your live website, often known as theproduction
environment or live environment.

-Software Deployment will speed up the installation of software and applications. This will bring many
benefits to businesses such as:

-Speed up business development with useful software solutions. In addition, with software solutions,
enterprises can enhance operational content, thereby enhancing their potential.

- This platform can automate business related solution from there trying to manage the process.

- In the digital era, Software Deployment can help businesses connect to remote devices and users can
work from any device at any time.
 Step 7: Operation and Maintenance
- Web application development is important, but so is system maintenance.

-is the modification of software to the changed environment of the product. Environment here means
all factors outside the product such as business rules, laws, working methods, etc.

- Maintain the safety and security of the software. You've probably heard that, no matter how advanced
the technology is, there are times when there will be holes.

- Use the software without interruption: Just think for a small example, the phone in use with a dead
battery will surely make us angry. When the software reaches the maintenance stage, too, it can't be
said that the software is "out of battery", but it is necessary to periodically check for errors and fix it, so
that the risks can be avoided.

Figure 1-25: Operation and Maintenance

Performed Student: 1
1
M1 Determine the steps taken from writing code to execution.
Step 1 : ATM withdrawal program
Step 2 : Flowchart

Figure 1-26 ATM cash withdrawal flowchart

Performed Student: 1
2
Step 3 : Source code:

Figure 1-27 Code1

Performed Student: 1
3
Figure 1-28 Code2

Step 4 : Run program Input

Figure 1-29 Pin Number

Figure 1-30 Withdraw

Performed Student: 1
4
Figure 1-31 Deposit

Figure 1-32 Quit.

Performed Student: 15
CRITICAL EVALUATION

Performed Student: 16
CONCLUSION
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?
Programming is really amazing! thanks to it I understand how the devices around us work.
This is very interesting and fantastic. Thankyou my Mentor!

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

Performed Student: 20

You might also like