









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
Pass Pass Pass Pass Pass Pass Pass Pass Pass Pass Pass
Typology: Assignments
1 / 16
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 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Đinh Xuân Trường Student ID GCH Class GCH0908 Assessor name Lại Mạnh Dũng 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 Trường Grading grid P1 M1 D
Grade: Assessor Signature: Date: Lecturer Signature:
I. State your simple business problems to be solved
Algorithms give us the most ideal option of accomplishing a task to improve the efficiency of a computer program, proper utilization of resources. WHAT ALGORITHM MEANS? An algorithm is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of specific problems or to perform a computation. Algorithms are always unambiguous and are used as specifications for performing calculations, data processing, automated reasoning, and other tasks. In contrast, a heuristic is a technique used in problem solving that uses practical methods and/or various estimates in order to produce solutions that may not be optimal but are sufficient given the circumstances.
An example about an algorithm
Firstly, I will introduce the C# language. It used in algorithm to solved problem C# language
Main of application Explain (pseudo code): Step 1: START Step 2: DECLARE the variable n, ID[], grade[], name[], flag Step 3: SET flag=false Step 4 : Print menu Step 5: Input option Step 6 : If option=1 then Step 6 .1: Call input() Step 6 .2: SET check=true Step 6 : ELSE (check=false) is true, return Step 4. Step 7 : IF option=2 then CALL showInfo()
Step 8 : WHILE option != 3 , repeat Step 3 Step 9 : STOP menu list of application Explain (pseudo code): Step 1: START Step 2: PRINT (“Input total student (3-30) ”) Step 3: PRINT ("1. Input information") Step 4: PRINT ("2. Show information") Step 5 : PRINT (" 3. Exit") Step 6 : PRINT (“Input your choice: “) Step 7 : STOP
Step 8: READ name[i] Step 9: READ ID[i] Step 10: READ grade[i] Step 11: WHILE (grade[i]<0 or grade[i]>10) is true, return Step 10 Step 12: MOVE UP i by 1 Step 13: STOP Option 2: Print information of students Explain (pseudo code): Step 1: START Step 2: DECLARE the variable i
Step 3: SET i= Step 4: WHILE i<n is true, repeat Step 5 through Step 6 Step 5: PRINT ID[i], grade[i],name[i] Step 6: MOVE UP i by 1 Step 7: STOP III. Demonstrate the compilation and running of a program
The solution here is I use functions called “switch-case”, each of which has an algorithm to process the program. And the program use “do-while” function to check the condition. Firstly, I create variables that using strings to store information into arrays, using integer “I” for “for- loop” functions, using integer “n” to get total of students, using Boolean to check and “k” for “switch- case”. Void 1 : Input information
Main: I start with “Input total students(3-30)” and SET the “do-while” is (n<3 or n> 30). After that I print the menu list has all of things that teacher needs. In the “switch-case”
After enter information of students
V. REFERENCES (Wiki, n.d.) https://en.wikipedia.org/wiki/Algorithm ALGORITHM (https://www.techopedia.com/definition/26272/c-sharp) C SHARP MEANING (https://www.tutorialspoint.com/sdlc/sdlc_overview.htm) Software Development Life Cycle