You are on page 1of 14

Higher Nationals in Computing

Unit 1: Programming
ASSIGNMENT 1

Learner’s name: Lê Thanh Hoàng


ID: GCS190291
Class: GCS0902
Subject code: 1618
Assessor name: PHAN MINH TAM

Assignment due: Assignment submitted:


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 Lê Thanh Hoàng Student ID GCS190291

Class GCS0902 Assessor name Phan Minh Tam

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:

Signature & Date:


ASSIGNMENT 1 BRIEF
Qualification BTEC Level 5 HND Diploma in Computing

Unit number and Title Unit 1: Programming

Assignment title Problem solving with algorithms

Academic Year

Unit Tutor

Issue date Submission date

Submission Format:
Format: The submission is in the form of an individual written report and a presentation. This should
be written in a concise, formal business style using single spacing and font size 12. You are
required to make use of headings, paragraphs and subsections as appropriate, and all work
must be supported with research and referenced using the Harvard referencing system.
Please also provide a bibliography using the Harvard referencing system.
Submission Students are compulsory to submit the assignment in due date and in a way requested by
the Tutors. The form of submission will be a soft copy in PDF posted on corresponding
course of http://cms.greenwich.edu.vn/
Note: The Assignment must be your own work, and not copied by or from another student or from
books etc. If you use ideas, quotes or data (such as diagrams) from books, journals or other sources, you
must reference your sources, using the Harvard style. Make sure that you know how to reference
properly, and that understand the guidelines on plagiarism. If you do not, you definitely get fail
Assignment Brief and Guidance:
Scenario: You have applied for a post as a trainee with a software development company and have been invited for an
interview. You have been asked to demonstrate your problem solving and basic programming skills. To do this you have to
prepare a report on using algorithms to solve problems.

You need to explain, using examples, how algorithms are used to solve simple business problems and the steps needed to be
followed to produce a working program solution. You should make clear your assumption about your program. The problems
to be solved will involve basic procedural programming instructions - sequence instructions (input, output and assignment
statements), loops, conditional statements. Problems should be analysed and designed by the use of flowchart and
demonstrated by the use of modules (procedures) using a menu based program.

Tasks:
1. State your simple business problems to be solved.
2. Analyse the problem and design the solutions by the use of suitable methods.
3. Demonstrate the compilation and running of a menu-based program
4. Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific
programming language.

You also need to do a presentation of your work (it should be summary of your report).

Learning Outcomes and Assessment Criteria

Pass Merit Distinction


LO1 Define basic algorithms to carry out an operation and outline the process of programming an application
P1 Provide a definition of what an M1 Determine the steps taken from D1 Examine the implementation of
algorithm is and outline the writing code to execution. an algorithm in a suitable language.
process in building an application. Evaluate the relationship between
the written algorithm and the code
variant.
Table of Contents
Contents
Unit 1: Programming ASSIGNMENT 1......................................................................................................................1
Algorithm................................................................................................................................................................ 1
1. Definition.....................................................................................................................................................1
2. Usage...........................................................................................................................................................1
Different applications for algorithms are available for any task that can be solved with mental energy (math,
storage of information, adaptation):...................................................................................................................1
3. Example.......................................................................................................................................................1
3.1. Flow Chart...........................................................................................................................................1
Rows and columns setup:................................................................................................................................1
Integer input:...................................................................................................................................................2
Sorter:.............................................................................................................................................................2
3.2. Pseudo code........................................................................................................................................2
Building an application............................................................................................................................................2
Step 1: Planning and Requirements....................................................................................................................2
Step 2: Defining requirements............................................................................................................................2
Step 3: Designing the Product Architecture........................................................................................................3
Test 1:..............................................................................................................................................................3
Test 2:..............................................................................................................................................................4
Test 3:..............................................................................................................................................................4
Source code:............................................................................................................................................................5
ASSIGNMENT 1 ANSWERS

P1. Provide a definition of what an algorithm is and outline the process in building an application.

Algorithm
1. Definition

An algorithm is a set of steps to accomplish a given task. It is followed by a computer to automate


a task that requires a thought process.

2. Usage

Different applications for algorithms are available for any task that can be solved with mental energy
(math, storage of information, adaptation):

A few specific examples could be:


- Find out which business implementation is the most profitable in a company

- Remember information and export them when asked in a server

- Figuring out new ways and more efficient ways to solve a problem

3. Example

In our example we will program an algorithm to print out an array that has been setup by the user
previously.

3.1. Flow Chart

Rows and columns setup:

Page |1
Integer input:

Sorter:

3.2. Pseudo code

Step 1: START

Step 2: Declare r, c, q, w as integers

Step 3: Print out “Enter number of rows: “

Step 4: Read r

Step 5: Print out “ Enter number of columns: “

Step 6: Declare an array a of r rows and c columns

Step 7: For loop(q=0;w<=r-1;w++)

