Fundamentals of Algorithm, Flowchart, and Program Development, Summaries of Computer Science

This report covers the basics of algorithms, flowcharts, and the program development cycle. It explores algorithm characteristics, flowchart usage, and the program development process. The document also examines the three main programming paradigms, their definitions, and relationships. It demonstrates algorithm implementation using an IDE, debugging, and coding standards. The report concludes with a restaurant program simulation, showcasing the practical application of the concepts covered.

Typology: Summaries

2022/2023

Uploaded on 08/14/2024

huy-nguyen-yoj
huy-nguyen-yoj 🇭🇰

1 document

1 / 44

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ASSIGNMENT FINAL REPORT
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Unit 1: Programming
Submission date
13th June 2024
Date Received
1st submission
13th June 2024
Re-
submission Date
Date Received
2nd submission
Student Name
NGUYEN NHAT HUY
Student ID
BD00725
Class
Assessor name
Mr. VO DUC HOANG
Student declaration
I
certify
that
the
assignment
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 P2 P3 P4 P5 P6
M1 M2 M3 M4
D1 D2 D3 D4
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c

Partial preview of the text

Download Fundamentals of Algorithm, Flowchart, and Program Development and more Summaries Computer Science in PDF only on Docsity!

ASSIGNMENT FINAL REPORT

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date 13th June 2024 Date Received 1st submission 13th June 2024 Re-submission Date Date Received 2nd submission Student Name

NGUYEN NHAT HUY

Student ID

BD

Class Assessor name Mr. VO DUC HOANG 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 P2 P3 P4 P5 P6 M1 M2 M3 M4 D1 D2 D3 D

ii Secondly, I also highly appreciate Mr. Vo Duc Hoang for his lectures and instructions which are a rich resource in knowledge for me to reference. Thirdly, a vast thankfulness goes to all my BTEC friends for the remarkable periods of time we have been experienced. Last but not least, I spectacularly express my deep gratitude to all the authors that have provided extensively the immense wisdom to be used as the reference materials throughout this document.

iii

ASSURANCE

I confirm that this report is my work relied on my research and study. I will take completely the responsibility and acknowledge the consequences if there are any proofs of plagiarism. Learners declaration I certify that the work submitted for this assignment is my own and research sources are fully acknowledged. Student signature: Date:

v

(IDE) 58

2.1 Programming paradigms........................................................................... 58 2.1.1 Definitions and characteristics of programming paradigms and their relationship (P2).......................................................................................................... 58 2.1.2 Critically evaluate the source code of an application which implements the programming paradigms, in terms of the code structure and characteristics. (D2) 63 2.2 Integrated Development Environment (IDE).............................................. 2.2.1 Use the IDE to manage the development process of the program (Visual Studio 2017) (M3)............................................................................................ 68 2.2.2 Common features of an IDE (Visual Studio 2017) (M2)........................ 75 2.2.3 Evaluate the use of an IDE for development of applications contrasted with not using an IDE (D3)........................................................................................... 84 CHAPTER 3 LO4 Debugging process and Coding standard............................... 3.1 Debugging process.................................................................................... 3.1.1 The debugging process and how it works in the Visual Studio (P4)..... 87 3.1.2 How the debugging process be used to help develop more secure, robust applications (M4).............................................................................................. 91 3.2 Coding standard........................................................................................ 93 3.2.1 The coding standard I have used in my code. (P5)............................... 93 3.2.2 The reason why a coding standard is necessary in a team as well as for the individual (D4)........................................................................................................ 99 CHAPTER 4 Implement basic algorithms in code using an IDE........................ 100 4.1 About my program................................................................................... 4.1.1 Test case and explanation.................................................................. 100 4.1.2 Enhancement......................................................................................

vi

CONCLUSION .......................................................................................................

REFERENCES ...................................................................................................... 130

FIGURE SOURCES ...............................................................................................

LIST OF TABLES

