















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
This is a document for programming assignment 1
Typology: Essays (university)
1 / 23
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 Mai Van Thai Student ID BHAF Class BH-AF- 2005 - 2.2-P Assessor name Tran Xuan Thanh 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
Grade: Assessor Signature: Date: Lecturer Signature:
I. Introduce Target of the report : The report will discuss the definition, usage and characteristics of algorithm, how to apply algorithms to write program more effectively, outline the process in building an application, explain, using examples, how algorithms are used to solve simple business problems and the steps needed to be followed to produce a working program solution, introduce a program to solve problems in business.
3. A good algorithm is: + Simple, easy to understand (anyone who looks at it can understand), easy to write programs, easy to install. + Saving the resources of the computer, takes less memory, run fast as possible (running time is less than the other algorithms). 4. Example: use algorithms to describe the boiling of vegetables.
1. Defining or Analyzing the problem Defining or Analyzing the problem is a necessary and very important skill to solve a problem or customer request, only when identifying and analyzing the problem clearly, we can solve it properly, thoroughly, effectively, exactly and fastest. + The problem is defined by doing a preliminary investigation. + Defining a problem helps us to understand problem clearly. + It is also known as Program Analysis. Image 7 : Defining or Analyzing the problem. 2. Design A design is the path from the problem to a solution in code. Algorithm design helps programmers see problems and steps to solve problems most clearly, it has been abstracted to help programmers encode problems quickly and accurately. The well designed program is likely to be: + Easier to read and understand later. + Less of bugs and errors. + Easier to extend to add new features. + Easier to program in the first place.
Flowchart:
3. Coding: + An algorithm expressed in programming languages is called Program. + Writing a program is called Coding. + The logic that has been developed in the algorithm is used to write program. Image 9 : Coding. 4. Documenting the programming:
6. Debugging: Debugging helps to produce perfect products. + Debugging is a process of correcting the errors: - Programs may have logical errors which cannot be caught during compilation. - Debugging is the process of identifying their root causes. - One of the ways is to print out the intermediate results at strategic points of computation. - Another way is to use support from the IDE. + Testing vs Debugging: - Testing means detecting errors. - Debugging means diagnosing and correcting the root causes. 7. Maintenance:
2. Describe functions and draw flowchart: + Print unit price function: − Function description: Used to print the unit price of 3 types of fruit products: peach, cherry, plum. − Flowchart: Image 12 : Print unit price function. + Customer information input function: − Function description: Used to enter customer information such as: ID, Name, Age, Phone number, Address. − Flowchart: Image 13 : Customer information input function.
3. Code demo Image 17 : Code demo.
Image 18 : Code Demo running.