Unit 1 - Assignment 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

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 Student ID

Class Assessor name

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:
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 2020

Unit Tutor Le Ngoc Thanh

Issue date Submission date 20-Oct-2020

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.
Contents
P1. Provide a definition of what an algorithm is and outline the process in building an application .......................... 6
i Definition of an algorithm ....................................................................................................................................... 6
ii Process in building an application .......................................................................................................................... 6
M1. Determine the steps taken from writing code to execution. ................................................................................ 7
D1 Examine the implementation of an algorithm in a suitable language. Evaluate the relationship between the
written algorithm and the code variant. ....................................................................................................................... 9
i The problem ............................................................................................................................................................. 9
ii Coding ..................................................................................................................................................................... 9
P1. Provide a definition of what an algorithm is and outline the process in building an application

i Definition of an algorithm
- Algorithm is a fundamental concept of Mathematics and Computing.
- An algorithm is a set of actions in a specific order to solve a certain problem.
- An algorithm must be unambiguous so that the math solver can follow with that to solve the problem.

ii Process in building an application


- There are four phases in building an application:

1. analysis and specification phase

2. algorithm development phase

3. implementation phase

4. maintenance phase

The below figure summarizes the whole process


M1. Determine the steps taken from writing code to execution.
1. Analyze the problem: You need to define the problem.

2. Design a solution: Find the algorithms to solve the problem.

3. Write Pseudocode: Pseudocode is not executed on computer but it is more convenient for developer
to developing algorithms. A good Pseudocode may be easily converted to progamming language.

For example, the pseudocode statement:

if student’s grade is lower than or equal to 50

print “Failed”

else

print “Passed”

4. Draw a flow chart: Like Pseudocode, a flow chart represents the order of an algorithm will be written.

Like previous example:


5. Write code: Write your solution for the problem in a programming language.

6. Test and debug: Using an IDE (Integrated Development Environment) to run your code. It also helps to
check errors in your code.

This code was written in Microsoft Visual Studio IDE:

Result:
D1 Examine the implementation of an algorithm in a suitable language. Evaluate the relationship
between the written algorithm and the code variant.

i The problem
A person invests $ 500 in a savings account yielding 5 % interest. Assuming that all interests is left
on deposit in the account, calculate and print the amount of money in the account at the end of each
year for 10 years. Use the following formula for determining these amounts:

a = p(1 + r)n

where

p = original amount invested (Principal),

r = annual interest rate,

n = number of years,

a = amount on deposit at the end of the nth year.

ii Coding
Result
double amount;
double principal = 500;
double rate = .05;

initial value

final value

amount = principal *
Math.Pow(1 + rate, year)

Console.Write("{0,4:D}{1,21:f2}\n",
year, amount);
increment
References

BBC Bitesize. (2019). What is an algorithm? [online] Available at:


https://www.bbc.co.uk/bitesize/topics/z3tbwmn/articles/z3whpv4.

Dale, N. (2016). Computer Science Illuminated 6th edition. Jones & Bartlett Learning.

Lucidchart. (n.d.). Algorithm Flowchart Template. [online] Available at:


https://www.lucidchart.com/pages/templates/flowchart/algorithm-flowchart-template [Accessed 20
Oct. 2020].

Programiz.com. (2019). Design Flowchart In Programming (With Examples) - Programiz. [online] Available at:
https://www.programiz.com/article/flowchart-programming.

Computer Science GCSE GURU. (n.d.). Flowcharts. [online] Available at:


https://www.computerscience.gcse.guru/theory/flowcharts [Accessed 20 Oct. 2020].

www.w3schools.com. (n.d.). C# Data Types. [online] Available at:


https://www.w3schools.com/cs/cs_data_types.asp [Accessed 20 Oct. 2020].

problemsolvingwithpython.com. (n.d.). Flowcharts Describing Loops - Problem Solving with Python.


[online] Available at: https://problemsolvingwithpython.com/09-Loops/09.04-Flowcharts-Describing-
Loops/ [Accessed 20 Oct. 2020].

Howkteam (n.d.). Toán tử trong C# | How Kteam. [online] www.howkteam.vn. Available at:
https://www.howkteam.vn/course/khoa-hoc-lap-trinh-c-can-ban/toan-tu-trong-c-54 [Accessed 20 Oct.
2020].

You might also like