Docsity

assignment 1 1618 năm 2022, Study Guides, Projects, Research of Computer Security

Toggle sidebar
bg1
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 Phạm Minh Dũng Student ID GCH210642
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
pf3
pf4
pf5
pf8

Partial preview of the text

Download assignment 1 1618 năm 2022 and more Study Guides, Projects, Research Computer Security 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 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Phạm Minh Dũng Student ID GCH 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

❒ Summative Feedback: ❒ Resubmission Feedback: Grade: Assessor Signature: Date: Lecturer Signature:

Figure 1: Flowchart of an algorithm The simple algorithm above is to calculate the greatest common divisor of two numbers a and b in locations named A and B. The algorithm proceeds by successive subtractions in two loops: IF the test B ≥ A yields "yes" or "true" (more accurately, the number b in location B is greater than or equal to the number a in location A) THEN, the algorithm specifies B ← B − A (meaning the number b − a replaces the old b). Similarly, IF A > B, THEN A ← A − B. The process terminates when (the contents of) B is 0, yielding the greatest common divisor in A. (Anon., n.d.) 1.2. Small problem needs to be solved using algorithm The problem I want to present is sorting students by grades in ascending order. This is simple business problem teachers usually use to sort the list of the class. It helps teacher to see the lowest and highest grade student. Figure 2: List of student to be sorted To solve this problem, I will use bubble sorting algorithm because of its simple.

Figure 3: Bubble sort This algorithm will swap the variable if the next variable is greater than the current. It does this constantly until the array is in the correct order.

Task 2 - Analyse the problem and design the solutions by

the use of suitable methods (P1)

2.1. Analyze the problem

  • Input:  Number of students to insert  Student information (Names/Grades) to insert
  • Output:  A sorted student list
  • Variable used in the program:  int n: number of student to insert

Figure 4: Flowchart of the program

Task 3 - Demonstrate the compilation and running of a

program (P1 – M1)

3.1. How problem is solved To implement this algorithm, I use Visual Studio to make a console app with C# programming language. The program can take a list of students (names and grades) as input and output a sorted list. Figure 5: How the program solves the problem