Docsity

BTEC Level 5 HND Diploma in Computing - Unit 1: Programming - Assignment 1, Assignments of Network Programming

Toggle sidebar
bg1
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
Nguyen Hung Huan
Student ID
GBS200308
Class
GCS0903_PPT
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
Huan
Grading grid
M1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download BTEC Level 5 HND Diploma in Computing - Unit 1: Programming - Assignment 1 and more Assignments Network Programming in PDF only on Docsity!

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 Nguyen Hung Huan Student ID GBS

Class GCS0903_PPT 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 Huan

Grading grid

P1 M1 D

Summative Feedback:Resubmission Feedback:

Grade: Assessor Signature: Date:

Lecturer Signature:

Task 1 - State your simple business problems to be solved (P1) (Pass) 1.1Overview about Algorithm 1.1.1 Definition about Algorithm

  • Algorithm is a process or set of rules to be followed in calculations or other problem-solving operations.
  • Therefore Algorithm refers to a set of rules/instructions that step-by-step define how a work is to be executed upon in order to get the expected results. Figure 1: What is Algorithm? ( Source: https://www.geeksforgeeks.org/introduction-to-algorithms/)

1.1.2 Characteristics of an Algorithm Figure 2: Characteristics of an Algorithm ( Source: https://www.geeksforgeeks.org/introduction-to-algorithms/)

1. Clear and Unambiguous : Algorithm should be clear and unambiguous. Each of its

steps should be clear in all aspects and must lead to only one meaning.

2. Well-Defined Inputs : If an algorithm says to take inputs, it should be well-defined

inputs.

3. Well-Defined Outputs: The algorithm must clearly define what output will be yielded

and it should be well-defined as well.

4. Finite-ness: The algorithm must be finite, it should not end up in an infinite loops or

similar.

5. Feasible: The algorithm must be simple, generic and practical, such that it can be

executed upon will the available resources. It must not contain some future technology,

or anything.

6. Language Independent: It must be just plain instructions that can be implemented in

any language, and yet the output will be same, as expected.

Task 2 - Analyse the problem and design the solutions by the use of suitable methods (P1) (Pass) 2.1 Analyse the problem The problem is simply uses an exhaust coupled with memoization to avoid re- computing the same value over and over. The search space is iterated, and any partial results (that may form the tail of subsequent sequences) will be cached along with the associated chain length. Upon completion, search for the largest chain. I saved an array of objects (number, count) and saved each number as I solved it, then while solving if my working number ever went below the number I was solving I would search the array for the corresponding number and pull the count. I changed the array of objects to store every number I came across, including numbers above the number I was currently solving for, but this meant checking every step of every number against the array of objects. All of these were technically correct algorithms after ~100, 000 or so would only solve about 1000 numbers per second. The index is the number being solved and the value stored at that index is the count for that particular index, and storing every number I come across. In my local browser, this solved longest Collatz Sequence (1000000) in about 850ms. Since then, I’ve optimized the function in various ways, with the biggest improvement being not storing the count of values above the limit. As it’s presented below, my local browser solves the problem in 112ms on average. 2.2 Flowchart This is my flowchart about the problem Longest Collatz sequence

Figure 4: Longest Collatz sequence

sequenceLength = length; startingNumber = i; } } Console.WriteLine("Longest Number = " + startingNumber); Console.WriteLine("produces a sequence of " + sequenceLength); } } } 3.2.2 Screen shots of the final result Figure 5: The final result of Longest Collatz sequence 3.3 Explain briefly what is Software Development Life Cycle

  • Software Development Life Cycle (SDLC) is a process used by the software industry to design, develop and test high quality software. The SDLC aims to produce a high- quality software that meets or exceeds customer expectations reaches completion within times and cost estimates
  • SDLC is a process followed for a software project, within a software organization. It consists of a detailed plan describing how to develop, maintain, replace and alter or enhance specific software. The life cycle define a methodology for improving the quality of software and the overall development process
  • SDLC is the acronym of Software Development Life Cycle
  • It is also called as Software Development process
  • SDLC is a framework defining tasks performed at each step in the software development process
  • IOS/IEC 12207 is international standard for software life-cycle processes. It aims to be the standard the defined all the tasks required or development and maintaining software 3.4 Explain how the source code is compiled
  • If you are neither a programmer nor a web designer, you probably do not think much about what is behind the programs and internet pages that you use everyday.
  • They are based in part on complicated and long instructions to your computer. This command text is called source code.
  • on the basis of a particular programming language, programmers lay out all of the rules for a computer-executable application.
  • If the author writes error into their work that violates the specifications of the programming language then the program either will not function properly, will do nothing or will crash.

Test 3: change number to 0 Figure 8: Test cases 3 4.2 Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language. When I analyse the problem, I thought solution from the topic of the problem. So I decide use for loop and condition sentences to find the non-zero elements in order to control and edit my code easily. After that, all I need to do is call them in main function for the computer to compile and execute. To sum up, when I analyse this problem, all I need is knowledge about array, loop, condition and with algorithm, it help me to solve it easier by using code and also help me improve my thinking ability. References ❖ https://www.geeksforgeeks.org/introduction-to-algorithms/ ❖ https://www.geeksforgeeks.org/introduction-to-algorithms/ ❖ https://www.c-programming-simple-steps.com/algorithm-examples.html ❖ https://euler.beerbaronbill.com/en/latest/solutions/14.html