0% found this document useful (0 votes)
45 views23 pages

1618 IT Fundamental & Procedural Programming

The document discusses computer programming and algorithms. It defines an algorithm as a series of well-defined instructions to solve problems or perform calculations. It explains how algorithms are used to specify computations and data processing. The document also discusses how to analyze problems, design solutions using flowcharts, write code, test programs, and evaluate the relationship between the algorithm and the final code.

Uploaded by

WynT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views23 pages

1618 IT Fundamental & Procedural Programming

The document discusses computer programming and algorithms. It defines an algorithm as a series of well-defined instructions to solve problems or perform calculations. It explains how algorithms are used to specify computations and data processing. The document also discusses how to analyze problems, design solutions using flowcharts, write code, test programs, and evaluate the relationship between the algorithm and the final code.

Uploaded by

WynT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Problem solving with algorithms

Name: Nguyen Nhat Thanh


ID: GCS210101
Class:
Date: 05/03/2022
ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 1: Programming

Submission date 05/03/2022 Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Nguyen Nhat Thanh Student ID GCS210101

Class 1618 GCS1003A Assessor name Nguyen Tuan Dang

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 Brief 1 (RQF)
Higher National Certificate/Diploma in Computing
Student Name/ID Number: NGUYEN NHAT THANH

Unit Number and Title: Unit 1: Programming


Academic Year: 2021 – 2022
Unit Assessor: NGUYEN TUAN DANG

Assignment Title: Problem solving with algorithms


Issue Date: 01 April 2021
Submission Date: 12 March 2022

Internal Verifier Name:


Date:

Submission Format:
Format:

● The submission is in the form of an individual written report. 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
Tutor.
● The form of submission will be a soft copy posted on http://cms.greenwich.edu.vn/.
● Remember to convert the word file into PDF file before the submission on CMS.
Note:

● The individual Assignment must be your own work, and not copied by or from another student.
● 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 understand and follow the guidelines to avoid plagiarism. Failure to comply
this requirement will result in a failed assignment.

Unit Learning Outcomes:


LO1 Define basic algorithms to carry out an operation and outline the process of programming an
application

Assignment Brief and Guidance:

Assignment 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).
Tasks:
• State your simple business problems to be solved.
• Analyse the problem and design the solutions by the use of suitable methods.
• Demonstrate the compilation and running of a program
• Evaluate how the problem is solved from the designed algorithm to the execution program
written by a specific programming language.

Learning Outcomes and Assessment Criteria (Assignment 1):


Learning Outcome Pass Merit Distinction
LO1 P1 Provide a M1 Determine the D1 Examine the
definition of what an steps taken from implementation of an
algorithm is and writing code to algorithm in a suitable
outline the process in execution. language. Evaluate the
building an relationship between
application. the written algorithm
and the code variant.
[I] INTRODUCTION ............................................................................................................................ 2
1. COMPUTER PROGRAMMING .............................................................................................. 2
2. ALGORITHM ....................................................................................................................... 4
2.1 Definition ...................................................................................................................... 3

2.2 How to write an algorithm ............................................................................................ 3

2.3 What to use? ................................................................................................................. 3

[II] IMPLICATIONS ............................................................................................................................. 1


1. BUSINESS APPLICATIONS .................................................................................................... 2
1.1 Problem ......................................................................................................................... 3
1.2 Requirements................................................................................................................ 3
2. FLOWCHART ...................................................................................................................... 5
3. WRITING THE CODES .......................................................................................................... 4
3.1 First draft....................................................................................................................... 3
3.2 Test run ......................................................................................................................... 3
[III] EVALUATION............................................................................................................................... 4
REFERENCES ...................................................................................................................................... 5
[I] INTRODUCTION
1. COMPUTER PROGRAMMING:
 Computer programming is the process of designing/building an executable computer
program to execute a given computation (or, more broadly, to get a specified computing
result).
 Programming entails duties such as analysis, algorithm generation, algorithm accuracy and
