Programming(1618) GCS210120 DangVietMinhMan Assignment1 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 Student ID 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.
ASSIGNMENT FRONT SHEET Qualification BTEC Level 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 Student ID 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 D1 ❒ Summative Feedback: Grade: Lecturer Signature: ❒ Resubmission Feedback: Assessor Signature: Date: Table of Contents Task - State your simple business problems to be solved (P1) 1.1 Overview about Algorithm…………………………………………………………………………………………………………… …………… More explanations about each introductory step are as follows: For example: Making tea algorithm by teabag: Example 1: Making tea algorithm by teabag……………………………………………………………………………… Characteristics of algorithm: Example 2: Algorithm is clear from input to output…………………………………………………………………… Example 3: Swap number algorithms include steps…………………………………………………………………… Example 4: Using available resources to handle problem…………………………………………………………… Example 5: Algorithm can implement in many languages…………………………………………………………… 10 1.2.Represent a small and simple problem…………………………………………………………………………………………………… 10 Example - Sorting grade of student problem…………………………………………………………………………… 10 Example 7: How bubble sort algorithm works…………………………………………………………………………… 11 Task - Analyze the problem and design the solutions by the use of suitable methods 11 2.1 Analyze the problem…………………………………………………………………………………………………………… 11 ………………… Tables 1: Data type, data structures………………………………………………………………………………………… 12 Variables are used: 12 Table - Main variables are used……………………………………………………………………………………………… 12 Structures are used: 12 Tables - Structures are used…………………………………………………………………………………………………… 12 Example 8: If statement……………………………………………………………………………………………… 13 …………… Example 9: Switch………………………………………………………………………………………………… 13 …………………… Example 10: Do-while statement……………………………………………………………………………………………… 14 Example 11: List statement……………………………………………………………………………………………… 14 ……… 2.2 Flowchart…………………………………………………………………………………………………………… 14 ………………………………… Create struct: 14 Flowchart 1: Create struct flowchart………………………………………………………………………………………… 15 Main…………………………………………………………………………………………………………… 15 ………………………………………… Flowchart 2: Mani Flowchart……………………………………………………………………………………………… 16 …… Input information…………………………………………………………………………………………………… 16 …………………………… Flowchart 3: Input flowchart……………………………………………………………………………………………… 17 …… Display information…………………………………………………………………………………………………… 17 ………………………… Flowchart 4: Display flowchart……………………………………………………………………………………………… 18 … Search function………………………………………………………………………………………………………… 18 …………………………… Flowchart 5: Search flowchart……………………………………………………………………………………………… 19 …… Delete information…………………………………………………………………………………………………… 19 …………………………… Task Demonstrate the compilation and running of a program 3.1 Introduce how the problem is solved…………………………………………………………………………………………………… Flowchart 7: How my program solve problem…………………………………………………………………………… 3.2 Source code and screenshot of the result final……………………………………………………………………………………… 19 19 21 21 Source code: 21 Example 12: Source code…………………………………………………………………………………………………… 23 ……… Explain: 23 Screenshots of the final result: 25 Example 13: Screenshots of the final result……………………………………………………………………………… 25 3.3 Explain briefly what is Software Development Life Cycle………………………………………………………………………… Example 14: Software Development Life Cycle…………………………………………………………………………… 25 26 A Software Development Life Cycle includes stages: 26 3.4 Explain how the source code is compiled……………………………………………………………………………………………… Flowchart 8: Example about how C# compiler works………………………………………………………………… Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language 26 27 27 4.1 Test case: 27 Table 4: Test plan…………………………………………………………………………………………………… 28 ………………… 4.3 Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language…………………………………………………………………………………………………………… 28 ……… 5.CONCLUSION: 28 Task - State your simple business problems to be solved (P1) 1.1 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 To have quantities of a good algorithm: ● Input and Output should be precisely described ● Each step in an algorithm should be clear and unambiguous - ● Choosing one of the most effective algorithms among different ones is to solve a problem ● Outline the process of programming an application ● ● ● ● ● ● ● Obtaining the description of the problem (1) Analyzing the problem (2) Design (algorithm) (3) Coding (4) Compiling and running the program (5) Testing and Debugging (6) Maintenance (7) More explanations about each introductory step are as follows: ● – A description is that some requirements of the client are for developers Some common issues to solve a suitable algorithm are stated assumptions, unambiguous, complete and don’t have internal contradictions ● – To determine both input and output for solving a problem Moreover, the body should split from big data to small tasks so that the next steps will be easier to handle ● – Implementing specific problem ideas and details by creating a collapse diagram through a flowchart or using pseudo-code ● – Write and code the algorithm by a programming language such as C sharp (#), Python, and so on through IDE- Notepad++ ● – The computers use one compiler – a computer program translating from the source language (a high-level programming language) to machine language (a lower level language) to create a problem executing data ● – To search for bugs or errors through a software product it can be automated and there is no need for expertise In contrast, debugging is a software to correct some bugs during testing and executed by a programmer or developer ● – The change happens while adding some functionalities in the application Moreover, some activities are fixing errors, preventing the occurrence of errors and so on ● For example: Making tea algorithm by teabag: Example 1: Making tea algorithm by teabag( Source: https://newquayjunior.net/year-4-ict/flowchart-with-algorithm-for-making-tea/) ● 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 Example 2: Algorithm is clear from input to output ● Finiteness: Algorithms must handle the problem after doing a number of certain steps ○ ○ ○ ○ ○ ○ ○ ○ STEP 1: Start STEP 2: ENTER x, y STEP 3: PRINT x, y STEP 4: x = x + y STEP 5: y = x - y STEP 6: x = x - y STEP 7: PRINT x, y STEP 8: END Example 3: Swap number algorithms include steps ● Feasibility: program can solve problems with given the resources ○ sum of Two numbers: ○ Step - Start ADD ○ Step - get values of a & b ○ Step - c ← a + b ○ Step - display c ○ Step - STOP Example 9: Switch Do-while: Check the condition after running the code The code will terminate if the condition is not met I'll utilize it in my software to check the password and username; if there are more than three attempts, you won't be allowed to enter username, password, or quit the application Example 10: Do-while statement List: I create an empty list to contain all entered student information, all entered information will be saved here Example 11: List statement 2.2 Flowchart ● Create struct: Flowchart 1: Create struct flowchart ● Main Flowchart 2: Main Flowchart ● Input information Flowchart 3: Input flowchart ● Display information Flowchart 4: Display flowchart ● Search function Flowchart 5: Search flowchart ● Delete information Flowchart 6: Delete flowchart Task Demonstrate the compilation and running of a program 3.1 Introduce how the problem is solved In my program, I apply procedural programming to divide this problem into small tasks that include functions readList, printList and sortList In addition, I have used an algorithm that was designed in task to build the sortList function The function readList and printList will support the function sortList in reading and displaying results In detail, my program will read an unsorted list of students that includes the name and grade from the keyboard, and then I display this list on the console screen After that, I sort this list by grade and display it on the console screen Flowchart 7: How my program solve problem 3.2 Source code and screenshot of the result final Source code: Screenshots of the final result: Case 1: Delta = This example will give delta result = Case 2: Delta > This example will give delta result > Case 3: Delta < This example will give delta result < 3.3 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 Example 14: Software Development Life Cycle ● A Software Development Life Cycle includes stages: ○ Planning and requirement analysis: collecting relevant information from a problem and identifying inputs, outputs, the things that are necessary to handle that problem ○ Design: based on the requirements analysis, design suitable algorithms to solve the problem ○ Implementation: demonstrate how the algorithm is implemented by using a suitable programming language ○ Testing: predict possible cases and run tests on the program, fix bugs (if any) ○ Evolution: Upgrade and optimize the program by adding, removing functions or using new algorithms 3.4 Explain how the source code is compiled The source code wants to compile, it needs a tool called “compiler” Nature of a compiler is converting high-level source code into intermediate code and executing 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) Flowchart 8: Example about how C# compiler works Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language 4.2 Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language Algorithms are 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 algorithms and code variants are closely related in solving problems 5.CONCLUSION: Nowadays C# is one of the most popular languages in the world, and it is becoming 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 References: tutorialink.Available at: https://tutorialink.com/ds/key-features-of-an-algorithm.ds (Accessed 12th june 2022)https://www.geeksforgeeks.org/csharp-programming-language/ (Accessed 12th june 2022) geeksforgeeks.Available at: https://www.geeksforgeeks.org/ (Accessed 12th june 2022) atories.Available at: https://atories.com/software-development-life-cycle-sdlc/ (Accessed 12th june 2022) sfcsrini.blogspot.Available at: http://sfdcsrini.blogspot.com/2014/10/scrum-agile-basics.html (Accessed 12th june 2022) phoenixnap.Available at: https://phoenixnap.com/blog/software-development-life-cycle (Accessed 12th june 2022) educba.Available at: https://www.educba.com/introduction-to-algorithm/ (Accessed 12th june 2022 ) melsatar.blog.Available at: https://melsatar.blog/2018/08/27/the-validation-and-verification-model-the-v-model/ (Accessed 12th june 2022) edrawsoft.Available at: https://www.edrawsoft.com/algorithm-definition.html (Accessed 12th june 2022) tech terms.Available at: https://techterms.com/definition/c_sharp (Accessed 12th june 2022)