You are on page 1of 28

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 1: Programming

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Le Tan Trong Student ID GCD18787

Class GCD0807B Assessor name Nguyen Van Loi

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:
Table of Contents
I. ALGORITHM......................................................................................................................................................................................................... 4
1. Definition of Algorithm.................................................................................................................................................................................... 4
2. Characteristic of Algorithm..............................................................................................................................................................................6
II. SOFTWARE DEVELOPMENT CYCLE....................................................................................................................................................................... 8
1. Requirements Analysis..................................................................................................................................................................................... 9
2. Design.............................................................................................................................................................................................................. 9
3. Development................................................................................................................................................................................................... 9
4. Testing........................................................................................................................................................................................................... 10
5. Maintenance.................................................................................................................................................................................................. 10
III. BUILD AN APPLICATION................................................................................................................................................................................. 11
1. Determine the Problem................................................................................................................................................................................. 11
2. Design the Solution........................................................................................................................................................................................ 11
3. Write Pseudo-Code........................................................................................................................................................................................ 11
4. Flowchart....................................................................................................................................................................................................... 13
5. Coding............................................................................................................................................................................................................ 13
6. Test and Debug.............................................................................................................................................................................................. 20
7. Deploy Package for client............................................................................................................................................................................... 22
IV. WRITTEN ALGORITHM AND THE CODE VARIANT...........................................................................................................................................24
1. Examine the implementation of an algorithm in a suitable language:...........................................................................................................24
2. Evaluate the relationship between the written algorithm and the code variant:..........................................................................................24
V. Conclusion......................................................................................................................................................................................................... 25
References................................................................................................................................................................................................................. 26
Table of Figures.......................................................................................................................................................................................................... 26

I. ALGORITHM
1. Definition of Algorithm
According to Wiki [CITATION Wik20 \n \l 1033 ]. In mathematics and computer science, an algorithm is a finite
sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a
computation. Algorithms are always unambiguous and are used as specifications for performing calculations, data
processing, automated reasoning, and other tasks.

Figure 1. Algorithm

For example: The algorithm to solve first order equation P (x): ax + b = c, (a, b, c are real numbers), in a set of real numbers can
be a set of the following steps:
- Input: Enter a, b, c.
- Output: value of x
- Perform according to Pseudocode:
Step 1: Begin

Step 2: Enter the value of a, b, c

Step 3: Calculate d(delta) by using the Formula:

d = b*b – 4*a*c

Step 4: If d > 0. We get x1, x2 by the Formula:

X1 = (-b + sqrt(d))/(2*a)

X2 = (-b - sqrt(d))/(2*a)

Step 5: If d == 0. The formula is:

X1 = X2 = -b / 2*a

Step 6: Print x1 & x2

Step 7: If d < 0. Print “Have not solution”

Step 8: End

- Perform according to Flowchart:


Figure 2. Flowchart Example

2. Characteristic of Algorithm
According to Shlok Bhatt [CITATION Shl19 \n \t \l 1033 ], There are some characteristics which every algorithm should
follow. There are five different characteristics which deal with various aspects of algorithm. They are as follows:

a) Input Specified
The input is the data to be transformed during the computation to produce the output. An algorithm should
have 0 or more well-defined inputs. Input precision requires that you know what kind of data, how much and what
form the data should be

b) Output Specified
The output is the data resulting from the computation (your intended result). An algorithm should have 1 or
more well-defined outputs, and should match the desired output. Output precision also requires that you know
what kind of data, how much and what form the output should be (or even if there will be any output at all!).
c) Definiteness
Algorithms must specify every step and the order the steps must be taken in the process. Definiteness means
specifying the sequence of operations for turning input into output. Algorithm should be clear and unambiguous.
Detail of each step must be also be spelled out (including how to handle errors). It should contain everything
quantitative and not qualitative.

d) Effectiveness
For an algorithm to be effective, it means that all those steps that are required to get to output must be feasible
with the available resources. It should not contain any unnecessary and redundant steps which could make an
algorithm ineffective.

e) Finiteness
The algorithm must stop, eventually. Stopping may mean that you get the expected output OR you get a response
that no solution is possible. Algorithms must terminate after a finite number of steps. An algorithm should not be
infinite and always terminate after definite number of steps.

f) Independent
An algorithm should have step-by-step directions, which should be independent of any programming code. It
should be such that it could be run on any of the programming languages
II. SOFTWARE DEVELOPMENT CYCLE
Software Development Life Cycle (SDLC) is a follow-up process for a software project, within a software
organization. It includes a blueprint that describes how to develop, maintain, change, or upgrade specific software.

