assignment 1 for 1618, Study Guides, Projects, Research of Computer Networks

assignment 1 đầy đủ nhất của môn 1618

Typology: Study Guides, Projects, Research

2021/2022

Uploaded on 12/07/2022

Phamdung
Phamdung 🇻🇳

12 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

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

Partial preview of the text

Download assignment 1 for 1618 and more Study Guides, Projects, Research Computer Networks 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:

Task 1 - State your simple business problems to be solved

(P1)

1.1. What is algorithm

Algorithm is a set of instructions, used by computers, using programming languages such as C#, C/C++, JavaScript… to perform a computation. It takes input and give us output result. Algorithm is a finite sequence of well-defined instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing calculations and data processing. By making use of artificial intelligence, algorithms can perform automated deductions (referred to as automated reasoning) and use mathematical and logical tests to divert the code through various routes (referred to as automated decision-making).” Example of algorithm: 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 to determine if the user input numbers are odd or not. It can help the user to determine if the number is even or odd . Figure 2: Example of function

 for loop  if/else 2.2. Flowchart of the algorithm Figure 3: 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 4: How the program solves the problem 3.2. Source code

Figure 5: Main menu hub The main menu hub in the program will have a do-while loop and switch-case. Its mission is to let users choose which options they want, with options from 0 to 8, in case users don’t insert the given numbers, the system will return to the main menu. Figure 6: Add student The “ThemsinhVien” option will require users to add student they want to add to the class. These are 9 types of data, including ID, Name, Sex, Age, Math, Physical, Chemistry, DiemTB, Hocluc. After that, the system will save inserted data and will appear in option 8, if you want to see it.

Figure 7: Display student information Now you can see, after entering the required information, the system will save your data and when you want to see your data, you can choose option 8 to have the system display the information you have entered Figure 8: Searching student by name The option “Search student by name” will be tackled when you want to find the name of the student, the system will find the information that you enter previous time, if your searching data is equal to the system data, the result will appear. Figure 9: Searching student by ID