resource use assessment, and algorithm implementation (usually in a chosen programming
language, commonly referred to as coding)
 To put it another way, computer programming is essentially a technique for humans to
communicate with machines. Computers have their own language called code, similar to how
we use different languages to communicate with individuals from other nations. This is how
humans give computers instructions to obey.
 The primary objective is to produce something that resembles a work of art. This might be as
basic as a calculator for a math problem or as complex as a website or an artificial intelligence-
based simulation, for example. This is why many people consider computer programming to be
both technically and creatively challenging.

2. ALGORITHM:
2.1 Definition:
 An algorithm is a finite series of well-defined instructions used to solve a class of problems or

execute a calculation in mathematics and computer science


 Algorithms are used to specify how computations and data processing should be done.
Algorithms may execute automatic deductions (also known as automated reasoning) and employ
mathematical and logical tests to redirect the code along multiple pathways using artificial
intelligence (referred to as automated decision-making). Alan Turing had already used human
features as metaphorical descriptions of machines using phrases like "memory," "search," and
"stimulus."
 It's worth noting that computer algorithms must have a distinct beginning, middle, and end, as
well as all steps necessary to fulfill their assigned duties. There are no instructions that aren't
absolutely required for the activities at hand.
2.2 How to write an algorithm:
 Algorithms can be written in a variety of ways. The most common method is to utilize a
flowchart, which is a form of graphic that depicts the actions and directions of your algorithm from
beginning to end. Others programmers will utilize pseudocode, which is a form of semi-language
used to explain the steps required in an algorithm.

START
Begin [PSEUDOCODE]

Input driver’s video


[FLOWCHART] ClosedEyeCount := 0
Read income
For every tenth frame in the video Do

Localize eyes

Read cost Check status of eyes

If eyes are closed Then

ClosedEyeCount := ClosedEyeCount + 1
yes Calculate Profit as Else If eyes are open Then
Income >= Cost?
Income - Cost ClosedEyeCount := 0

End If
no If ClosedEyeCount == 3 Then

Calculate Loss as Generate Alarm

Cost - Income ClosedEyeCount := 0

End If

End For

Print Loss Print Profit End

End
P1. FLOWCHART P2. PSEUDOCODE

2.3 What to use:


 An integrated development environment (IDE) is a software ecosystem created with the express
objective of increasing programmers' productivity. At the absolute least, these applications feature
a debugger, a source code editor, and build automation tools. Visual Studio, Eclipse, and Android
Studio, among many others, are some of the most widely used IDEs today.
 An integrated development environment (IDE), in this example Visual Studio, has a large
number of tools to assist programmers in the manner they build their programs. Syntax
highlighting makes code simpler to understand, autocomplete makes code writing faster and
more efficient, and debugging is the most critical feature. "An skilled coder would have at least
three mistakes on each line of their written code," says a saying in the IT field, which was also the
first thing my IT teacher told me. As a result, it's critical to have as much assistance as possible
while debugging your code.

Syntax Highlighting
Autocomplete

[II] IMPLICATIONS
1. BUSINESS APPLICATIONS:
1.1 Problem:
 Your company need a quick method of calculating the price of client orders.

1.2 Requirements:
 Prices will be slashed by two-thirds of what they were before.

 Calculate the pricing of clients' orders, including discounted rates for customers who order
more than 50 products in one transaction.
2. FLOWCHART:
 The flowchart must have a clear beginning and end, with only the most basic and required activities for
the primary tasks.
 I began by creating a flowchart for the above-mentioned activity using the StarUML application.
 I developed a list of everything this software requires:
- Determine and publish the price based on the serial numbers and quantity of goods entered.
- When entering incorrect serial numbers, play an error message and return to the enter serial
numbers line.
- Announce a discount if you input more than a particular amount, and calculate using the lowered
price.
 After determining the priorities, I devised a strategy for the entire program and began developing it.
 After determining the priorities, I devised a strategy for the entire program and began developing it.