To creating a software product involves the following stages:

 Requirements Analysis

 Design

 Development

 Testing

 Maintenance
Figure 3. Software Development Cycle

1. Requirements Analysis
In this part, the requirements analysis department will meet and discuss with customers as well as clarify the functions
and requirements that customers want to build in their software. In fact, when in this phase, software units will have a set
of common questions for projects as well as specific questions for the specific projects to be done.

This is an important part affecting software development and development in the coming time so the requirements
analysis team is usually those who have a lot of experience helping in the process of communicating with the customer.
correctly understand the customer's problem requirements as well as collect project-related information forms for
analysis in the next stage.
2. Design
In this part, based on specification documents, the design department will design and provide a general interface as
well as the programming department will design a detailed interface according to each software function. That is to
actualize the functions in the description document into a software function prototype interface. Then use this software
framework to exchange and agree with customers about the interface and layout. When the customer agrees with the
prototype software design, it will move to the next stage otherwise, comments will be recorded and edited until the
customer agrees with the prototype of the software.

3. Development
During this part, SDLC begins to develop real and products under construction. The programming phase is the phase of
realizing the functions of the software after the customer has agreed on the prototype of the software. In this phase, the
programmer will programmatically handle the functions, the assigned module on request will then transfer to the tester to
perform the testing of the functions under the test case built based on the special document. description.

4. Testing
In this part, testers receive handovers of functionality from the programmer. Then the testers will test these functions
according to the built test cases. During the test according to the test case, if there is an error, the tester will report the
error so that the programmer can handle that function to fix the error.

The process of functional testing, retesting, error reporting, reporting will be executed over and over again until the
programming functions have been implemented in accordance with the specification documents or customer
requirements.
After completing the functions as well as meeting the testing requirements, the software will be deployed for testing in
the customer's environment. If there is a request to edit, the software development team will implement additional and fix
errors so that the software can be accepted.

5. Maintenance
Once a product is tested and ready for deployment, it is officially released to the appropriate market. Product rollouts
sometimes occur in phases according to the organization's business strategy. In the process of using the client's software,
the software development company will have to support and handle errors if any arising during the use process. Here,
there are 2 concepts to note that are:

- Software repair: Repair errors arising in the process of using the client's software.

- Software update (maintenance updates)

Complete maintenance: Modify the software according to customers

Adaptive Maintenance: Modify the software to adapt to the new environment


III. BUILD AN APPLICATION
1. Determine the Problem
In this section, the report will make a plan to solve this problem.

The Problem: After the final test in school, the student does not know how to know their average point and their
academic status.

As a result, it makes students' stresses almost their scholarly comes about. To assist students in easily calculate
their grade results and academic status. Through the subject grades, the user will be able to calculate the normal and
the fastest rating. I built an application that calculates the normal score of the exam and gives the comes about, learning
rankings for students to effortlessly see up.

2. Design the Solution


We offer an arrangement to fathom this issue. Construct an application to enter the data, consider the information
of an understudy. With the equation to calculate grades and reviewing conditions, the app will perform to the screen
the students' scholastic comes about and classify them. Use the flowchart to type in calculations for the program and
construct pseudo-code to mimic the program. At that point type in the official code to construct the application. Name
the extend as Student List Manager. C# programming language used in an IDE programming environment (Visual
Studio 2019). The following part will describe the project in detail.

3. Write Pseudo-Code
Program: Manager Student

Enter the grades of 3 subjects: Math, English, Chemistry


Average = (Math + English + Chemistry) / 3

Do-while:
IF (Average < 5)
FAIL
ELSE IF (Average < 7)
PASS
ELSE IF (Average < 9)
MERIT
ELSE
DISTINTION

Print the student’s average grade and status.

End.
4. Flowchart

Figure 4. Flowchart Program

5. Coding
II used 2 classes to write this program: class Student that contains enterstudent methods, student gender, subject
grade, course averages, and status. The second class is class Program, which only includes the Main method to run the
program compiled from the class Student

 Class Student
- First we call the project name (Namespace Asm_1).
In here, we create a Class named Student.
Declare private variables to be used exclusively in Class Student only.
Variable information about students:
Name has a String data type.
Sex has a data type of Integer.
Math, English, Chemistry has a data type of Double.

Figure 5. Declare variables

- Next, we declare a method allow user enter student’s name and gender.
+ Name
+ Sex: Enter Sex information, we create choices for everyone. This way will help people enter
the correct information
Figure 6. Enter Student name and genger method

