Docsity

ASSIGNMENT 1 1618 BTEC, Essays (high school) of Computer science

Partial preview of the text

Download ASSIGNMENT 1 1618 BTEC and more Essays (high school) Computer science 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 21/12/2021 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Nguyen Huu Hieu Student ID GCD 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 D

Table of Contents

  • Grading grid..........................................................................................................................................................
  • Table of Figure....................................................................................................................................................
  • Table of Flowchart...............................................................................................................................................
  • List of Tables.......................................................................................................................................................
      1. State your simple business problems to be solved.......................................................................................
    • Overview about algorithm...............................................................................................................................
    • Characteristics of algorithm:................................................................................................................................
    • Represent a small and simple problem..........................................................................................................
      1. Analyze the problem and design the solutions by the use of suitable methods.........................................
    • Analyze the problem......................................................................................................................................
    • Variable Data type Purpose.................................................................................................................................
    • Flowchart.......................................................................................................................................................
      1. Demonstrate the compilation and running of a program...........................................................................
    • Introduce how the problem is solved.............................................................................................................
    • Explain briefly what is Software Development Life Cycle...........................................................................
    • Explain how the source code is compiled......................................................................................................
    • specific programming language..................................................................................................................... 4. Evaluate how the problem is solved from the designed algorithm to the execution program written by a
    • Test case:.......................................................................................................................................................
    • specific programming language..................................................................................................................... Evaluate how the problem is solved from the designed algorithm to the execution program written by a
    • 5.CONCLUSION:...............................................................................................................................................
    • References.....................................................................................................................................................
  • Figure 1-The brow tea algorithm.................................................................................................................. Table of Figure
  • Figure 2- Algorithm is clear from input to output........................................................................................
  • Figure 3- Swap number algorithms include 8 steps.....................................................................................
  • Figure 4-Using available resources to handle problem................................................................................
  • Figure 5-Algorithm can implement in many languages...............................................................................
  • Figure 6-Sorting grade of student problem..................................................................................................
  • Figure 7- How bubble sort algorithm works................................................................................................
  • Figure 8-Source code.................................................................................................................................
  • Figure 9-Screenshot of the final result (1)..................................................................................................
  • Figure 10-Screenshot of the final result (2)................................................................................................
  • Figure 11-Software Development Life Circle............................................................................................

List of Tables Table 1-Main variables are used................................................................................................................ 10 Table 2-Structures are used........................................................................................................................ 10 Table 3-Test plan........................................................................................................................................ 19

1. State your simple business problems to be solved

Overview about algorithm

Definition: An algorithm is a procedure or formula used for solving a problem. It contains the steps, which is a set of actions that are executed in a certain order to obtain the desired output. For example: The brew tea algorithm  Characteristics of algorithm: Figure 1-The brow tea algorithm

  • Unambiguous: The algorithm should be explicit and straightforward. Each of its processes as well as their inputs and outputs, should be obvious and lead to just one conclusion.

Figure 4-Using available resources to handle problem

  • Independent: Algorithm does not base on certain programming language. It can be implemented in many different programming languages. Figure 5-Algorithm can implement in many languages Document shared on www.docsity.com Downloaded by: nguyen-huu-hieu-fgw-dn ([email protected])

Represent a small and simple problem

To know about algorithm in programing clearly, I will represent small and simple problem the business problem, it is sorting student by grades in ascending order. This is the problem that the teacher usually meets it when they classify student in a class. Figure 6-Sorting grade of student problem To handle this problem, I will use bubble sort algorithm because it is simpler than other sorting algorithms. Idea of this algorithm is sorting a list of grades of student by repeating the task of swapping two consecutive grade if they are in the wrong order (the latter grade is less than the previous grade) until the sequence grades has been completely sorted by ascending order. Figure 7- How bubble sort algorithm works

 Explain: Figure 8-Source code  The first step: I declare global 3 variables: total, string[] name and double[] grade.  The next step: I use procedural programming skill to build 3 functions: readList, printList and sortList.

Figure 9-Screenshot of the final result (1) Figure 10-Screenshot of the final result (2)

Explain briefly what is Software Development Life Cycle

Software Development Life Cycle is a process that is followed for a software project. It is a thorough strategy that explains how to build, maintain, replace, and modify or enhance certain software. On the other hand, it is an approach for enhancing software quality and the development process in general.

Figure 11-Software Development Life Circle A Software Development Life Cycle include stages:

  • Planning and requirement analysis: collecting relevant information from problem and identifying inputs, outputs, the things that are necessary to handle that problem. +Design: base on the requirements analysis, design suitable algorithms to solve the problem +Implementation: demonstrate how the algorithm is implemented by using suitable programming language. +Testing: predict possible cases and run tests on the program, fix bug (if any). +Evolution: Upgrade and optimize the program by adding, removing functions or using new algorithms.

Explain how the source code is compiled

-The source code wants to compile, it needs a tool called “compiler”. Nature of compiler is converting high-level source code into intermediate code and executes it immediately. When you start the compiler, it accepts your code as an input, processes it, and then saves it as Intermediate Language (IL) code in *.exe or *.dll files. The IL code is translated into machine code using a just-in-time (JIT) compiler (sometimes called "native" code).