START

The finished flowchart

Declare interger value of


serial numbers

Output list of products


serial numbers

Read serial numbers and


No. products

output error, re-enter


if serial numbers serial numbers
wrong
correct
>50 calculate (No. products*
if No. products prize of product) with prize
* 2/3

< 50

calculate (No. products *


prize of product)

Output prize

End
3. WRITING THE CODES:
 The codes were written in Visual Studio.

3.1 First Draft:


 To begin, I listed product serial numbers, product numbers, product prices, and their
respective values.

PICTURE 1
≥ Declaring is required since it directs the program to establish storage locations for your
values.

➔ The reason for declaring is that this will tell the program to make spaces for
your values to be hold in.

PICTURE 2

≥ Print out the products name along with their serial numbers and their set prices.

➔ This step is to interact with the customers, find out their needs
PICTURE 3

≥ Output line to ask the customers for the input serial numbers and the number of product
they need.

➔ This is where we collect our variables for our calculations afterward.


PICTURE 4
≥ I developed a loop using the while statement to ask clients for additional input if their
previous input didn't match the serial numbers that already existed.

➔ This step ensures that we have the proper product before beginning to
calculate the pricing.
➔ While statement works when the while condition is met.
PICTURE 6
PICTURE 7
≥ To compute the incentive for each unique product and validate the amount for decreased
price, I used if-else statements for each product's serial numbers.
➔ The following is how the if-else statement works:
- If requirements are satisfied, the if activities will take place.
- If the if conditions are not satisfied, the else actions will take place.

➔ The if-else statements are used not only to determine the precise product serial
numbers in order to determine their worth for pricing, but also to apply discounts if the
quantity of goods purchased is large enough.
PICTURE 8

≥ Finally, print the final price.


3.2 Test run:
 Choosing an easy number of product to check the calculations.

• For the normal price : 12


• For the discounted price : 55
 Expected result: ( Using product 1 price)

• Normal price : 12 * 12 = $144


• Discounted price : 12 * (12 * 2/3) = 440$

PICTURE 1
PICTURE 2

[III] EVALUATION
• Despite the fact that the application performs admirably, it is clear
that it is limited to the task at hand.
• The while statement is only useful if the number of products is
minimal, and it must be used in the right sequence.
• The if-else sentences are rather extensive and difficult to read.
• Overall, the software provides a straightforward answer to the
problem, but one that isn't very long-term.
[1] Wikipedia Contributors (2019). Integrated development environment. [online] Wikipedia. Available
at: https://en.wikipedia.org/wiki/Integrated_development_environment.

[2] What is algorithm? - Definition from WhatIs.com (2019). What is algorithm? - Definition from
WhatIs.com. [online] WhatIs.com. Available at: https://whatis.techtarget.com/definition/algorithm.

[3] Merriam-webster.com. (2019). Definition of ALGORITHM. [online] Available at:


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

[4] www.edrawsoft.com. (n.d.). What is Algorithm - Definition, Types and Application. [online] Available
at: https://www.edrawsoft.com/algorithm-definition.html.

[5] Codecademy News. (2018). What is Computer Programming? [online] Available at:
https://news.codecademy.com/what- is-
computerprogramming/#:~:text=Computer%20programming%20is%20a%20way.

[6] What is Procedural Programming? Key Features of Procedural Programming (2019). What is
Procedural Programming? Key Features of Procedural Programming. [online] Hackr.io. Available at:
https://hackr.io/blog/procedural-programming.

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


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

[8] www.programiz.com. (n.d.). What is an Algorithm? [online] Available at:


https://www.programiz.com/dsa/algorithm

[9] Codecademy News. (2018). What is Computer Programming? [online] Available at:
https://news.codecademy.com/what-is-
computerprogramming/#:~:text=Computer%20programming%20is%20a%20way [Accessed 9 Oct. 2020].

You might also like