Note: To avoid the incorrect input from user, I prefer to use the Try-Catch command to identity the
error. Following here is the loop function Try-Catch to get the input for Student’s gender.

Figure 7. Get student gender

From now, similarly to get the input from user for Student’ scores.
Figure 8. Get English Score

Figure 9. Get Chemistry Score


Figure 10. Get Math Score

- When we already have student’s scores, we will calculate the average scores:
- Based on the formula for calculating the average grade of subjects. Average = (Math + Physical +
Chemistry) / 3.
Declare the average calculation method. The data type returned is double.

Figure 11. Calculate Average Method

- Based on the if-else loop we make before, we declare the Status function for Student.
Figure 12. Student Status Method

- Finally, we need to declare the function StudentInfor to help to print the student information.
Figure 13. Print Student Information

 Class Program
- This class is the place where the program will call and do the task as user’s require.
Figure 14. Main function

6. Test and Debug


Case 1: Check to enter the Student Information

 Enter student name:

Try with a student named Le Tan Tong

Result: Success
 Select student gender
I try to enter the number “3”

I try to enter the number out if 3, “100”

Result: Success
 Enter student score end output result
Try to enter the score in right format: Math: 9, English: 7.7, Chemistry: 8.1
Try to enter the score in error format with “English Score”: 198.5

Result: Success

7. Deploy Package for client

Name: Asm_1

Description: Manager Student App


Layer: 2 Layer. Program and Student

Language: Write by C#

This package contains source files: Programing Project


IV. WRITTEN ALGORITHM AND THE CODE VARIANT
1. Examine the implementation of an algorithm in a suitable language:

With the development of the calculation connected to any issue can still be solved. The programming language could
be an instrument based on algorithms to execute commands, calculations, conditions that a given problem. Any
programming language can deal with the issue according to the usage situation algorithm.

To unravel the issue rapidly the given calculation must be appropriate for that language. It is vital to choose suitable
calculations for that programming dialect so that it can be actualized effectively

2. Evaluate the relationship between the written algorithm and the code variant:

According to Cathal [CITATION Fra19 \n \l 1033 ]. Algorithms are just a sequence of steps that describes an idea for
solving a problem meeting the criteria of correctness and term inability. An abstract recipe for the calculation
independent of implementation. While, Code is a set of instructions for a computer. A concrete implementation of the
calculation on a specific platform in a specific programming language.
V. Conclusion
 An algorithm is defined as a well-defined sequence of steps that provides a solution for a given problem, whereas a
pseudocode is one of the methods that can be used to represent an algorithm.
 While algorithms are generally written in a natural language or plain English language, pseudocode is written in a
format that is similar to the structure of a high-level programming language. Program on the other hand allows us to
write a code in a particular programming language.

 Through the assignment programming report, people can be approach to the basic knowledge about algorithm and
their characteristic.
 Learn how to build a small application based on the algorithm design
 Through the report, support people to get more specific knowledge of the association between algorithm design and
programming. And the relationship between writing algorithms and writing code.
References
Bhatia, S. (2020). Hackr.io. Retrieved from https://hackr.io/blog/procedural-programming

Bhatt, S. (2019). medium. Retrieved from https://medium.com/@bhattshlok12/characteristics-of-an-algorithm-49cf4d7bcd9

Horan, C. (2017). Retrieved from https://hackernoon.com/the-future-is-algorithms-not-code-64cacca3b908

Wikipedia. (2020). Retrieved from https://en.wikipedia.org/wiki/Algorithm#:~:text=In%20mathematics%20and%20computer%20science,or


%20to%20perform%20a%20computation.

Table of Figures
Figure 1. Algorithm...................................................................................................................................................................................................... 4
Figure 2. Flowchart Example........................................................................................................................................................................................ 5
Figure 3. Software Development Cycle........................................................................................................................................................................ 8
Figure 4. Flowchart Program...................................................................................................................................................................................... 13
Figure 5. Declare variables......................................................................................................................................................................................... 14
Figure 6. Enter Student name and genger method....................................................................................................................................................15
Figure 7. Get student gender..................................................................................................................................................................................... 15
Figure 8. Get English Score........................................................................................................................................................................................ 16
Figure 9. Get Chemistry Score.................................................................................................................................................................................... 16
Figure 10. Get Math Score......................................................................................................................................................................................... 17
Figure 11. Calculate Average Method........................................................................................................................................................................ 17
Figure 12. Student Status Method............................................................................................................................................................................. 18
Figure 13. Print Student Information......................................................................................................................................................................... 19
Figure 14. Main function............................................................................................................................................................................................ 20

You might also like