Programming Assignment 1 (Btec level 5), Essays (university) of Information Technology

This is a document for programming assignment 1

Typology: Essays (university)

2019/2020

Uploaded on 10/28/2021

thai-mv
thai-mv 🇻🇳

5

(6)

3 documents

1 / 23

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1 | P a g e
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
Mai Van Thai
Student ID
BHAF190193
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
D1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download Programming Assignment 1 (Btec level 5) and more Essays (university) Information Technology 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 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

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

Table of Contents Page

  • I. Introduce
  • II. Algorithm
      1. Definition
      1. Characteristics
      1. A good algorithm is
      1. Example.
  • III. Steps of building an application
      1. Defining or Analyzing the problem
      1. Design
      1. Coding
      1. Documenting the programming
      1. Testing...............................................................................................................................................................
      1. Debugging
      1. Maintenance
  • IV. Practice solving simple business problems
      1. Description of the program.......................................................................................................................
      1. Describe functions and draw flowchart
      1. Code demo
  • V. From writing code to execution
  • VI. Conclusion
  • VII. References

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.

  • Step 1: Pick up the vegetables, wash the vegetables, then let the water drain. Image 2 : Example step 1.
  • Step 2: Add water to the pot and bring to a boil. Image 3 : Example step 2.
  • Step 3: Put the vegetables in a pot of boiling water for about 3 minutes, add the main noodles, and stir well. Image 4 : Example step 3.
  • Step 4: Take cooked vegetables to a plate. Image 5 : Example step 4.

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:

  • Flowchart is a diagrammatic representation of an algorithm.
  • It uses different symbols to represent the sequence of operations, required to solve a problem.
  • It serves as a blueprint or a logical diagram of the solution to a problem. Flowchart symbols:
  • Represents Start, End
  • Represents Input, Output data
  • Represents Process (actions, calculations)
  • Represents Decision Marking
  • Represents Pre-defined Process/ module
  • Represents off page connector which are used to indicate that the flow chart continues on another page. Page numbers are usually placed inside for easy reference
  • Connector Symbol represents the exit to, or entry from, another part of the same flow chart. It is usually used to break a flow line that will be continued elsewhere

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:

  • Document explains:
  • How the program works and how to use the program (user manual).
  • How to maintain the program (developer manual).
  • Details of particular programs, or particular pieces of programs, are easily forgotten or confused without suitable documentation. 5. Testing: Testing is a very important step in programming. It shows the mistakes in the previous steps.
  • Testing is the process of executing a program with the deliberate intent of finding errors.
  • Testing is needed to check whether the expected output matches the actual output.
  • Testing is done during every phase of program development.
  • Initially, requirements can be tested for its correctness.
  • Then, the design (algorithm, flow charts) can be tested for its exactness and efficiency.

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:

  • Maintenance is the process that continues after the product is completed, it helps the product to enhance efficiency, add fewer features suitable for the situation.
  • Program maintenance:
  • Continuing process of maintenance and modification.
  • To keep pace with changing requirements and technologies.
  • Maintainability of the program is achieved by:
  • Modularizing it.
  • Providing proper documentation for it.
  • Following standards and conventions (naming conventions, using symbolic onstants, etc.). Image 10 : 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.

  • Function of entering order information and summing. − Function description: Used to enter order information: weight of each item. − Flowchart: Image 1 4 : Function of entering order information and summing. .

3. Code demo Image 17 : Code demo.

Image 18 : Code Demo running.