Table 1: Differences of procedural, object-oriented and event-driven paradigms.............. 58 Table 2: List of prefix of Controls in EDP............................................................................

  • Figure 1.1: Step 1 of solving a life problem {1}................................................................................... LIST OF FIGURES
  • Figure 1.2: Step 2 of solving a life problem {2}...................................................................................
  • Figure 1.3: Step 3 of solving a life problem {3}...................................................................................
  • Figure 1.4: Step 4 of solving a life problem {4}...................................................................................
  • Figure 1.5: Example of flowchart........................................................................................................
  • Figure 1.7: The Symbol - Oval.............................................................................................................
  • Figure 1.8: The Symbol – Parallelogram..............................................................................................
  • Figure 1.9: The symbol - Rectangle.....................................................................................................
  • Figure 1.10: The symbol - Diamond....................................................................................................
  • Figure 1.11: The symbol - Arrow.........................................................................................................
  • Figure 1.12: Algorithm to calculate the product of numbers less than n using flowchart diagram....
  • Figure 1.13: The program to calculate the product of numbers less than n.......................
  • Figure 1.14: The program to check if numbers within range are prime or not....................
  • Figure 1.15: What is computer language {7}......................................................................
  • Figure 1.16: Assembly language [8]...................................................................................
  • Figure 1.17: Example of HLL (in C# language)..................................................................
  • Figure 1.18: The steps taken from writing code to execution.............................................
  • Figure 1.19: Hello World {8}................................................................................................
  • Figure 1.20: Display E asterisk result.................................................................................
  • Figure 1.21: Display E asterisk source code – First way....................................................
  • Figure 1.22: Display E asterisk source code – Second way...............................................
  • Figure 1.23: The flowchart of the main part of the scenario............................................... viii
    • 1.25: The flowchart of the main part of the function UsingService()........................ Figure 1.24: The flowchart of the function InputInfor()........................................................23 Figure
  • Figure 1.26: The flowchart of a typical element of the function UsingService()..................
  • Figure 1.27: The flowchart of the function LeaveTheComment().......................................
  • Figure 1.28: The flowchart of the function Paying()............................................................
  • Figure 1.29: The flowchart of the function PrintTheBill().....................................................
  • Figure 1.30: Whole source code.........................................................................................
  • Figure 1.31: The code of introduction.................................................................................
  • Figure 1.32: The code of declaration..................................................................................
  • Figure 1.33: The code of the main part...............................................................................
  • Figure 1.34: The code of the function InputInfor()..............................................................
  • Figure 1.35: The embodiment code of the function UsingService()....................................
  • Figure 1.36: The code of the function LeaveTheComment()..............................................
  • Figure 1.37: The code of the function Paying()...................................................................
  • Figure 1.38: The code of the function PrintTheBill()...........................................................
  • Figure 2.1: PP example - Calculate perimeter and surface of a triangle............................
  • Figure 2.2: PP example - Source code to check if numbers within range are prime or not
  • Figure 2.3: OOP example – Dinner with CIAO...................................................................
  • Figure 2.4: OOP example – the Solution Explorer..............................................................
  • Figure 2.5: EDP example – CIAO’s Solution Explorer........................................................
  • Figure 3.1: Red underline facility example..........................................................................
  • Figure 3.2: Missing pieces of code facility example............................................................
  • Figure 3.3: Break point facility example..............................................................................
  • Figure 3.4: Example of name conventions in my program.................................................

ix Figure 3.5: Example of prefix controls name in my program.............................................. 89 Figure 3.6: Example of layout conventions in my program................................................. Figure 3.7: Example comment convention in my program................................................. 91 Figure 4.1: frmWelcome – Enjoy and Login button’s code................................................. 93 Figure 4.2: The code of checking input in frmPaymentMethod.......................................... 94 Figure 4.3: Two functions of checking name and card number.......................................... Figure 4.4: frmUseService – Display table of food code................................................... Figure 4.5: frmUseService – Delete button’s code........................................................... 106 Figure 4.6: frmUsingService – Print Bill button’s code...................................................... Figure 4.7: frmUsingService – Exit button’s code............................................................. Figure 4.8: frmPaymentMethod – Transfer data part........................................................ Figure 4.9: frmUseService – Transfer data part............................................................... 110 Figure 4.10: frmPay – Get data and display information’s code....................................... Figure 4.11: frmPay – Pay button’s code.......................................................................... Figure 4.12: frmPay – Exit button’s code.......................................................................... Figure 4.13: frmAdminLogin – whole code....................................................................... 116 Figure 4.14: frmAdminControl – menu Access’s code...................................................... Figure 4.15: frmAdminControl – End the program code...................................................

LIST OF ACRONYM

PDC (^) Program development cycle LLL (^) Low-Level Languages/ Machine Languages MLL Middle-Level Languages/ Assembly Languages

Perfomed Student: Nguyen Nhat Huy 1

INTRODUCTION

This report will bring to you the basic knowledge about algorithm, flowchart and the steps of developing a complete program and discuss meticulously the steps taken from writing code to execution and the relationship between the written algorithm and the code variant. It also explains 3 types of Programming paradigm and their relationships, common features of Integrated Development Environment, debugging process and code standard. Furthermore, it’s the evaluation when using and not using of an IDE, the reasons debugging process help applications more secure, robust and the important of a coding standard toward a team and the individual. Finally, it’s the implement of CIAO applications – a simulate sequence of restaurant program for indolent people to enjoy a fast, convenience and proper dinner!

Perfomed Student: Nguyen Nhat Huy 2 CHAPTER 1 Define basic algorithms to carry out an operation and outline the process of programming an application.

1.1 Definition of algorithm and Process in building an application (P1)

An algorithm is a set of clear and precise steps or rules designed to solve a specific problem or perform a particular task. Algorithms are commonly used in computer science and mathematics, but they can also be applied in various other fields

1.1.1 Problem solving and algorithm

1.1.1.1 Algorithm definition As you can see, algorithm in computer science is briefly considered as a limited sequence of steps of actions related to mathematical and deductive logic expresses the process, which can be computation, data-processing or others, of finding solution for a problem and gives the predictable result based on the initial entered data or parameters. Just simplify problems as how to make a cup of coffee. To do that, we go through steps of things such as boil the water, put power of coffee into cup, pour water and stir. We need coffee, water as the ingredients and have a fragrant cup of coffee as the result. Continue, mathematical problems can be “Print the phrase “Hello World”.”, “What is the maximum of a range?”, “Solve the first order and second order equation.”… Additional, there are several types of algorithms:  Numerical algorithms.  Algebraic algorithms.  Geometric algorithms.  Sequential algorithms.  Operational algorithms.  Theoretical algorithms.

Perfomed Student: Nguyen Nhat Huy 4 Figure 1.1: Step 1 of solving a life problem {1} Step 2: Marinate the chicken for at least an hour, preferably overnight. Figure 1.2: Step 2 of solving a life problem {2} Step 3: Turn on the microwave to 200 degrees Celsius and set it for about 15 minutes. Line the tray with a silver sheet and place the chicken on it neatly. Roast the chicken for about 10 minutes. Then, take the chicken out and brush another layer of honey on the outside. Continue to grill for about 10 more minutes to complete the dish Figure 1.3: Step 3 of solving a life problem {3} Step 4: Take it out on a plate and enjoy it

Perfomed Student: Nguyen Nhat Huy 5 Figure 1.4: Step 4 of solving a life problem {4} 1.1.1.4 For example an algorithm solving a math problem

Figure 1.12: Algorithm to calculate the product of numbers less than n using flowchart diagram....

the program. S2: Input n (n > 1), create a variable named prd, prd = 1. S3: if n = 1 then moving to S4, else n = n – 1, prd = prd * n, continue S3. S4: Print prd to the screen. S5: End the program.

1.1.2 Flowchart

Perfomed Student: Nguyen Nhat Huy 7 (^1) https://www.lucidchart.com/pages/what-is-a-flowchart-tutorial They are related to other popular diagrams, such as Data Flow Diagrams (DFDs) and Unified Modeling Language (UML) Activity Diagrams.” 1 We can understand it simply as: In IT (Information Technology), flowcharts are a pictorial way to describe algorithms. They are highly appreciated as it is more straightforward to follow the structure though pictures than though words. In addition, it is nearly effortless to draw a flowchart which is complex and difficult and alter it into programming language. A flowchart’s basic elements are a set of symbols (containing messages) which has standard samples established for a number of different applications and interconnecting lines with arrows. 1.1.2.2 Some common symbols using in a flowchart The Oval (A beginning or an ending)

Figure 1.7: The Symbol - Oval.............................................................................................................

The oval, also referred to as terminator, is usually used to represent the start and end of a process. The shape frequently contains “Start” and “End” within. It highlights the beginning-point and finishing-point of the program. Parallelogram (Input/ Output symbol)

Figure 1.8: The Symbol – Parallelogram..............................................................................................

The Input/ Output symbol, also known as the “Data Symbol”, represents to declare variables or generated data needed for the task and show the output usually by printing commands.

Perfomed Student: Nguyen Nhat Huy 8 The Rectangle (A step in the flowcharting process)

Figure 1.9: The symbol - Rectangle.....................................................................................................

The rectangle, or the decision symbol, shows an act in your diagram. It can be a process, an action, or a function. The Diamond (Indicate a decision)

Figure 1.10: The symbol - Diamond....................................................................................................

This illustrates a question or a decision which is required to choose to move forward. This will get the value true or false, yes or no dependent on the answer or consequences thereafter. To exemplify, here is a simple command to find the minimum of 2 numbers: if a < b, min = a. In this case, the condition is “a < b”, if the value of a less than the value of b (true), the program will execute the main part by min equivalent to a, if it’s not (false), the program won’t do anything. The Arrow (Indicate Directional Flow)

Figure 1.11: The symbol - Arrow.........................................................................................................

The most ordinary use of arrow in reality is to guide humans to the destination. In a flowchart, arrows have the similar advantage which is to lead the viewer though the flowcharting