Step 7.1: For loop (q=0; q<=c-1; q++)

Page |2
Step 7.1.1: Print out “Enter integer at “ w+1 “ and column “ q+1

Step 7.1.2: Read a[w,q]

Step 8: Print out “The array”

Step 9: For loop (w=0; w<=r-1; w++)

Step 9.1: For loop (q=0; q<=c-1; q++)

Step 9.1.1: Print out a[w, q] “ “

Step 9.2: Print out line break

Step 10: Print out “Press any key to continue…”

Step 11: Wait for user key input

Step 12: STOP

Building an application
We will build our application using visual studio code and we will code it in c# and will use buble
sorting.

Step 1: Planning and Requirements


This is the most important step in building an application. At this point, we start planning out all the
different possibilities during development and after release. All the people who are going to be
involved (customer, operators, logistics) will be here to give their point of view and understanding of
the market.

Example:

Our example will involve the development of a program that can remember inputed integers and
store them in an array.

Step 2: Defining requirements


We must clearly describe the product and what it will do. It is at this stage that we must define what
needs it responds to.

Example:

Page |3
Our application will remember an array of integers for us and will print them back out when we ask.

Step 3: Designing the Product Architecture


We will then plan out the architecture of the application and how it will present itself when we operate with. At
this point different solutions are proposed and reviewed by all the people involved to figure out which solution
is the best. We will also plan out the different stages of the development phase.

Example:

The user interface is composed of a input space for the number of rows, columns and the integer at a given
sport in the array.

The program will then print everything back out in a table form.

Step 4: Building or developing the product

Right here we provide details the details of implementing all the different features of the application.

Example:

To develop our algorithm, we will code in visual studio code in c#

Step 5: Testing the product

Test 1:

The numbers are in order

Page |4
Test 2:

The numbers are in order

Test 3:

Page |5
The numbers are in order

Step 6: Deployment in the market and maintenance

Here, we release the project and start commercializing it. We also start doing maintenance for the customer.

Source code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Array_Printer
{
class Program
{
static void Main(string[] args)
{
int r, c, w, q, inp;
Console.Write("Enter number of rows: ");
r = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter number of columns: ");
c = Convert.ToInt32(Console.ReadLine());
int[,] a = new int[r, c];
for(w=0; w <= r-1; w++)
{
for (q = 0; q <= c-1; q++)
{
Console.Write("Enter integer at row ");
Console.Write(w + 1);
Console.Write(" and column ");
Console.Write(q + 1);
Console.WriteLine();
a[w,q] = Convert.ToInt32(Console.ReadLine());
}
}
Console.WriteLine("The array");
for(w=0;w<=r-1;w++)
{
for (q=0;q<=c-1;q++)
{
Console.Write(a[w, q] + " ");
}
Console.WriteLine();
}
Console.WriteLine("Pres any key to continue...");
Console.ReadKey();
}
}
}

Page |6
REFERENCES

• Wikipedia, (2021). Algorithm. [online] Available at


https://en.wikipedia.org/wiki/Algorithm#:~:text=Algorithms%20are%20always%20unambiguous
%20and,language%20for%20calculating%20a%20function. [Accessed 21 January, 2021]
• Radwan, A (2018). ‘what are the applications of different algorithms?’. Available at:
https://www.quora.com/What-are-the-applications-of-different-algorithms [Accessed 21 January,
2020]
• Educba (2020). Introduction to Algorithm. [online] Available at
https://www.educba.com/introduction-to-algorithm/. [Accessed 21 January, 2021]
• Varshneya, R (2019). ‘A step-by-step guide to building your first mobile app’. [online]
Entrepreneur. Available at: https://www.entrepreneur.com/article/231145. [Accessed 21 January,
2021]
• Amine S, (2017). ‘What is the process for building an application from the idea to successful
application?’. [online] Quora. Available at: https://www.quora.com/What-is-the-process-for-building-
an-application-from-the-Idea-to-successful-application. [Accessed 21 January, 2021]
• Liquid State (2017). How to Build an App: The Process Behind App Development. [online]
Available at: https://liquid-state.com/the-process-behind-app-development/. [Accessed 21 January,
2021]
• Tutorialspoint (2021). SDLC-Overview-Tutorialspoint. [online] Available at
https://www.tutorialspoint.com/sdlc/sdlc_overview.htm
• Kruger, N (2018). ‘How to write a software requirements specification (SRS Document)’.
[online] Perforce. Available at: https://www.perforce.com/blog/alm/how-write-software-
requirementsspecificationsrsdocument#:~:text=A%20software%20requirements%20specification
%20(SRS)%20is%20a%20document%20that%20describes,A%20purpose
• Fox, C (2014). ‘Why writing software design documents matters’. [online] Toptal. Available at:
https://www.toptal.com/freelance/why-design-documents-matter

Page |7

You might also like