0% found this document useful (0 votes)
54 views14 pages

1 - Unit 1 - Assignment 1 Frontsheet

This document summarizes an assignment submission for a programming unit. It includes the student's name and ID, class details, date submitted, and a declaration that the work is original. The assignment involves stating a business problem to be solved using an algorithm, analyzing the problem and designing a solution flowchart, demonstrating the compilation and running of a program to solve the problem, and briefly explaining the software development life cycle.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views14 pages

1 - Unit 1 - Assignment 1 Frontsheet

This document summarizes an assignment submission for a programming unit. It includes the student's name and ID, class details, date submitted, and a declaration that the work is original. The assignment involves stating a business problem to be solved using an algorithm, analyzing the problem and designing a solution flowchart, demonstrating the compilation and running of a program to solve the problem, and briefly explaining the software development life cycle.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 1: Programming

Submission date 20/6/2022 Date Received 1st submission 26/5/2022

Re-submission Date Date Received 2nd submission

Student Name Nguyễn Tin Học Student ID GCS210848

Class GCS1004B Assessor name Thái Thị Thanh Thảo

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
CHAPTER1. State a simple business problem to be solve............................................................................................3
1.1.What is algorithm..................................................................................................................................................3
1.2. Small problem needs to be solved using algorithm..............................................................................................5
CHAPTER 2. Analyze the problem and design the solutions by the use of suitable methods......................................6
2.1. Analyze the problem............................................................................................................................................6
2.2. Flowchart of the algorithm...................................................................................................................................7
CHAPTER 3 Demonstrate the compilation and running of a program.........................................................................8
3.1. How problem is solved..........................................................................................................................................8
3.2 Source code and screen shots of the final result...................................................................................................8
3.3 Explain briefly what is Software Development Life Cycle.....................................................................................10
3.3.1. Software Development Life Cycle....................................................................................................................10
3.3.2. How the source code is compiled and run.......................................................................................................12
CHAPTER1. State a simple business problem to be
solve
1.1.What is algorithm
Algorithm is a set of instructions, used by computers, using programming languages such as, C#, C++,
JavaScript … to perform a computation. It takes input and give us output result.
In mathematics and computer science, an algorithm is a finite sequence of rigorous instructions, typically
used to solve a class of specific problems or to perform a computation.[1] Algorithms are used as
specifications for performing calculations and data processing. By making use of artificial intelligence,
algorithms can perform automated deductions (referred to as automated reasoning) and use mathematical
and logical tests to divert the code execution through various routes (referred to as automated decision-
making).”(Anon.,n.d.)
Example of algorithm:
The algorithm proceeds by successive subtractions in two loops: IF the test B ≥ A yields "yes" or "true"
(more accurately, the number b in location B is greater than or equal to the number a in location A)
THEN, the algorithm specifies B ← B − A (meaning the number b − a replaces the old b). Similarly, IF A
> B, THEN A ← A − B. The process terminates when (the contents of) B is 0, yielding the greatest
common divisior in A. (Anon.. n.d)
1.2. Small problem needs to be solved using
algorithm
The problem I want to present is sorting students by grades in ascending order. This is simple business
problem teachers usually use to sort the list of the class. It helps teacher to see the lowest and highest
grade student.

Figure 2: list of students to be sorted

To solve this problem, I will use bubble sorting algorithm because it simple.

Figure 3: Bubble sort

This algorithm will swap the variable if the next variable is greater than the current. It does this constantly
until the array is in the corresct order.
CHAPTER 2. Analyze the problem and design the
solutions by the use of suitable methods
2.1. Analyze the problem
 Input :
o Number of students to insert
o Student information (Names/Grades) to insert
 Output :
o A sorted student list
 Variable used in the program:
o Int n: number of student to insert
o Double array grade: store grades of students
o String array name: store student’s names
 Structures :
o While loop
o For loop
o If/else
2.2. Flowchart of the algorithm

Figure 4: Flowchart of the program


CHAPTER 3 Demonstrate the compilation and
running of a program
3.1. How problem is solved
To implement this algorithm, I use Visual Studio to make a console app with C# programming language.
The program can take a list of students (names and grades) as input and output a sorted list.

Figure 5: How the program solves the problem

3.2 Source code and screen shots of the final result

Figure 6: Source code


Explanation:

 First, the program will ask for how many students user want to add and read that value, save to
an integer variable. Then, it declare two array studentName and student Grade to store student
names and grades.

Figure 7:Source code


 Secondly, the program will run a for loop base on the number of student to add, and takes
student names/grades input from user, add them to the two arrays created above.

Figure 8:Source code

 Next, the program will run the bubble sort algorithm using 2 for loops. The IF structures is to
check if the grade in the next index is lower than the one with current index value. If true, it
will swap 2 grades value and so on. I have to swap the name the same as swapping the grade so
that the student name and grade pair still go with each other. tempGrade and tempName are the
two variables that I use to temporarily store the value during the swapping process.

Figure 9: Source code


 Finally, it will display the list simply by looping through the arrays using for loop.

Figure 10: Source code


Screenshot of the program running:

Figure 11: Running program

3.3 Explain briefly what is Software Development


Life Cycle
3.3.1. Software Development Life Cycle
Software Development Life Cycle is a process of developing, maintaining, replacing and altering or
enhance a specific software. The development life cycle is the core principle of improving the quality of
the software as well as the overall development process.

Figure 12:Stages of Software Development Life Cycle


Software Development Life Cycle contains 6 stages:

Planning

Analyzing the user’s requirements and planning for the quality assurance requirements. This stage is
implemented by the senior members of the team, the sales department, market surveys and domain
experts.

Defining

Define the product requirements and get them approved by the customer.

Designing

Design the architecture of the product, determine how the data will flow or the communication between
the product and external, third-party modules.

Developing (Building)

The programmers (developers) will write the program base on the design and requirements above.

Testing

Tester or programmer will test the product, find bugs and debugging.

Deploying

At this stage, the final, stable version of the product will be released.
3.3.2. How the source code is compiled and run
The compiler takes the source code and translate it into machine language module (called an object file).
Next, linker will combines this object file with other previously compiled object files (in particular run-
time modules) to create an executable file. (Anon., n.d.)

Figure 13: Programming process for a compiled language


References
Anon., n.d.Algorithm.[Online]
Available at: https://en.wikipedia.org/wiki/Algorithm
[Accessed 25 April 2022]
Anon., n.d. SDLC-Overview. [Online]
Available at: https://www.tutorialspoint.com/sdlc/sdlc_overview.htm
[Accessed 25 April 2022]
Anon., n.d. The Programming Process. [Online]
Available at:
https://www2.hawaii.edu/~takebaya/ics111/process_of_programming/process_of_programming.html
[Accessed 25 April 2022]

You might also like