


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Unit 1: Programming assignment1
Typology: Schemes and Mind Maps
Uploaded on 04/24/2023
1 document
1 / 34
This page cannot be seen from the preview
Don't miss anything!



























Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date 08/09/2022 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Ngo Thanh Tung Student ID GCH Class GCH1104 Assessor name Đặng Trần Long 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 Tung Grading grid P1 M1 D
Grade: Assessor Signature: Date: Lecturer Signature:
Introduction Algorithms are used for calculation, data processing, and automated reasoning. Whether you are aware of it or not, algorithms are becoming a ubiquitous part because computers are playing increasingly important roles in so many aspects of our lives. This assignment will provide my understanding about an overview about algorithm, using algorithms and C# programming language to solve a small problem. I. Provide a definition of what an algorithm is and outline the process in building an application. 1. Overview about Algorithm 1.1. Definition of algorithms An algorithm is a specific set of instructions for carrying out a procedure or solving a problem, usually with the requirement that the procedure terminate at some point. Specific algorithms sometimes also go by the name method, procedure, or technique. The word "algorithm" is a distortion of al-Khwarizmi, a Persian mathematician who wrote an influential treatise about algebraic methods. The process of applying an algorithm to an input to obtain an output is called a computation. 1 .2. How do computer algorithms work? Computer algorithms work via input and output. They take the input and apply each step of the algorithm to that information to generate an output. You can easily visualize algorithms as a flowchart. The input leads to steps and questions that need handling in order. When each section of the flowchart is completed, the generated result is the output.
Flowchart of find the search number algorithm 2. Characteristics algorithm
Explanation:
Screenshot of the program running:
Stage 2: Defining Requirements Once the requirement analysis is done the next step is to clearly define and document the product requirements and get them approved from the customer or the market analysts. This is done through an SRS (Software Requirement Specification) document which consists of all the product requirements to be designed and developed during the project life cycle. Stage 3: Designing the Product Architecture SRS is the reference for product architects to come out with the best architecture for the product to be developed. Based on the requirements specified in SRS, usually more than one design approach for the product architecture is proposed and documented in a DDS - Design Document Specification. This DDS is reviewed by all the important stakeholders and based on various parameters as risk assessment, product robustness, design modularity, budget and time constraints, the best design approach is selected for the product. A design approach clearly defines all the architectural modules of the product along with its communication and data flow representation with the external and third-party modules (if any). The internal design of all the modules of the proposed architecture should be clearly defined with the minutest of the details in DDS. Stage 4: Building or Developing the Product In this stage of SDLC the actual development starts and the product is built. The programming code is generated as per DDS during this stage. If the design is performed in a detailed and organized manner, code generation can be accomplished without much hassle. Developers must follow the coding guidelines defined by their organization and programming tools like compilers, interpreters, debuggers, etc. are used to generate the code. Different high-level programming languages such as C, C++, Pascal, Java and PHP are used for coding. The programming language is chosen with respect to the type of software being developed. Stage 5: Testing the Product This stage is usually a subset of all the stages as in the modern SDLC models, the testing activities are mostly involved in all the stages of SDLC. However, this stage refers to the testing only stage of the product where product defects are reported, tracked, fixed and retested, until the product reaches the quality standards defined in the SRS.
Stage 6: Deployment in the Market and Maintenance Once the product is tested and ready to be deployed it is released formally in the appropriate market. Sometimes product deployment happens in stages as per the business strategy of that organization. The product may first be released in a limited segment and tested in the real business environment (UAT- User acceptance testing). Then based on the feedback, the product may be released as it is or with suggested enhancements in the targeting market segment. After the product is released in the market, its maintenance is done for the existing customer base. 3.2. Represent a small and simple problem In order to present more about algorithm and its details. I will upgrade the application above to solve a small and simple problem as follows: A teacher wants to manage average grade of students who attend his class. He needs to adding student into student list, print out all the student’s information entered, prints out the student with the highest/lowest average grade, search student’s information through student ID and remove student from the list. Furthermore, the program will have a main selection menu to select through various option. 3.3. Analyze the problem With the help of Visual Studio, I can create an console app with C# programming language that will be able to solve the teacher problem. Additionally, the program will include the usage of various libraries, variables, loop statements, conditional statements. 3.4. Activity Diagrams
II. Determine the steps taken from writing code to execution. 1. Source code 1.1. Create Student class in file Student.cs This class include variable:
Function outputInfo(): This function uses to simply display the student information 1.2. Create Classroom class in file Classroom.cs Create student list and set it to public to grant access for others files. Next I create function AddStudent() to add student class to the list.
Lastly, a function RemoveStudent(int rmv); This will simply find a student’s information at the variable rmv position in the array list and remove it. 1.3. File Program.cs 1.3.1 Declare variable and array 1.3.2. Select menu function The menu function has only one job is to print out the menu layout for the application. I have created a do – while loop and put menu function and the switch – case statement for the user to check the menu again after finishing a function.
1.3.3. Input student’s information Case 1: The function job is to allow the user entered the student’s information and store them in each previously declared array. Firstly, it will ask the user to input the number of students that the user want to store information in and store it in variable stuNums. Next the program will keep asking the user to input the same amount of student’s information using the “for” loop. The information which the user entered will be store in the accordingly array. 1.3.4. Print student’s information I create a function passing List