Title | Docsity assignment 1 1618 btec |
---|---|
Author | Dam Tung |
Course | Tiếng anh B2 |
Institution | Trường Đại Học Nội Vụ Hà Nội |
Pages | 24 |
File Size | 1.3 MB |
File Type | |
Total Downloads | 175 |
Total Views | 589 |
ASSIGNMENT 1 1618 BTECComputer science 23 pag.Document shared on docsityDocument shared on docsity Summative Feedback: Resubmission Feedback:Grade: Assessor Signature: Date:Lecturer Signature:Document shared on docsityTable of Contents Grading grid....................................................
ASSIGNMENT 1 1618 BTEC Computer science 23 pag.
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
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
Class
Student ID
GCD201855
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
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Summative Feedback:
Grade: Lecturer Signature:
Resubmission Feedback:
Assessor Signature:
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Date:
Table of Contents Grading grid.......................................................................................................................................................... 2
Table of Figure.................................................................................................................................................... 5 Table of Flowchart............................................................................................................................................... 6 List of Tables....................................................................................................................................................... 7 1. State your simple business problems to be solved....................................................................................... 8 Overview about algorithm............................................................................................................................... 8 Characteristics of algorithm:................................................................................................................................ 8
Represent a small and simple problem.......................................................................................................... 11 2. Analyze the problem and design the solutions by the use of suitable methods.........................................12 Analyze the problem...................................................................................................................................... 12 Variable Data type Purpose.................................................................................................................................12
Flowchart....................................................................................................................................................... 12 3. Demonstrate the compilation and running of a program........................................................................... 15 Introduce how the problem is solved............................................................................................................. 15 Explain briefly what is Software Development Life Cycle...........................................................................19 Explain how the source code is compiled...................................................................................................... 20 4. Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language..................................................................................................................... 21 Test case:....................................................................................................................................................... 21 Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language..................................................................................................................... 22 5.CONCLUSION:............................................................................................................................................... 22
References..................................................................................................................................................... 23
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Table of Figure Figure 1-The brow tea algorithm.................................................................................................................. 6 Figure 2- Algorithm is clear from input to output........................................................................................ 7 Figure 3- Swap number algorithms include 8 steps..................................................................................... 7 Figure 4-Using available resources to handle problem................................................................................ 8 Figure 5-Algorithm can implement in many languages............................................................................... 8 Figure 6-Sorting grade of student problem.................................................................................................. 9 Figure 7- How bubble sort algorithm works................................................................................................ 9 Figure 8-Source code................................................................................................................................. 14 Figure 9-Screenshot of the final result (1).................................................................................................. 16 Figure 10-Screenshot of the final result (2)................................................................................................ 16 Figure 11-Software Development Life Circle............................................................................................ 17
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Table of Flowchart Flowchart 1-Bubble sort algorithm............................................................................................................ 11 Flowchart 2-How my program solve problem........................................................................................... 12 Flowchart 3-Example about how C# compiler works................................................................................18
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
List of Tables Table 1-Main variables are used................................................................................................................ 10 Table 2-Structures are used........................................................................................................................ 10 Table 3-Test plan........................................................................................................................................ 19
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
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
Figure 1-The brow tea algorithm
Characteristics of 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.
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Figure 2- Algorithm is clear from input to output
+Finiteness: Algorithm must handle the problem after doing number of certain steps.
Figure 3- Swap number algorithms include 8 steps
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
+ Feasibility: program can solve problem with given the resources
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])
Document shared on www.docsity.com Downloaded by: tung-dam ([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 Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
2. Analyze the problem and design the solutions by the use of suitable methods. Analyze the problem Input: -Total of student. -A list of students included student name and their grade. Output: A list of students is sorted by grade in ascending order. Variables are used: Variable total name grade i, j tempName tempGrade
Data type integer string array double array integer string double
Purpose Store total of student Store student name Store student grade Access each of student name or grade Store temporary name in order to support swapping value Store temporary grade in order to support swapping value Table 1-Main variables are used
Structures are used: Structure If For
Purpose Compare student information to sort Access each student information Table 2-Structures are used
Flowchart
Document shared on www.docsity.com Downloaded by: nguyen-huu-hieu-fgw-dn ([email protected])
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Explain by pseudo code: Step 1: START Step 2: DECLARE tempName, tempGrade, i, j; Step 3: SET i=0; Step 4: WHILE igrade[j]) to check if latter grade less than previous grade. In case this condition is true, I will swap variable name[i] and name[j], grade[i] and grade[j].
The final step: In method Main, I use 3 above functions to handle problem follow order: Read list of students that has not been sorted→display list before sorting→sorting list→display list after sorting.
Screenshots of the final results:
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
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.
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
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).
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
Flowchart 3-Example about how C# compiler works
4. Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language Test case: Test case ID T01
Expected result
Actual result
Evaluation
List of The list includes 3 students students and their information are after sorting Nguyen Van Long 5 by grade Bui Thi Linh 3 Dang Van Cuong 9.5
The list of students was sorted by grade in ascending Bui Thi Linh 3 Nguyen Van Long 5 Dang Van Cuong 9.5
The list of students was sorted by grade in ascending
Pass
The list includes 5 students and their information are Bui Duc Canh 8.1 Bui Xuan Truong 9.0 Ha Thi Linh 7.6 Do Duc Thang 4.1 Vu Thi Hue 6.6
The list of students was sorted by grade in ascending Do Duc Thang 4.1 Vu Thi Hue 6.6 Ha Thi Linh 7.6 Bui Duc Canh 8.1 Bui Xuan Truong 9.0
The list of students was sorted by grade in ascending
Pass
Test objective
Data
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
The list includes 10 students and their information are Nguyen Trong Hue 8.0 Tang Tien Dat 1.5 Bui Quang Dung 9.6 Ngo Minh Quang 5.2 Cao Viet Anh 7.7 Nguyen Minh Duc 4.9 Nguyen Thi Thao 6.1 Ha Thu Trang 8.8 Nong Van Lam 6.7 Truong Hai Dang 10.0
The list of students The list of was sorted by grade in students was ascending sorted by Tang Tien Dat 1.5 grade in Nguyen Minh Duc 4.9 ascending Ngo Minh Quang 5.2 Nguyen Thi Thao 6.1 Nong Van Lam 6.7 Cao Viet Anh 7.7 Nguyen Trong Hue 8.0 Ha Thu Trang 8.8 Bui Quang Dung 9.6 Truong Hai Dang 10.0
Pass
Table 3-Test plan
Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language Algorithm is ordered steps to solve a certain problem. When we analyze and design the algorithm, we can understand the nature of the problem and the appropriate solution. On the other hand, the computer cannot understand human language, so we have to write it in a suitable programming language that compilers can compile for the computer to understand and run. The program written will be based on the designed algorithm to complete work. Therefore, written algorithm and code variant are closely related in solving problems
5.CONCLUSION:1 Nowadays C# is one of the most popular language in the world, end it coming more and more common. This report gives me a chance to practice with it. In this report, I introduced about C# language, algorithm, SDLC. I made a program for student management using procedural programming. The essential necessities that the problem needs were all successfully delivered and implemented.
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])
1
References Admin, 2021. [Online] Available at: https://tutorialink.com/ds/key-features-of-an-algorithm.ds [Accessed 28 7 2021]. Admin, 2021. tutorialspoint. [Online] Available at: https://www.tutorialspoint.com/sdlc/sdlc_overview.htm [Accessed 28 7 20]. Davidson, C., 2021. indicative. [Online] Available at: https://www.indicative.com/data-defined/programming-algorithm/ Kahane, R., 2021. c# corner. [Online] Available at: https://www.c-sharpcorner.com/UploadFile/a8024d/C-Sharp-program-compliation-steps/ [Accessed 7 28 2021].
Document shared on www.docsity.com Downloaded by: tung-dam ([email protected])...