












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













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 Dong Sy Nhat Thanh Student ID GCS Class Assessor name Nguyen Tuan Dang 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
Student Name/ID Number: Unit Number and Title: Unit 1: Programming Academic Year: 2021 – 2022 Unit Assessor: Vinh Hoang Assignment Title: Problem solving with algorithms Issue Date: 01 April 2021 Submission Date: Internal Verifier Name: Date: Submission Format:
Format: ● The submission is in the form of an individual written report. This should be written in a concise, formal business style using single spacing and font size 12. You are required to make use of headings, paragraphs and subsections as appropriate, and all work must be supported with research and referenced using the Harvard referencing system. Please also provide a bibliography using the Harvard referencing system. Submission ● Students are compulsory to submit the assignment in due date and in a way requested by the Tutor. ● The form of submission will be a soft copy posted on http://cms.greenwich.edu.vn/. ● Remember to convert the word file into PDF file before the submission on CMS. Note: ● The individual Assignment must be your own work, and not copied by or from another student. ● If you use ideas, quotes or data (such as diagrams) from books, journals or other sources, you must reference your sources, using the Harvard style. ● Make sure that you understand and follow the guidelines to avoid plagiarism. Failure to comply this requirement will result in a failed assignment. Unit Learning Outcomes: LO1 Define basic algorithms to carry out an operation and outline the process of programming an application Assignment Brief and Guidance:
Task 1 – State simple business problems to be solved (P1)
Introduction to computer programming language: A programming language is a formal language that contains a set of generated instructions different output types. Programming languages are used in computer programming to implement algorithm. computer programming language, one of several languages that execute directly when referred to as a machine in a computer manufacturer-specific numerical form language, after a simple substitution process, when expressed in the appropriate assembly language or after translation from an "advanced" language. Programming languages are also divided into two types, which are "high-level" programming languages and "lowlevel" programming languages.
Algorithm: 2.1. Definition: ❖ In a nutshell, algorithms are formulas for programmers to apply. It includes all you need to know about what to do, how to use it, and also how your computer will help you. In computer language, these formulas are referred to as procedures. The computer completes the tasks using the specified input and procedures, then returns the results to the user. The better the formulas are, the more effective the program is. ❖ It's important to keep in mind that computer algorithms are simple, they must have a clear beginning and end, along with all steps necessary to complete their tasks. There are no commands that aren't required for the current actions. 2.2. Ways to write algorithms: Algorithms for computers can be written in a variety of ways. A flowchart, which is a graph that shows the phases and direction of your algorithm from start to finish, is commonly used by programmers. Next, pseudocode, a semi-linguistic method of describing the steps required in an algorithm that omits superfluous details such as subroutine elimination, variable declarations, and system-specific code, may be used by other programmers. 2.3. What is it used for?
Figure 2: Identify the products and print the price Figure 3: Discount on products
❖Then I add further commands to the software so that it prints a few more lines for consumers to enter the serial number and quantity of the product they want to purchase. This is also the place for the program to receive information from the customer and start calculating and finally printing the price. Figure 6: Enter serial number and quantity ❖ I also use a while statement to tell customers when they entered the wrong serial number. For example, the product I show here is 6, however if they type a number higher than 6, it will print "This product does not exist" and then show an additional line below it that says "re-enter here: ". Figure 7: Error Message ❖ I used an If-else expression to create a product discount. In this scenario, I believe if- else is the best option. When the quantity of a product reaches 5, the software reduces the price for the customer by 2/5, and if the quantity does not exceed 5, the program prints the original price. The else statement is used to apply the If statement to a different product. To get a better understanding, take a look at the images below.
Figure 8: Discount product Figure 9: Discount product
And here is the program when it has a discount: Figure 12: Has a discount And here is the program that notifies customers when they enter the wrong serial number: Figure 13: Enter wrong serial number
Task 4 - Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language (D1) I think this program can solve the problem but not in a really perfect way and can be applied in a real store. And here are some problems of the program that I found, I think it would be a great program if these problems were fixed: