



































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




































ASSIGNMENT 1 FRONT SHEET Qualification BTEC Level 4 HND Diploma in Business Unit number and title Unit: Programming Submission date 05/07/ Date received (1st sub- mission) Re-submission date Date received (2nd submission) Student name Nguyen Thi Tuyet Nhung Student ID BDAF Class IT16102 Assessor name Nguyen Hoang Anh Vu Student declaration I certify that the assignment submission is entirely my own work and I fully understand the con- sequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature: TUYETNHUNG Grading grid P1 P2 P3 P4 M1 M2 D1 D
ii
Contents TABLE OF CONTENT .............................................................................................. ii LIST OF TABLES AND FIGURES .......................................................................... iv LIST OF ACRONYM ................................................................................................ vi INTRODUCTION ...................................................................................................... 1 CHAPTER 1 ALGORITHMS, ISSUES RELATED TO ALGORITHMS AND BASIC PROGRAMMING………………….. ...................................................................................... 2 Provide a definition of what an algorithm is and outline the process in building an application. (P1) .......................................................................................................... 2 1.1 Algorithm definition .................................................................................... 2 1.2 Algorithm demonstration............................................................................ 4 1.2.1 Natural language…………………………………………………………….. 4 1.2.2 Flowchart or block diagram…………………………………………………. 7 1.2.3 How to create a good algorithm?........................................................... 10 1.3 Application building process .................................................................... 12 Determine the steps taken from writing code to execution. (M1) ................ 14 CHAPTER 2 PROBLEMS RELATED TO PROGRAMMING METHODS AND IDE………………………………..................................................................................... ..... 21 Give explanations of what procedural, object-oriented and event-driven paradigms are; their characteristics and the relationship between them. (P2) ............... 21 1.1 Definition of programming models ........................................................... 21 1.1.1 Procedural Programming……………...….………………………………. 15 1.1.2 Object-oriented Programming………………….…………………………. 1.1.3 Event-driven Programming……………...………………………………... 19 1.2 Characteristics of programming models .................................................. 27
v Figure 22: Assembly language .......................................................................................... 16 Figure 23: High-level programming language .................................................................... 16 Figure 24: Compilation process ......................................................................................... 17
vi
RAM Random Access Memory GUI Graphical User Interface IDE Integrated Development Environment CPU Central Processing Unit DOS Disk Operating System OOP Object-Oriented Programming
Perfomed Student: Nguyen Thi Tuyet Nhung 2
1.1 Algorithm definition An algorithm is a set of instructions designed to perform a selected task. This can be an easy process like multiplying two numbers or a complex process like playing a compressed video file. Search engines use proprietary algorithms to display the foremost relevant results from their search index for specific queries. An algorithm can be expressed within a finite amount of space and time, and in a well- defined formal language for calculating a function. Starting from an initial state and initial input (perhaps empty), the instructions describe a computation that, when executed, proceeds through a finite number of well-defined successive states, eventually producing "output" and terminating at a final ending state. [1] Example: tooth brushing algorithm. Step 1: rinse mouth first with clean water to remove food particles. Figure 1. Brushing tooth algorithm example
Perfomed Student: Nguyen Thi Tuyet Nhung 3 Step 2: rinse the brush and take an appropriate amount of toothpaste. Figure 2. Brushing tooth algorithm example Step 3: start brushing your teeth. Position the brush at a 45-degree angle to the jaw arch, brush in a circular motion along the length of the teeth, continuously until the entire outer surface of the jaw is covered. Bring the brush to the inner surface of the tooth, brushing the same way as the outside. The front incisors, place the brush vertically, tilt the brush head and bring it to the inside of the upper jaw, perform an up - down movement to brush the upper incisors. Do the same with the bottom teeth. Place the bristles in contact with the chewing surfaces of the teeth on either side, brushing from front to back. Figure 3. Brushing tooth algorithm example
Perfomed Student: Nguyen Thi Tuyet Nhung 5 to have background knowledge. Disadvantages: verbose; does not highlight the structure of the algorithm; difficult to perform with complex problems. Example: implement a natural language algorithm to make bread. To make this work, I need input data which is the baking ingredients (such as flour, water, butter, etc.), the oven, the baking tools (such as a knife, etc.). Here is the algorithm: Step 1: prepare the ingredients and measure the proportions of the ingredients. Ingredients include: flour, yeast, water. Figure 6. Example of bread making process Step 2: knead the dough. Add the ingredients and seasoning to the dough, knead the dough for 5-6 minutes. Figure 7. Example of bread making process
Perfomed Student: Nguyen Thi Tuyet Nhung 6 Step 3: divide the dough into portions. Figure 8. Example of bread making process Step 4: rolling the dough. Figure 9. Example of bread making process Step 5: steady dough fermentation to finish. Figure 10. Example of bread making process
Perfomed Student: Nguyen Thi Tuyet Nhung 8
1 Input 2 Process 3 Output 4 Decision 5 Flow line 6 Begin or End 7 Connector Table 1. Flowchart Explain more:
Perfomed Student: Nguyen Thi Tuyet Nhung 9
Perfomed Student: Nguyen Thi Tuyet Nhung 11 Figure 15. Algorithm to solve quadratic equation SOURCE-CODE:
Perfomed Student: Nguyen Thi Tuyet Nhung 12 1.3 Application building process Figure 16. Application building process