You are on page 1of 19

ASSIGNMENT 1

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 1: Programming

Submission date May_10_2021 Date Received 1st submission

Re-submission Date May_23_2021 Date Received 2nd submission

Student Name Đặng Huỳnh Xuân Khang Student ID BSAF200020

Class PBIT16101-CNTT1 Assessor name Đào Ngọc Anh

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
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:


Lecturer Signature:
I. Definition of Algorithm.............................................................................................................................................................................3
II. Flowchart:............................................................................................................................................................................................5
1. Flowchart algorithm:........................................................................................................................................................................5
2. Examples (some flowcharts and code, result)..................................................................................................................................6
III. Steps in program development and Program Development Life Cycle.........................................................................................7
IV. SCENARIO.......................................................................................................................................................................................10
V. REFERENCES:......................................................................................................................................................................................17
What is programming?

Programming is the process of creating a tutorial that tells the computer how to perform a task. Setup can be done in a variety of
computer setup languages, such as JavaScript, Python, and C ++.

I. Definition of Algorithm
1. In math and computer science, an algorithm, also known as an algorithm, is a finite set of well-defined instructions that can be
performed with a computer, often to solve a problem class. problem or to perform a calculation. Algorithms are always clear
and used to specify the execution of calculations, data processing, automated inference, and other operations.

As an efficient method, an algorithm can be represented in a finite amount of space and time, and in a well-defined formal
language to compute a function. Starting from the initial state and the initial (possibly blank) input, instructions describe a
calculation that, when executed, proceeds through a finite number of well-defined successive states, finally creates "output"
and terminates in the final end state. The transition from one state to the next is not necessarily deterministic; Some
algorithms, called stochastic algorithms, incorporate random inputs.
2. It is a step-wise representation of a solution to a given problem, which makes it easy to understand.
An algorithm uses a definite procedure.
It is not dependent on any programming language, so it is easy to understand for anyone even without programming
knowledge.
3. Unambiguous − Algorithm should be clear and unambiguous. ...
Input − An algorithm should have 0 or more well-defined inputs.
Output − An algorithm should have 1 or more well-defined outputs, and should match the desired output.
4. Example 4: Write the first 100 natural number calculation algorithm
S = 0;
S1 = S + 1;
S2 = S1 + 2;
S3 = S2 + 3;
...
S100 = S99 + 100
Identify the problem:

Input: The first sequence of 100 natural numbers


Output: The value of the sum 1 + 2 +… + 100
Description algorithm:

Step 1. SUM ←← 0; i ←← 0

Step 2. i ←← i + 1

Step 3. If i ≤≤ 100, then SUM ←← SUM + 1 and go back to Step 2

Step 4. Announce the result and end the algorithm


II. Flowchart:
1. Flowchart algorithm:

What is a flow chart?


Flow chart is essentially a type of chart that is often used to show the steps in a certain process. Flow charts or flow
charts are often used to support training, planning, or documentation activities. This is a chart type that can be very helpful for you
when it comes to making decisions. This type of flowchart is very often used arrows to illustrate a next step in a certain cycle.
Symbols in flowchart

: Start / End the program

: Conditional branching

: Direction solution

: Input

: Output
: Treatment / calculate / assigned

: Return

: Connection point

2. Examples (some flowcharts and code, result)


III. Steps in program development and Program Development Life Cycle
Steps in program development
The following are six steps in the Program Development Life Cycle:
Step 1: Analyze the problem. The computer user must figure out the problem, then decide how to resolve the problem - choose a
program.
Step 2: Design the program. ...
Step 3: Code the program. ...
Step 4: Debug the program. ...
Step 5: Formalize the solution. ...
Step 6: Document and maintain the program.
Programming Development Life Cycle
The various stages are as follows and Explaination :
1) Planning: Planning is one of the most essential stage od SDLC. It helps the user to plan the requirements, needs, timetable, costs,
work time and tools they would need to implement.
2) Analysis: This is the second foremost step in designing software. It is the phase of identifying the actual problem. To identify and
know all the needs of it.
3) Designing: Designing is a significant part of the development cycle. It includes designing the architecture, user interface,
programming, communications and security. You can also create your work using a flowchart or algorithm.
4) Implementation: The next step of programming development life cycle is to write the coding as you planned. Programmer must
know a programming language and follow its rules, violation of any law causes the error. This might take you a few hours to work on
but depends on the task.
5) Testing: This is another time-consuming phase. In this step, you need to test your program, identify any problems and debug it.
You would also need to check it on different systems to see if it’s compatible with different kind of devices.
6) Documentation: Any program is useless unless it is documented. There are two types of documentation.
User Documentation
Machine Documentation
Bith of these types is essential to operate the program and for any future guidance.
7) Maintenance: Like any other product programs require maintenance too. After the installation, if there is any need for
modification in future.
Conclusion
SDLC would help any programmer to work in a structured way. All the steps are very clear and defined. Also, it makes it easier to
manage and operate programs.

Determine the steps taken from writing code to execution. (M1)  

II.4 Evaluate the relationship between the written algorithm and code variant (D1)
IV. SCENARIO
1. Problem: Restaurant food management
2. Solution: Display restaurant information such as address, phone number, email, ... dish information such as: dishes, selling
prices, ingredients
3. Flowchart and algorithms of scenario
4. Coding, testing and result:
- Code
using System;
namespace Ass_2re__
{
class infoFood
{
private string Tenmonan { get; set; }
private string Thanhphanchinh { get; set; }
private string Thanhphanphu { get; set; }
private string Loaimonan { get; set; }
private string Gia { get; set; }
public infoFood() { }
public void CheckinfoFood()
{
Console.Write("---Menu---");
Console.WriteLine("------");
Console.WriteLine("Ten mon: ");
Tenmonan = Console.ReadLine();
Console.WriteLine("Thanh phan chinh: ");
Thanhphanchinh = Console.ReadLine();
Console.WriteLine("Thanh phan phu: ");
Thanhphanphu = Console.ReadLine();
Console.WriteLine("Loai mon an: ");
Loaimonan = Console.ReadLine();
Console.WriteLine("Gia: ");
Gia = Console.ReadLine();
}
public void ShowinfoDetail()
{
Console.WriteLine("Ten mon an la: " + Tenmonan);
Console.WriteLine("Thanh Phan chinh la: " + Thanhphanchinh);
Console.WriteLine("Thanh phan phu la: " + Thanhphanphu);
Console.WriteLine("Loai mon an: " + Loaimonan);
Console.WriteLine("Gia: " + Gia);
}
}
}

- Testing and result:


V. REFERENCES:

Definition of Algorithm, không ngày tháng [Trực tuyến]


Available at: https://www.merriam-webster.com/dictionary/algorithm

Example 4, không ngày tháng [Trực tuyến]


Available at: https://www.quora.com/How-do-you-write-an-algorithm-to-find-the-sum-of-the-first-100-numbers

FlowChart, không ngày tháng [Trực tuyến]


Available at: https://ismq.org.vn/flow-chart-la-gi/

Programming Development Life Cycle, không ngày tháng [Trực tuyến]


Available at: https://accuwork.net/programming-development-life-cycle/

Steps in program development, không ngày tháng [Trực tuyến]


Available at: https://www.google.com/search?
q=Steps+in+program+development&oq=Steps+in+program+development&aqs=chrome.0.69i59j69i60.294j0j4&sourceid=chrome&ie
=UTF-8

You might also like