Pro

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 131

Higher Nationals

Internal verification of assessment decisions – BTEC (RQF)

INTERNAL VERIFICATION – ASSESSMENT DECISIONS


Programme title Higher National Diploma in Networking

Assessor Internal Verifier


Unit 01: Programming
Unit(s)
Design & Implement a GUI based system using a suitable
Assignment title Integrated Development Environment

Student’s name
List which assessment Pass Merit Distinction
criteria the Assessor has
awarded.
INTERNAL VERIFIER CHECKLIST
Do the assessment criteria awarded
match those shown in the assignment
brief? Y/N
Is the Pass/Merit/Distinction grade
awarded justified by the assessor’s Y/N
comments on the student work?
Has the work been assessed accurately?
Y/N
Is the feedback to the student:
Give details:
• Constructive?
• Linked to relevant assessment criteria?
• Identifying opportunities for improved Y/N Y/N
performance? Y/N
• Agreeing actions? Y/N
Does the assessment decision need
amending? Y/N

Assessor signature Date

1
Internal Verifier signature Date
Programme Leader signature (if
required) Date

Confirm action completed


Remedial action
taken

Give details:

Assessor signature Date


Internal Verifier
signature Date
Programme Leader
signature (if required) Date

Higher Nationals - Summative Assignment Feedback Form


Student Name/ID
Unit Title Unit 01: Programming
Assignment Number 3 Assessor
Date Received 1st
Submission Date submission
Date Received 2nd
Re-submission Date submission

Assessor Feedback:

LO1. Define basic algorithms to carry out an operation and outline the process of programming an
application.
Pass, Merit & P1 M1 D1
Distinction Descripts
LO2. Explain the characteristics of procedural, object-orientated and event-driven programming,
conduct an analysis of a suitable Integrated Development Environment (IDE).
Pass, Merit & P2 M2 D2
Distinction Descripts
LO3. Implement basic algorithms in code using an IDE.
Pass, Merit & P3 M3 D3

2
Distinction Descripts
LO4. Determine the debugging process and explain the importance of a coding standard.
Pass, Merit & P4 P5 M4 D4
Distinction Descripts

Grade: Assessor Signature: Date:


Resubmission Feedback:

Grade: Assessor Signature: Date:


Internal Verifier’s Comments:

Signature & Date:

* Please note that grade decisions are provisional. They are only confirmed once internal and
external moderation has taken place and grades decisions have been agreed at the assessment
board.

Pearson Higher Nationals in


Computing

Unit 01: Programming


Assignment 01

3
4
General Guidelines
1. A Cover page or title page – You should always attach a title page to your
assignment. Use previous page as your cover sheet and be sure to fill the details
correctly.
2. This entire brief should be attached in first before you start answering.
3. All the assignments should prepare using word processing software.
4. All the assignments should print in A4 sized paper, and make sure to only use one
side printing.
5. Allow 1” margin on each side of the paper. But on the left side you will need to leave
room for binging.

Word Processing Rules


1. Use a font type that will make easy for your examiner to read. The font size should be
12 point, and should be in the style of Time New Roman.
2. Use 1.5 line word-processing. Left justify all paragraphs.
3. Ensure that all headings are consistent in terms of size and font style.
4. Use footer function on the word processor to insert Your Name, Subject, Assignment
No, and Page Number on each page. This is useful if individual sheets become
detached for any reason.
5. Use word processing application spell check and grammar check function to help edit
your assignment.

Important Points:
1. Check carefully the hand in date and the instructions given with the assignment. Late
submissions will not be accepted.
2. Ensure that you give yourself enough time to complete the assignment by the due
date.
3. Don’t leave things such as printing to the last minute – excuses of this nature will not
be accepted for failure to hand in the work on time.
4. You must take responsibility for managing your own time effectively.
5. If you are unable to hand in your assignment on time and have valid reasons such as
illness, you may apply (in writing) for an extension.
6. Failure to achieve at least a PASS grade will result in a REFERRAL grade being
given.
5
7. Non-submission of work without valid reasons will lead to an automatic REFERRAL.
You will then be asked to complete an alternative assignment.
8. Take great care that if you use other people’s work or ideas in your assignment, you
properly reference them, using the HARVARD referencing system, in you text and
any bibliography, otherwise you may be guilty of plagiarism.
9. If you are caught plagiarising you could have your grade reduced to A REFERRAL or
at worst you could be excluded from the course.

6
Student Declaration

I hereby, declare that I know what plagiarism entails, namely to use another’s work and to
present it as my own without attributing the sources in the correct way. I further understand
what it means to copy another’s work.

1. I know that plagiarism is a punishable offence because it constitutes theft.


2. I understand the plagiarism and copying policy of the Edexcel UK.
3. I know what the consequences will be if I plagiaries or copy another’s work in any of
the assignments for this program.
4. I declare therefore that all work presented by me for every aspects of my program,
will be my own, and where I have made use of another’s work, I will attribute the
source in the correct way.
5. I acknowledge that the attachment of this document signed or not, constitutes a
binding agreement between myself and Edexcel UK.
6. I understand that my assignment will not be considered as submitted if this document
is not attached to the attached.

rvindubndrsnnyk@gmail.com
Student’s Signature: Date: 2019 – 07 – 22
(Provide E-mail ID) (Provide Submission Date)

7
8
Higher National Diploma in Computing
Assignment Brief

Student Name /ID Number


Unit Number and Title Unit 01: Programming
Academic Year 2019
Unit Tutor
Assignment Title Design & Implement a GUI based system using a suitable
Integrated Development Environment
Issue Date
Submission Date
IV Name & Date
Submission Format

This submission will have 3 components


1. Written Report
This 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. (The recommended word count is 1,500–2,000 words for the
report excluding annexures)

2. Implemented System (Software)

The student should submit a GUI based system developed using an IDE. The system should
connect with a backend database and should have at least 5 different forms and suitable
functionality including insert, edit and delete of main entities and transaction processing.
3. Presentation

With the submitted system student should do a presentation to demonstrate the system that was
developed. Time allocated is 10 to 15 min. Student may use 5 to 10 PowerPoint slides while doing
the presentation, but live demonstration of the system is required. Evaluator will also check the
ability to modify and debug the system using the IDE.

Unit Learning Outcomes:

LO1. Define basic algorithms to carry out an operation and outline the process of
programming an application.

LO2. Explain the characteristics of procedural, object-orientated and event-driven


programming, conduct an analysis of a suitable Integrated Development
Environment (IDE).

9
LO3. Implement basic algorithms in code using an IDE.

LO4. Determine the debugging process and explain the importance of a coding
standard

10
Assignment Brief and Guidance:

Task 1: Define basic algorithms to carry out an operation and outline the process of
programming an application (LO1)

Searching on an array/list is to find a given element on the array and return whether
it is found or not and return its position if found. Linear search and binary search
are two popular searching algorithms on arrays.
1.1 Define what an algorithm is and outline the characteristics of a good algorithm.
Develop algorithms for linear search and binary search using Pseudo code (P1).

1.2 Describe the steps involve in the process of writing and executing a program.
Take an array of 10 or more elements and dry run the above two algorithms.
Show the outputs at the end of each iteration and the final output (M1).

1.3 Define what Big-O notation is and explain its role in evaluating efficiencies of
algorithms. Write the Python program code for the above two algorithms and
critically evaluate their efficiencies using Big-O notation (D1).

Task 2: Explain the characteristics of procedural, object-orientated and event-


driven programming, conduct an analysis of a suitable Integrated Development
Environment (LO2).
2.1 Define what is meant by a Programming Paradigm. Explain the main
characteristics of Procedural, Object oriented and Even-driven paradigms and
the relationships among them (P2).

2.2 Analyze the features of an Integrated Development Environment (IDE) and


explain how those features help in application development (M2).

2.3 Write small snippets of code as example for the above three programming
paradigms using a suitable programming language(s) and critically evaluate
their structure and the characteristics (D2).
Ayubo Drive is the transport arm of Ayubo Leisure (Pvt) Ltd, an emerging travel &
tour company in Sri Lanka. It owns a fleet of vehicles ranging from cars, SUVs to
vans.

The vehicles that it owns are hired or rented with or without a driver. The tariffs are
based on the vehicle type. Some of the vehicle types that it operates are, small car,
sedan car, SVUs, Jeep (WD), 7-seater van and Commuter van. New vehicle types
are to be added in the future.

Vehicle rent hire options are described below.

1. Rent (With or without driver) – For each type of vehicle rates are given per day,
per week and per month. Rate for a driver also given per day. Depending on the
rent period the total rent amount needs to be calculated. For example: if a

11
vehicle is rented for 10 days with a driver, total amount to be calculated as
follows:

Total rent = 1_week_car_rent + 1_day_rent x 3 + 1_day_driver_rent x 10

2. Hire (with driver only) – These are based on packages such as airport drop,
airport pickup, 100km per day package, 200km per day package etc. Standard
rates are defined for a vehicle type for a package type that is applicable for that
type of vehicle. For each package maximum km limit and maximum number of
hours are also defined. Extra km rate is also defined which is applicable if they
run beyond the allocated km limit for the tour. For day tours if they exceed max
hour limit, a waiting charge is applicable for extra hours. Driver overnight rate
and vehicle night park rate also defined which is applicable for each night when
the vehicle is hired for 2 or more days.

Task 3: Implement basic algorithms in code using an IDE (LO3).

3
3.1 Design suable algorithms for vehicle tariff calculation for rents and hires (P3).

Ideally 3 functions should be developed for this purpose as follows:


Function 1: Rent calculation.
Return the total rent_value when rented_date, return_date, with_driver parameters
are sent in. with_driver parameter is set to true or false depending whether the
vehicle is rented with or without driver.

Function 2: Day tour - hire calculation.


Calculate total hire_value when start_time, end_time, start_km_reading,
end_km_reading parameters are sent in. Should return base_hire_charge,
waiting_charge and extra_km_charge as output paramters.

Function 3: Long tour - hire calculation.


Calculate total hire_value when start_date, end_date, start_km_reading,
end_km_reading parameters are sent in. Should return base_hire_charge,
overnight_stay_charge and extra_km_charge as output parameters.

3.2 Implement the above algorithms using visual studio IDE (using C#.net) and
design the suitable database structure for keeping the tariffs for vehicle types
and different packages which must be used for implementing the above
functions (M3).

3.3 What is the purpose of using an IDE in application development? Evaluate the
use of the Visual Studio IDE for your application development contrasted with
not using an IDE. (D3).
Task 4: Determine the debugging process and explain the importance of a coding
standard (LO4).

12
4
Design and build a complete system for the vehicle reservation and billing
for Ayubo drive. This includes the completing the database design started in
3.2 and designing the suitable interfaces for vehicle and package additions
and reservation handling and customer billing (P4).

4.1
4.2 What is debugging an application? Explain the importance of the debugging
facility in Visual studio IDE. Debug your source code by putting few
debugging points in your application (P4).

4.3 Implement the above functionalities using the IDE while adopting the coding
standards to improve maintainability of the code. Explain the coding standards
used in your code in the written report (P5).

4.4 Evaluate how you used the debugging process to develop more secure, robust
application with examples (M4).

4.5 Explain the coding standards you have used in your application development.
Critically evaluate why a coding standard is necessary in a team as well as for
the individual. (D4).

13
Table of Contents
Acknowledgment.....................................................................................................................15

Algorithms................................................................................................................................18

Characteristics of a good algorithm.........................................................................................20

Linear search............................................................................................................................21

Binary Search...........................................................................................................................23

The Programming Process.......................................................................................................26

Big-O Notation and Algorithm Efficiency...............................................................................40

Programming Paradigms..........................................................................................................45

Procedural Programming Paradigm.........................................................................................46

Object Oriented Programming Paradigm (OOP).....................................................................48

Event-driven Programming Paradigm......................................................................................50

Integrated Development Environment (IDE)...........................................................................55

Common Features of IDEs.......................................................................................................57

Procedural Programming Paradigm.........................................................................................59

Object Oriented Programming (OOP) Paradigm.....................................................................64

Event Driven Programming Paradigm.....................................................................................69

Ayubo Drive – System Interfaces..........................................................................................101

The Login Interface............................................................................................................102

The Main Interface.............................................................................................................103

File Menu.......................................................................................................................104

Go to Menu....................................................................................................................105

Calculate Menu..............................................................................................................106

About..............................................................................................................................106

The Add New User Interface.............................................................................................107

The Change User Password Interface................................................................................107

Delete My Account Option................................................................................................108

14
The Exit Option..................................................................................................................108

Packages.............................................................................................................................108

Vehicles..............................................................................................................................109

Rent Calculator...................................................................................................................109

Day Tour – Hire Calculator................................................................................................110

Long Tour – Hire Calculator..............................................................................................111

Debugging..............................................................................................................................112

The Importance of Debugging Options..................................................................................112

Debugging Methods...............................................................................................................112

Breakpoints........................................................................................................................112

Coding Standards...................................................................................................................114

One statement per line........................................................................................................114

Indentation..........................................................................................................................115

Naming...............................................................................................................................116

Comments..........................................................................................................................117

Data Tooltip...........................................................................................................................118

Diagnostic Tools....................................................................................................................119

The Assignment Gantt Chart..................................................................................................123

Feedback Form.......................................................................................................................124

Figure 1IPO-Model..................................................................................................................30
Figure 2Basic Symbols in a flowchart.....................................................................................31
Figure 3Example: Flowchart....................................................................................................32
Figure 4Example: Pseudocode.................................................................................................33
Figure 5Example: Desk-checking............................................................................................35
Figure 6Python code – Linear Search algorithm......................................................................44
Figure 7Output of Python code – Linear Search algorithm - With an available element........44
Figure 8Output of Python code – Linear Search algorithm - With an unavailable element....45

15
Figure 9Python code – Binary Search algorithm.....................................................................46
Figure 10Output of Python code – Binary Search algorithm - With an available element.....46
Figure 11Output of Python code – Binary Search algorithm - With an unavailable element. 47
Figure 12Programming Paradigms..........................................................................................48
Figure 13Event-driven programming process..........................................................................53
Figure 14Events on .NET.........................................................................................................55
Figure 15IDE Diagram.............................................................................................................58
Figure 16Eclipse Logo.............................................................................................................59
Figure 17Code Blocks Logo....................................................................................................59
Figure 18CodeLite Logo..........................................................................................................59
Figure 19Xcode Logo..............................................................................................................59
Figure 20Visual Studio Logo...................................................................................................59
Figure 21NetBeans Logo.........................................................................................................59
Figure 22PyCharm Logo..........................................................................................................59
Figure 23IntelliJ IDEA Logo...................................................................................................59
Figure 24Pascal Code...............................................................................................................62
Figure 25Pascal Run Error.......................................................................................................64
Figure 26Pascal 1st Window....................................................................................................64
Figure 27Pascal Wrong Input...................................................................................................65
Figure 28Pascal Second Value.................................................................................................65
Figure 29Pascal Output Total...................................................................................................66
Figure 30Python Code - Part 1.................................................................................................67
Figure 31Python Code - Part 2.................................................................................................67
Figure 32Python Code - Part 3.................................................................................................68
Figure 33Python Output - Part 1..............................................................................................70
Figure 34Python Output - Part 2..............................................................................................70
Figure 35Python Output - Part 3..............................................................................................71
Figure 36Calculator – Form.....................................................................................................72
Figure 37Calculator – Code.....................................................................................................73
Figure 38Add – Code...............................................................................................................74
Figure 39Subtract – Code.........................................................................................................74
Figure 40Multiply – Code........................................................................................................74
Figure 41Divide – Code...........................................................................................................75
Figure 42Calculator – Executed...............................................................................................76
16
Figure 43Add Button................................................................................................................76
Figure 44Subtract Button.........................................................................................................77
Figure 45Multiply Button........................................................................................................77
Figure 46Divide Button............................................................................................................78
Figure 47Ayubo Drive Database..............................................................................................85
Figure 48Vehicle Table Design View......................................................................................86
Figure 49Package Table Design View.....................................................................................86
Figure 50Vehicle Table Records..............................................................................................87
Figure 51Package Table Records.............................................................................................87
Figure 52Rent Calc Code Part 1...............................................................................................88
Figure 53Rent Calc Code Part 2...............................................................................................89
Figure 54Rent Calc Code Part 3...............................................................................................90
Figure 55Rent Calc Code Part 4...............................................................................................91
Figure 56Day Tour Hire Calc Code Part 1...............................................................................92
Figure 57Day Tour Hire Calc Code Part 2...............................................................................93
Figure 58Day Tour Hire Calc Code Part 3...............................................................................94
Figure 59Day Tour Hire Calc Code Part 4...............................................................................95
Figure 60Long Tour Hire Calc Code Part 1.............................................................................96
Figure 61Long Tour Hire Calc Code Part 2.............................................................................97
Figure 62Long Tour Hire Calc Code Part 3.............................................................................98
Figure 63Long Tour Hire Calc Code Part................................................................................99
Figure 64Rent Calc Code Output...........................................................................................100
Figure 65Day Tour Hire Calc Code Output...........................................................................101
Figure 66Day Tour Hire Calc Code Output...........................................................................102
Figure 67 Login Interface.......................................................................................................105
Figure 68 LogIn Table - Design View...................................................................................106
Figure 69 LogIn Table Records.............................................................................................106
Figure 70 Main Interface........................................................................................................107
Figure 71 File Menu...............................................................................................................108
Figure 72 Ho to Menu............................................................................................................108
Figure 73 Calculate Menu......................................................................................................109
Figure 74 About Box..............................................................................................................109
Figure 75 Add New User.......................................................................................................110
Figure 76 Change User Password..........................................................................................110
17
Figure 77 Packages................................................................................................................111
Figure 78 Vehicles.................................................................................................................112
Figure 79 Rent Calculator......................................................................................................113
Figure 80 Day Tour - Hire Calculator....................................................................................113
Figure 81 Long Tour Hire – Calculator.................................................................................114
Figure 82 Breakpoints............................................................................................................116
Figure 83 Breakpoints 2.........................................................................................................116
Figure 84 Breakpoints 3.........................................................................................................117
Figure 85 Coding Standards 1................................................................................................118
Figure 86 Coding Standards 2................................................................................................119
Figure 87 Coding Standards 3................................................................................................120
Figure 88 Coding Standards 4................................................................................................121
Figure 89 Data Tooltip...........................................................................................................122
Figure 90 Diagnostic Tools....................................................................................................123
Figure 91 Diagnostic Tools 1.................................................................................................123
Figure 92 Gantt Chart.............................................................................................................126
Figure 93 Feedback Form......................................................................................................127

18
749Table 1Dry run - Linear Search – With an available element............................................39
Table 2Dry run - Linear Search – With an unavailable element..............................................40
Table 3Dry run - Binary Search – With an available element.................................................41
Table 4Dry run - Binary Search – With an unavailable element.............................................42
Table 5Efficiency Analysis – Linear Search algorithm...........................................................46
Table 6Efficiency Analysis – Binary Search algorithm...........................................................48
Table 7Algorithm - Inputs & Outputs......................................................................................80

19
Introduction
This document contains the answer to the assignment given on the subject Programming
under the title Design & Implement a GUI based system using a suitable Integrated
Development Environment.

20
Task 1: Define basic algorithms to carry out an operation and outline the process of
programming an application (LO1)

Searching on an array/list is to find a given element on the array and return whether it is
found or not and return its position if found. Linear search and binary search are two popular
searching algorithms on arrays.
1.4 Define what an algorithm is and outline the characteristics of a good algorithm. Develop
algorithms for linear search and binary search using Pseudo code (P1).

Algorithms

 An algorithm can be defined as a set of steps that need to be followed in a certain


order to accomplish a task. Following are some algorithms used in day to day
life[ CITATION Wha19 \l 1033 ].

o For getting from home to school


1) Walk to the bus station
2) Take the bus
3) Wal to school from the bus station

o For making a grilled cheese sandwich


1) Obtain bread
2) Apply cheese
3) Grill
 In computer science an algorithm is a step by step procedure for a computer program
to accomplish a task[ CITATION Wha19 \l 1033 ].

21
Following are some of the popular algorithms used.
 Audio and video compression algorithms
o E.g.: - The quick transmission of live videos on google hangouts
 Route finding algorithms
o E.g.: - Google maps use this algorithm to figure out how to get from one place
to another
 Optimization and scheduling algorithms
o E.g.: - The NASA use this algorithm to arrange the solar panels of the
International Space Station

Even though the above algorithms are very complex they are also step by step procedures
used to accomplish tasks[ CITATION Wha19 \l 1033 ].

22
Characteristics of a good algorithm

Unambiguous
 An algorithm should be clear and definite. Each of its steps and their input/outputs
should be clear and must only lead to only one meaning.

Input
 An algorithm should have zero or more well defined inputs.

Output
 An algorithm should have one or more well defined outputs and should match the
desired output.

Finiteness
 An algorithm must terminate after a finite number of steps.

Feasibility
 An algorithm should be feasible with the available resources.

Independent
 An algorithm should have step by step directions, which should be independent
from any programming languages.

23
Linear search

 In linear search the algorithm will search individual elements in an array by


starting to compare the elements from the first one until it is found or until the end
of the array is reached[ CITATION Lin19 \l 1033 ].

Advantage(s)
 Can be used on any type of array regardless of the type of sortation
(sorted/unsorted).

Disadvantage(s)
 Search time is longer when searching large arrays.

 Following is a simple algorithm represented using pseudo codes on how the linear
search works.

24
Pseudo Code

/* Linear Searching algorithm */

Begin

/* Declare an integer array with 15 elements */

numbers = array (‘i’, [142, 685, 572, 865, 891, 933, 749, 409, 982, 828, 518, 875, 414, 964,
160])

/* Function */

function linear_search (search_key)


for x = 0 to 15
if search_key = (numbers [x]) then
return x
break
end if
return -1
end function

/* Main Program */

input s_key
index = linear_search (s_key)
if index > -1 then
print (‘Number found at index:’, index)
else
print (‘Number not in the array.’)
end if
End

25
Binary Search

 In binary search the algorithm will compare the middle element and continue the
search on upper or lower half of the array based on the fact the value is greater
than or smaller than the middle. This continues until the value is found or it is
confirmed that the value is not present

Advantage(s)
 Search time is considerably smaller than the search time it is taken to search a
large array using the linear search.

Disadvantage(s)
 The binary search can only be applied to a sorted array.

 Following is a simple algorithm represented using pseudo codes on how the binary
search works.

26
Pseudo code

Begin

/* Declare a sorted integer array with 15 elements */

prices = array (‘i’, [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300,
1400, 1500])

/* Function */

function binary_search (search_key)


lowest = 0
highest = 14
while lowest <= highest
middle = (lowest + highest) // 2
if search_key == prices [middle]
return (middle)
else if search_key > prices[middle]
lowest = middle + 1
else
highest = middle - 1
end if
end if
return -1
end while
end function

/* Main Program */

input s_key
index = binary_search (s_key)
if index > -1
print (“Price found at index:”, index)
27
else
print (“Price not available in the array.”)
end if

End

28
1.5 Describe the steps involve in the process of writing and executing a program. Take an
array of 10 or more elements and dry run the above two algorithms. Show the outputs at
the end of each iteration and the final output (M1).

The Programming Process


 Writing and executing a program involves steps just like any other problem-
solving task. This process is known as the programming process. It includes 5
main steps

29
1) Defining the problem
 The task of defining the problem consists of identifying what you know and what
you want to obtain. In other words, input and output. In this stage of the
programming process the limitations and goals of the program are identified by
consulting with the user/client. Then they are defined in a manner which is
understandable by both the user and the programmer. The IPO-Model (Input
Process Output Model) can be used to define the problem without any ambiguity

 Following is an example of an instance where the IPO-Model is used.

Figure 1IPO-Model

30
2) Planning the solution (Algorithm Design)
 There are 2 ways to plan a solution to a problem.

Flowcharts
 A flowchart is a diagrammatic representation of a step by step process which leads
to a solution to a problem. It has arrows showing the order of the program and
boxes and other symbols representing actions

 Following are some basic shapes used in flowcharts.

Figure 2Basic Symbols in a flowchart

31
 Following is a simple flowchart representing an algorithm which adds 2 numbers.

Figure 3Example: Flowchart


Pseudocodes

32
 Pseudocode is a structured English like language which represents a solution to a
problem. It’s considered as a first draft because eventually it has to be translated
in to a programming language. Pseudocode allows the programmer to focus on the
program logic without having to concern about the precise syntax of a
programming language. However, pseudocodes are not executable by a computer.

 Following is an example of a simple pseudocode.

Figure 4Example: Pseudocode

33
3) Coding the program
 In this stage of the programming process the flowchart or the pseudocode will be
translated in to a programming language. A programming language is a set of
rules that provides a way to instruct the computer what operations to perform.
Following are some of the popular programming languages.
 Java
 Python
 C
 C#
 C++

34
4) Testing the program
 After coding the program, the programmer must prepare test the program. In this
stage of the programming process following phases are involved.

Desk-checking / Dry Run


 In desk-checking the logic of the program will be mentally traced in an attempt to
ensure that the program is error free and workable. Sometimes this phase is avoided
by the programmer who is eager to run the program and is looking for a shortcut.

Figure 5Example: Desk-checking

Translating
 A translator is a program that checks the syntax of a program and then translates it
into a form the computer can understand. In case of any syntax errors it shows a
detailed description of the error called a diagnostic.

35
Debugging
 Debugging means detecting, locating, and correcting bugs (mistakes) by running the
program. These bugs are logic errors that are corrected using the previously planned
test data. It is important to test every part of the program to ensure the program is bug
free.

36
5) Documenting the program
 Documentation is a written detailed description of the entire program throughout its
every stage. It includes specific facts about the program such as origin of the problem,
program logic, data record descriptions, program listings, testing results, and
comments.

37
 Dry run - Linear Search – With an available element

numbers s_key search_key x search_key =return index index > -1 output


(numbers [x]) value
142 933 933 0 false - - - -
685 - - 1 false - - - -
572 - - 2 false - - - -
865 - - 3 false - - - -
891 - 4 false - - - -
933 - - 5 true 5 5 true Number
found at
index: 5
749 - - - - - - - -
409 - - - - - - - -
982 - - - - - - - -
828 - - - - - - - -
518 - - - - - - - -
875 - - - - - - - -
414 - - - - - - - -
964 - - - - - - - -
160 - - - - - - - -
749Table 1Dry run - Linear Search – With an available element

38
 Dry run - Linear Search – With an unavailable element

numbers s_key search_key x search_key =return index index > -1 output


(numbers [x]) value
142 500 500 0 false - - - -
685 - - 1 false - - - -
572 - - 2 false - - - -
865 - - 3 false - - - -
891 - - 4 false - - - -
933 - - 5 false - - - -
749 - - 6 false - - - -
409 - - 7 false - - - -
982 - - 8 false - - - -
828 - - 9 false - - - -
518 - - 10 false - - - -
875 - - 11 false - - - -
414 - - 12 false - - - -
964 - - 13 false - - - -
160 - - 14 false -1 -1 false Number not
in the array.
Table 2Dry run - Linear Search – With an unavailable element

39
 Dry run - Binary Search – With an available element

prices s_key search_k lowesthighes lowest middlesearch_key search_key return index index outpu
ey t <= == > value > -1 t
highes prices[midd prices[midd
t le] le]
100 300 300 0 14 true 7 false false - - - -
200 - - 0 6 true 3 false false - - - -
300 - - 0 2 true 1 false true - - - -
400 - - 2 2 true 2 true - 2 2 true Price
found
at
index:
2
500 - - - - - - - - - - - -
600 - - - - - - - - - - - -
700 - - - - - - - - - - - -
800 - - - - - - - - - - - -
900 - - - - - - - - - - - -
100 - - - - - - - - - - - -
1100 - - - - - - - - - - - -
1200 - - - - - - - - - - - -
1300 - - - - - - - - - - - -
1400 - - - - - - - - - - - -
1500 - - - - - - - - - - - -
Table 3Dry run - Binary Search – With an available element

40
 Dry run - Binary Search – With an unavailable element

prices s_key search_k lowesthighes lowest middlesearch_key search_key retur index index output
ey t <= == > n > -1
highes prices[midd prices[midd value
t le] le]
100 1700 1700 0 14 true 7 false true - - - -
200 - - 8 14 true 11 false true - - - -
300 - - 12 14 true 13 false true - - - -
400 - - 14 14 true 14 false true - - - -
500 - - 15 14 false - - - -1 -1 false Price
not
availabl
e in the
array.
600 - - - - - - - - - - - -
700 - - - - - - - - - - - -
800 - - - - - - - - - - - -
900 - - - - - - - - - - - -
100 - - - - - - - - - - - -
1100 - - - - - - - - - - - -
1200 - - - - - - - - - - - -
1300 - - - - - - - - - - - -
1400 - - - - - - - - - - - -
1500 - - - - - - - - - - - -
Table 4Dry run - Binary Search – With an unavailable element

41
1.6 Define what Big-O notation is and explain its role in evaluating efficiencies of
algorithms. Write the Python program code for the above two algorithms and critically
evaluate their efficiencies using Big-O notation (D1).

Big-O Notation and Algorithm Efficiency

 It is important to make algorithms that are more efficient in order to get the
required performance without wasting resources. If an algorithm is not efficient
there will be a notable delay when handling large volumes of data despite the
speed of the computer.
 To get know the pure efficiency of an algorithm we establish a relationship
between running time (execution time) and volume of data. It is because the
running time depends on the volume of data.

Running time (t) Volume of Data (n)


 The above principal is used in Big-O notation.

 There are 3 types of analysis used in Big-O notation.

1) Best Case
 Checking the efficiency at the most favorable situation.

2) Worst Case
 Analyzing the efficiency at the most adverse situation

3) Average Case
 The average of the best case and worst-case scenarios.

42
Python code – Linear Search algorithm

Figure 6Python code – Linear Search algorithm

 Output of Python code – Linear Search algorithm - With an available element

Figure 7Output of Python code – Linear Search algorithm - With an available element

 Output of Python code – Linear Search algorithm - With an unavailable element

43
Figure 8Output of Python code – Linear Search algorithm - With an unavailable element

 Efficiency Analysis – Linear Search algorithm

Best Case 1 comparison Item found at the 1st element


Worst Case n comparison Item found on the last element
or searching for a non-existing
item.
Average Case (n + 1) / 2 comparison Average of the above 2
Big-O Notation = O(n)
Table 5Efficiency Analysis – Linear Search algorithm

44
 Python code – Binary Search algorithm

Figure 9Python code – Binary Search algorithm

45
 Output of Python code – Binary Search algorithm - With an available element

Figure 10Output of Python code – Binary Search algorithm - With an available element

 Output of Python code – Binary Search algorithm - With an unavailable element

46
Figure 11Output of Python code – Binary Search algorithm - With an unavailable element

 Efficiency Analysis – Binary Search algorithm

Best Case 1 comparison Item found at the 1st middle


element
Worst Case Log2 n comparison Searching for a non-existing
item
Average Case (Log2 n + 1) / 2 comparison Average of the above 2
Big-O Notation = O (Log2 n)
Table 6Efficiency Analysis – Binary Search algorithm

47
Task 2: Explain the characteristics of procedural, object-orientated and event-driven
programming, conduct an analysis of a suitable Integrated Development Environment (LO2).

4.6 Define what is meant by a Programming Paradigm. Explain the main characteristics of
Procedural, Object oriented and Event-driven paradigms and the relationships among
them (P2).

Programming Paradigms
Programming paradigms are styles of programming which has characteristic features and are
classified based on those features. There are many programming languages. But all of them
need to follow some strategy when implemented and these methodologies/strategies are
known as programming paradigms. Some programming languages are classified into multiple
paradigms. There are a lot of paradigms to fulfill each and every demand. Following are
some the basic programming paradigms.

Figure 12Programming Paradigms

48
Procedural Programming Paradigm
It is one of the oldest programming paradigms. It is based on the Von Neuman architecture. It
recognizes the fact that computers have reusable memory space that can change state
(variables). It performs step by step tasks by changing the state. Each step affects the global
state of the computation. The main focus of this paradigm is in how to achieve the goal.
Example: -
total = total + 22
the above statement changes the state of the “Variable total” by incrementing it by 22.

Advantages of Procedural Paradigms


 Very simple to implement
 It contains loops, variables, selections etc.
 Can be easily translated into machine code

Disadvantages if Procedural Paradigm


 Complex problems can’t be solved
 Parallel programming is not possible

49
Characteristics of Procedural Programming
o Discipline and idea – Digital hardware technology and ideas of Van Neumann
o Incremental change of the program state as function of time
o Execution of computational steps in an order governed by the control
structures
o Straight forward abstraction of the way a traditional Van Neumann computer
works
o Similar to descriptions of everyday routines
 E.g.: - Food Recipe
o The natural abstraction is the procedure
o Abstracts one or more actions to a procedure, which can be called as a single
command

Salient features in Procedural Programming


o Looping controls
o Selection statements
o Assignable values

Examples of procedural programming languages


o Algol : Developed by Peter Naur
o Basic : Developed by John G Kemeny and Thomas E Kurtz
o C : Developed by Dennis Ritchie and Ken Thompson
o Fortran : Developed by John Brackus for IBM (International
Business Machines)
o Pascal : Developed by Niklaus Wirth

50
Object Oriented Programming Paradigm (OOP)
Object Oriented Paradigm focus on the objects that a program is representing. It defines
objects which will send messages to each other. All kind of computations are performed on
the objects only. Objects have their own internal (encapsulated) state and public interfaces.
Objects belong to classes. Normally all objects of the same class will have same kind of
behavior. Classes are usually arranged in a class hierarchy.
Many popular programming languages are considered as Object Oriented. They are mostly a
mixture of OOP and imperative looking code.
Simula-67 was the first OOP language. Soon Smalltalk followed as the first pure OOP
language.

Advantages of Object-Oriented Programming


 Data Security
o
 Inheritance
 Code reusability
 Flexibility

Characteristics of Object-Oriented Programming


 Discipline and idea – The theory of concepts, and models of human interaction with
real world scenarios
 Data and operations are encapsulated
 Internal properties of objects are hidden
 Objects interact by message passing
 Classes are organized in inheritance hierarchies

51
Examples of OOP Languages
 Simula : First ever OOP language
 Java : Developed by James Gosling at Sun Microsystems
 C++ : Developed by Bjarne Stroustrup
 Objective-C : Designed by Brad Cox
 Visual Basic .NET : Developed by Microsoft
 Python : Developed by Guido van Rossum
 Ruby : Developed by Yukihiro Matsumoto
 Smalltalk : Developed by Alan Kay, Dan Ingalls, Adele Goldberg
 CLOS : Common Lisp Object System)
 Eiffel : Developed by Eiffel Software.
 Modula-3 : Developed by Elego Software Solutions GmbH
 Ada 95 : Developed by Jean Ichbiah

52
Event-driven Programming Paradigm
In event driven programming paradigm, the control flow of the program execution is
determined by the occurrence of events.
E.g.: - Left Mouse Click
Right Mouse Click
Key Press
The occurrence of these events is observed by a program known as the event listener. If it
detects any predefined event has occurred it will run a program called event handler. Event
handler will trigger a callback function or a method once the event is occurred.
The following image represents a simple process of an event driven program

Figure 13Event-driven programming process

53
Characteristics of Event Driven programming
Service-orientated processing
In service-oriented processing complex problems get divided and form a collection of
processes that provides services to the application. These services usually run as a
background processes hidden from the user. These processes respond to events to produce
actions that are required to provide the specific service.

Events, Handlers and Loops


An event could be anything that occurs inside the program. It could be something obvious
like a mouse click or something subtle like a key down or a key up. Using events, the
programmer can decide how to and when to start the event handler.
Event loops keeps looping in the program so that when an event occurs, they can call the
correct event handler to run the code.

Time driven events


A time object which occur at regular intervals is used to generate time driven events.
 Instances where timer objects are used
o In clocks
o In stopwatches
o In countdowns

The coding of the clock or the countdown will generate the regular event needed to update
the display.

54
Trigger Functions
A trigger function responds to events which the code encounters. The programmer has a wide
range of choices to select from in the programming environment.

Figure 14Events on .NET

The above image shows some of the trigger events available in a .NET program.
After selecting a trigger event the coder can enter the code, they want to run from the event
trigger.

55
Technical terms used in event driven programming
Event Source
When an event occurs, it will occur on an event source object. This event source provides
information about the event to its handler.
Event Source examples
 A button
 A checkbox
 A dropdown menu

Event Object
It is the object that identifies the occurred event
Event Listener
An event listener waits for an event to occur in a procedure or a function of a computer
program. Examples for an event are,
 User clicking or moving the mouse
 Pressing a key on the keyboard
 An internal timer

Event Handler
It is used to simply deal with the occurred event which allows the programmer to write a code
that will be executed once the event occurs.

Examples of Event Driven Programming Languages


 Visual Basic
 Visual C++
 Java

56
To get a better understanding about the relationship between the procedural, object oriented
and event driven paradigms they need to be compared. The following table demonstrates the
comparison between those paradigms.

Procedural Object Oriented Event Driven


 Derived  Treats data  Control
from structured fields as objects flow is determined
programming manipulated mainly by events,
 based on through predefined such as mouse
Description
the concept of methods only clicks or interrupts
modular including timer
programming or the
procedure call
 Local  Objects  Main loop
variables  Methods  Event
 Sequence  Message handlers
 Selection passing
 Iteration  Information
 Modularizati hiding
Main Traits on  Data
abstraction
 Encapsulatio
n
 Polymorphis
m
 Inheritance
Relatable  Structured  Procedural  Procedural
Paradigms  Imperative
 C  Common  JavaScript
 C++ Lisp  ActionScript
 Lisp  C++  Visual Basic
 PHP  C#  Elm
 Python  Eiffel
Example  Wolfram  Java
Languages Language  Kotlin
 PHP
 Python
 Ruby
 Scala
 JavaScript

4.7 Analyze the features of an Integrated Development Environment (IDE) and explain how
those features help in application development (M2).

Integrated Development Environment (IDE)


An IDE is a software suit with a collection of tools needed to code, design and test software.
Throughout the process of developing a software a developer has to use various kinds of tools

57
such as,
 Text Editors
 Code Libraries
 Compilers
 Test Platforms
 Debuggers

Without an IDE a developer has to find and use those tools separately which will complicate
and slow the developing process. An IDE can simplify the software development and can
identify and minimize the mistakes in the source code. Even though some IDEs focus on
specific programming languages such as Python or Java most IDEs have cross language
capabilities[ CITATION Rou19 \l 1033 ].

Figure 15IDE Diagram

58
There are many IDEs designed for the purpose of creating software. Following are some of
the popular IDEs used by the programmers.

1) Visual Studio by Microsoft 5) Eclipse

Figure 20Visual Studio Logo Figure 16Eclipse Logo

2) NetBeans 6) Code :: Blocks

Figure 21NetBeans Logo Figure 17Code Blocks Logo

3) PyCharm 7) CodeLite

Figure 22PyCharm Logo Figure 18CodeLite Logo

4) IntelliJ IDEA 8) Xcode

Figure 23IntelliJ IDEA Logo Figure 19Xcode Logo

59
Common Features of IDEs
Even though there are many IDEs out there, there are some features common to all IDEs.
Text Editor (Code Editor)
All the IDEs usually have place to write and manipulate the source code known as the text
editor (Code Editor). Even though some IDEs have visual based components that has to be
dragged and dropped most have an interface with language specific syntax
highlighting[ CITATION Wal19 \l 1033 ].
Debugger
The Debugger in the IDE is used to detect and correct the errors within the source code. It
simulates real world scenarios to test the application. It helps programmers to test the various
segments of the code and identify any bugs before the application is released[ CITATION
Wal19 \l 1033 ].
Compiler
Compilers are used to translate the source code of the program from the programming
language into a language that the computer can understand.
E.g.: - Binary Code
After the translating process the machine code is then analyzed to ensure its accuracy. Then
the compiler parses and optimizes the code to get the maximum performance[ CITATION
Wal19 \l 1033 ].
Code Completion
The code completion feature intelligently identifies and inserts common code components
which makes the coding process easy for the coder. Thanks to this feature programmers can
save time and avoid the likelihood of typos and bugs[ CITATION Wal19 \l 1033 ].
Programming Language Support
Some IDEs offer single language support while the others offer multi lingual support. Before
coding a program, the coder must figure out in which programming language is he going to
code. After that he can choose a supported IDE for that language and begin
coding[ CITATION Wal19 \l 1033 ].
E.g.: - Ruby
Python
Java IDE Tools
Integrations and Plugins
It is no surprise that integrations need to be considered in and IDE because its already

60
included in the name IDE. An IDE is the development portal of a programmer. So being able
to incorporate all the necessary development tools will improve the development workflow
and the productivity. So, it’s important to understand how an IDE fits into the ecosystem of
existing tools before installing a new IDE[ CITATION Wal19 \l 1033 ].

Benefits of using an IDE


 An IDE serves as a single environment for most of the developing tools such as,
o Version Control Systems
o Debugging Tools etc.
 Code completion capabilities improve the workflow of the programming process and
thereby reducing the time and effort needed to code the program.
 Because of the enhanced debugging options an IDE will automatically check for
errors to ensure a quality code.
 Due to the refactoring capabilities (The process of restructuring the existing source
code) programmers can make mistake free renaming changes.

61
2.3 Write small snippets of code as example for the above three programming
paradigms using a suitable programming language(s) and critically
evaluate their structure and the characteristics (D2).
Procedural Programming Paradigm
The following image displays a simple code written using the programming language pascal
which is a procedural programming language. The function of the code is to add 2 numbers
inputted by the user and then display the total.

Figure 24Pascal Code

 Following is the code shown in the above image.

var num_1, num_2, Total: integer;


begin
write ('Input the 1st number: ');
readln (num_1);
write ('Input the 2nd number: ');
readln (num_2);
Total: = num_1 + num_2;
write ('The total is:', Total);
readln;
end.
As shown above the first thing done in the code is declaring the variables needed to perform
the process. According to the code there are 3 variables as,
1) num_1
2) num_2
3) Total

62
All the above variables are declared as integer in the above code.
In the second line of the code a command is given to begin the program. In pascal a program
will not run unless the begin command is properly given.
In the next line of the code the user is asked to input the first number to add. In that line a
command named “write” can be seen. In pascal language “write” and “writeln” are used to
display texts or variables on the screen.
In the next command line, the following can be seen,
readln (num_1);
the function of this command is to read the input of the user and store it in the memory under
the given variable name and type. In this case its “integer: num_1”. The purpose of the
command “readln” is to read a variable entered from the keyboard and then move to the next
line. The command “read” can also be used for this purpose but then the cursor won’t move
to the next line. Both of those commands will continue to read until the “ENTER” key in the
keyboard is pressed.
In the next command line, the user is asked to enter the second number to add. After entering
it the program will read it like before and store it in the variable “num_2”.
In the next command line, the values of the 2 variables “num_1” and “num_2” are added and
the result will be stored in the variable declared before as “Total”.
In the next command line, the program will display sum of the 2 values entered by the user.
In other words, the value of variable “Total”.
Then a “readln” command is given to hold the program without exiting. Otherwise the
program will end instantly after it completed all the commands.
At last the “end” command is given to end the program. The dot at the end of the “end”
command is compulsory in pascal because otherwise it’ll display an error message as shown
in the following image.

63
Figure 25Pascal Run Error
Following is the window that appears once the program is compiled and ran.

Figure 26Pascal 1st Window


As shown in the above image the output of the pascal program is given in a command prompt
(cmd) window. The color of the font might differ from PC to PC based on their cmd settings.

The first line that appears in the output is,


“Input the 1st number:”
This is where the user types and enters the number.
In here the user has to keep in mind that only integer values can be entered because it is
previously declared to be integer. If by mistake the user input another value type the
following error message is shown.

64
Figure 27Pascal Wrong Input
If a correct integer value is entered then the program will ask for the second value like shown
in the following image.

Figure 28Pascal Second Value


In here also an integer value must be entered. Then the program will calculate the sum of the
2 numbers and display it as shown in the following image.

65
Figure 29Pascal Output Total
Now the program has executed all the command lines and once the “Enter” key is pressed the
program will exit.
As shown in the above images of the program output the processing part of the program is
not visible to the user. This is because to display something in the output the “write” or
“writeln” command has to be given.

66
Object Oriented Programming (OOP) Paradigm
The following images show a code written using the Python language. Python is a
programming language which supports multiple programming paradigms. But the code below
belongs to the OOP paradigm.

Figure 30Python Code - Part 1

Figure 31Python Code - Part 2

67
68
Figure 32Python Code - Part 3
The python code shown in the above images works with a class named “Employee” and the
objects of that class. As shown in the Pytohn_Code__Part_1 there are 4 functions defined in
the code before the main program begins. Respectively the 4 functions are named,
1. __init__
2. show_product_details
3. issuing_product
4. product_discount

The “__init__” function serves the purpose of creating the desired class in the python
program.
The “show_product_details” function is there to display the attributes of the objects when
needed.
The “issuing_product” function calculate the stock balance after a product is issued.
The “product_discount” function calculates the discount of each product.

69
As shown in the Pytohn_Code__Part_1 there are 3 main attributes of the class “Employee”.
They are,
1. prd_name : The product name
2. stock_bal : The available stock of the product
3. price : The price of the product

In the function “show_product_details” it will display the values stored as the above 3
attributes of the class object.
In the function “issuing_product” a new parameter is introduced as the “amount_issued”
which is required to calculate the leftover stock available after a product is issued. The
function will subtract the number of issued products from the available stock and store the
result as the available stock.
In the function “product_discount” it will minimize the price of the product by subtracting
10% from the price of each product. And then the name of the product and the discounted
price is displayed.
As shown in the Python_Code__Part_2 the first thing the main program will do after it starts
is creating the objects of the class “Employee”. According to the code 3 objects are created
from the class. Following are the names and attribute values of those objects.
 p1 = Product ("Flash Light", 35, 150)
 p2 = Product ("Battery", 250, 30)
 p3 = Product ("Bulb", 100, 45)

Then the details of those 3 objects will be displayed by calling in the function
“show_product_details”.
Then the stock balance of each product will change according to the given parameter values
of the function “issuing_product”.
After that the program will again display the product details with the changed values of the
attribute “stock_bal”.
At last the program will calculate and display the discount price of each product along with
the product name.
Then the program will end because all of the given commands are executed.

70
The following images show the output of the above python code once the program is
executed.

Figure 33Python Output - Part 1


As previously mentioned, the program will first display the details of the objects of the class
“Product”.

Figure 34Python Output - Part 2


Then after the calculation of the available stock is done the program will display the product

71
details again along with the changed values as shown in the above image.

Figure 35Python Output - Part 3


At last the program will display the discount prices of each product as shown in the above
image.

72
Event Driven Programming Paradigm
In event driven programming there are 2 things to be considered. They are the interface of the
program which has all the trigger events and the source code which has all the methods and
functions.
So, the following image shows a simple windows form created using the C# language in the
Microsoft Visual Studio 2019. The program of that windows form is a calculator which can
add, subtract, multiply and divide 2 given numbers.

Figure 36Calculator – Form


As shown in the above image there are 4 buttons included in the window for calculation
purposes. The user will be able to insert the 2 numbers into the first 2 textboxes and then
click a desired calculation button which will trigger the event and then after the event handler
is executed it will display the output of the calculation in the third textbox.
The following image shows the source code of the program which consists of only few
simple C# statements.

73
Figure 37Calculator – Code
As shown in the above image there are 4 separate code components for each of the 4 buttons
in the windows form. But if the code is observed carefully it can be seen that the only
difference between the 4 code components are the mathematical symbol of each calculation.
The code to add the 2 numbers:

74
Figure 38Add – Code
The above code is used to perform the additions and display the results.
The code to subtract the 2nd number from the 1st number:

Figure 39Subtract – Code


The above code is used to perform the subtractions and display the results.
The code to multiply the 2 numbers:

Figure 40Multiply – Code

75
The above code is used to perform the multiplications and display the results.
The code to divide the 1st number by the 2nd number:

Figure 41Divide – Code


The above code is used to perform divisions and display the results.
Now that the program is coded and the interface is designed it has to be executed to check the
functionalities.
The following image shows how it is displayed after the execution.

76
Figure 42Calculator – Executed
As shown in the image the cursor is at the first textbox so that the user can input the first
value.
After the values are input the functionalities of all the 4 buttons must checked.
Add Button

Figure 43Add Button


As shown in the above image the result of the calculation is correct. Therefore, the purpose of
the add button is served.
Subtract Button

77
Figure 44Subtract Button
As shown in the above image the result of the calculation is correct. Therefore, the purpose of
the subtract button is served.
Multiply Button

Figure 45Multiply Button


As shown in the above image the result of the calculation is correct. Therefore, the purpose of
the multiply button is served.

78
Divide Button

Figure 46Divide Button


As shown in the above image the result of the calculation is correct. Therefore, the purpose of
the divide button is served.
So, in conclusion the calculator program written using C# serves as a simple example to show
the use of event driven programming paradigm.

79
5
5.1 Design suable algorithms for vehicle tariff calculation for rents and hires (P3).

When developing a software for Ayubo Drive transport arm of the Ayubo Leisure (Pvt) Ltd,
they require 3 main calculations to be done using the software. The 3 calculations are,
1) Rent Calculation
2) Day Tour - Hire Calculation
3) Long Tour – Hire Calculation

To include these calculations in the software, 3 algorithms have to be designed first. When
designing the algorithms, the user inputs and the desired outputs have to be taken into
consideration. The following table show the relevant inputs and outputs of the 3 algorithms
that will be designed.

Algorithm Name Input(s) Outputs(s)


Rented Date
Rent Calculation Return Date Total Rent
Boolean Driver
Start Time Total Hire Value
End Time Base Hire Charge
Day Tour – Hire Calculation
Start KM Reading Waiting Charge
End KM Reading Extra KM Charge
Start Date Total Hire Value
End Date Base Hire Charge
Long Tour – Hire Calculation
Start KM Reading Overnight Charge
End KM Reading Extra KM Charge
Table 7Algorithm - Inputs & Outputs

After figuring out the inputs and outputs the algorithms can be designed. This can be done
using either pseudo codes or flowcharts. But on this occasion algorithms will be designed
using pseudo codes.
 Following is the algorithm designed for “Rent Calculation” using pseudo codes.

Begin
Function rent_calculation (rented_date, return_date, boolean_driver)
start_date = rented_date
end_date = return_date
no_of_days = end_date – start_date

80
/* Find the no. of months, weeks and days */
months = no_of_days / 30
weeks = (no_of_days % 30) / 7
days = (no_of_days % 30) % 7
Retrieve the required vehicle records from the database for calculation
purposes.
/* Finding the monthly, weekly, and daily rate */
monthly_rate = rent_per_month * months
weekly_rate = rent_per_week * weeks
daily_rate = rent_per_day * days
if (driver == true) then
driver_rate = daily_driver_rate * no_of_days
else
driver_rate = 0
end if
/* Calculating the total rent value */
total_rent = monthly_rate + weekly_rate + daily_rate + driver_rate
print no_of_days
print months
print weeks
print days
print monthly_rate
print weekly_rate
print daily_rate
print driver_rate
print total_rent
End Function
End

81
 Following is the algorithm designed for “Day Tour - Calculation” using pseudo codes.

Begin
Function day_tour_calculaion (start_time, end_time, start_km_read, end_km_read)
st_time = start_time
e_time = end_time
st_km = start_km_read
e_km = end_km_read
/* Calculating the no. of hours */
no_of_hours = e_time - st_time
Retrieve the required package records from the database for calculation
purposes.
if (no_of_hours > max_no_of_hours) then
/* Calculating the extra no. of hours */
extra_no_of_hours = no_of_hours - max_no_of_hours
else
extra_no_of_hours = 0
end if
/* Calculating the extra hour charge */
extra_hour_charge = extra_no_of_hours * rate_per_extra_hour
no_of_kms = e_km – st_km
if (no_of_kms > max_no_of_kms) then
extra_no_of_kms = no_of_kms - max_no_of_kms

else
extra_no_of_kms = 0
end if
extra_km_charge = extra_no_of_kms * rate_per_extra_km
/* Calculating the total hire value */
total_hire_value = package_rate + extra_hour_charge + extra_km_charge
print package_rate
print extra_hour_charge
print extra_km_charge
print total_hire_value

82
End Function
End

83
 Following is the algorithm designed for “Long Tour - Calculation” using pseudo
codes.

Begin
Function long_tour_calculation (start_date, end_date, start_km_read, end_km_read)
st_date = start_date
e_date = end_date
st_km = start_km_read
e_km = end_km_read
/* Calculating the no. of days and kms */
no_of_days = e_date – st_date
no_of_kms = e_km – st_km
Retrieve the required package records from the database for calculation
purposes.
if (no_of_kms > (max_no_of_kms * no_of_days)) then
extra_no_of_kms = no_of_kms - (max_no_of_kms * no_of_days)
else
extra_no_of_kms = 0
end if
/* Calculating the extra km charge, base hire charge, driver and vehicle
overnight charge and the total overnight charge */
extra_km_charge = extra_no_of_kms * rate_per_extra_km
base_hire_charge = package_rate * no_of_days
driver_overnight_charge = driver_rate_per_night * (no_of_days - 1)
vehicle_overnight_charge = vehicle_rate_per_night * (no_of_days - 1)
total_overnight_charge = driver_overnight_charge +
vehicle_overnight_charge
/* Calculating the total hire value */
total_hire_value = extra_km_charge + base_hire_charge +
total_overnight_charge
print base_hire_charge
print total_overnight_charge
print extra_km_charge
print total_hire_value

84
End Function
End

85
5.2 Implement the above algorithms using visual studio IDE (using C#.net) and design the
suitable database structure for keeping the tariffs for vehicle types and different packages
which must be used for implementing the above functions (M3).

Before implementing the above 3 algorithms for the calculations of the Ayubo Drive
company a database should be created containing the details of vehicles and packages.
The following 2 tables should be in the database and those tables should contain all the values
needed to for the above 3 calculations.
1) Vehicle table – To store vehicle details.
2) Package table – To store package details.

The following image shows the database and the tables that are created to store the vehicle
and package details.

Figure 47Ayubo Drive Database


As shown in the above image the database is named as “Ayubo Drive” and the tables are
named as “Package” and “Vehicle”.

86
The following images shows the design view of the “Vehicle” table which contains the names
of the columns and their data type and maximum length.

Figure 48Vehicle Table Design View


The following image shows the design view of the “Package” Table which contains the
names of the columns and their data type and maximum length.

Figure 49Package Table Design View

87
The following image show the records that are stored in the “Vehicle” table

Figure 50Vehicle Table Records


The following image shows the records stored in the “Package” table

Figure 51Package Table Records


Now that the database structure is created to store vehicle and package details, the above 3
algorithms can be implemented using the Visual Studio IDE. To implement the algorithms
the console applications written using .NET C# will be used.

88
The following set of images shows the C# code of the rent calculation algorithm in the
console application source code.

Figure 52Rent Calc Code Part 1

89
Figure 53Rent Calc Code Part 2

90
Figure 54Rent Calc Code Part 3

91
Figure 55Rent Calc Code Part 4
The following set of images shows the C# code of the day tour hire calculation algorithm in
the console application source code.

92
Figure 56Day Tour Hire Calc Code Part 1

93
Figure 57Day Tour Hire Calc Code Part 2

94
Figure 58Day Tour Hire Calc Code Part 3

95
Figure 59Day Tour Hire Calc Code Part 4

96
The following set of images shows the C# code of the long tour hire calculation algorithm in
the console application source code.

Figure 60Long Tour Hire Calc Code Part 1

97
Figure 61Long Tour Hire Calc Code Part 2

98
Figure 62Long Tour Hire Calc Code Part 3

99
Figure 63Long Tour Hire Calc Code Part

The source codes of all the 3 calculations are based on the algorithms written in the activity
3.1. Small modifications are made to improve the quality of the program and to ease the use.
Now that the C# algorithms are implemented the main program can be executed and the
calculations can be done.
The following image shows the output of the rent calculation when all the inputs are inserted
in the correct format.

100
Figure 64Rent Calc Code Output
As shown in the above image all the required outputs are resulted by the program. However,
the user will have to be cautious when using the console application because if the input is
not in the correct format then it won’t be accepted by the program.

101
The following image shows the output of the day tour hire calculation when all the inputs are
inserted in the correct format.

Figure 65Day Tour Hire Calc Code Output


As shown in the above image the program gives all the required outputs of the day tour hire
calculation.

102
The following image shows the output of the long tour hire calculation when all the inputs are
inserted in the correct format.

Figure 66Day Tour Hire Calc Code Output


As shown in the above image all the required outputs of the long tour hire calculation are
delivered by the program.

103
5.3 What is the purpose of using an IDE in application development? Evaluate the use of the
Visual Studio IDE for your application development contrasted with not using an IDE.
(D3).

There are many purposes that can be achieved by using an IDE to develop a software instead
of using another method.
Following is a list of reasons that prove the values of using an IDE in application
development
 It improves the developing process efficiency
o Because of the features included in an IDE it makes the developing process
more efficient. Features such as,
 Automatic code completion
 Realtime debugging
 Support for multiple programming languages

help to improve the efficiency of the development process.


 The availability of advanced debugging functions
 No need to memorize all the syntaxes because of the auto suggest functions
 The availability of a customizable GUI with many options for the developer to choose
from

Visual studio is a popular IDE used by the application developers all over the world. But if a
developer decides to use another method to develop an application instead of using an IDE,
he or she will face a series of problems in their development process.
Following are some of the problems that may occur due to a lack of an IDE
 The developer will have to find the different developing tools manually and use them
separately because an environment with the use of multiple tools is not available.
 The debugging of the application will be a hard and long process due to the lack of
enhanced debugging options
 The developer will have to memorize all the codes and syntaxes needed to program
the application because auto suggest options are not available
 The developer will have to be cautious when typing the source code because if an
error is made during the typing process it will be very hard to identify.
 The developing process will take a longer time than usual because using the
developing tools are used one by one.

104
 Because the developing process is longer the cost will also be higher because more
resources are needed to complete the developing process.

However, there are some advantages also to not using an IDE.


Following are the advantages a developer can have by not using an IDE
 The knowledge of the developer will improve and sharpen because he or she has to
memorize all the codes need for the program.
 Even though IDEs offer a lot they are also considered as a bit too advanced and
sophisticated. Therefore, it may not be the best choice for a beginner level developer.
But the alternate method offers a simple way to develop program that can be
understood by both beginner and advanced level programmers. So even if it takes
time to develop applications using an alternate method the beginner level programmer
will have a good understanding about the whole programming process.

Following are some of the advantages gained by using the Microsoft Visual Studio as an IDE
to develop and design applications[ CITATION Dav15 \l 1033 ].
 It provides rich development tools to all developers globally on any platform such as
web, mobile, server and desktop.
 It provides a wide selection of development languages such as Visual Basic, C#, PHP,
Objective-C, JavaScript and Visual C++.
 The Microsoft .NET Framework provides support for language interoperability
 It can be easily used by individual programmers as well as teams.

4.1 Design and build a complete system for the vehicle reservation and billing for Ayubo
drive. This includes the completing the database design started in 3.2 and designing
the suitable interfaces for vehicle and package additions and reservation handling and
customer billing (P4).

Ayubo Drive – System Interfaces


To make the Ayubo Drive Application more user friendly it can be implemented on C#
windows forms which will be far easier to use than the console application. When
implementing the system using GUI s the following interfaces must be designed.
 An interface to insert, update, delete and search for records from the vehicle table
 An interface to insert, update, delete and search for records from the package table

105
 An interface to calculate the rent value
 An interface to calculate the day tour hire value
 An interface to calculate the long tour hire value
 An interface that allows the user to switch between the above interfaces which will be
the main interface of the program
 An interface for the user to log in
 An interface to add new users
 An interface to change the login password
 An about box

The following set of images show the interfaces that was designed to interact with the Ayubo
Drive System and their source code which contains all the functions and commands of the
system.
The Login Interface

Figure 67 Login Interface


This will be the first interface the user will see once the program is started. In here the user
will have to enter a valid username and a valid password which will give access to the
program. There is a check box included in the interface so that the user can choose to hide or
show the password while typing. The usernames and passwords are stored in the Ayubo
Drive database under the table name LogIn. Following is the design view of the LogIn table
that stores the usernames and passwords.

106
Figure 68 LogIn Table - Design View
The following image shows the records that are currently in the LogIn table. in other words,
the usernames and passwords.

Figure 69 LogIn Table Records


The above user names and passwords will be used to get access to the Ayubo Drive system.
after entering one of the correct usernames and passwords pairs the user must click the login
button. Then a welcome message will appear. After the user click ok on the welcome
message the main window of the program will appear.
The Main Interface

107
Figure 70 Main Interface
The main interface is used to switch between the other interfaces of the system. the main
interface has a menu strip which contains 4 menu strip items. Following are those menu strip
items.
 File Menu
 Go to Menu
 Calculate Menu
 About

The functions of those menu strip items are mentioned below.


File Menu

108
Figure 71 File Menu
The file menu is used to access he following items.
 The add new user interface
 The change user password interface
 The delete my account option
 The exit options

Go to Menu

Figure 72 Ho to Menu
The go to menu is used to access the interfaces that allows the user to insert, update, delete

109
and search records from the vehicle and package tables.
Calculate Menu

Figure 73 Calculate Menu


The calculate menu is used to access the user interfaces that allows the user to use the 3 main
calculations in the system.
About

Figure 74 About Box


The about option in the menu strip allows the user to open an interface which display certain
information regarding the software like the manufacture, the program name, program version

110
and program description.
The Add New User Interface

Figure 75 Add New User


The add new user interface is used to add new user account to the database. When adding
new user account, the username cannot be repeated. Which means that 2 users can not have
the same username. There is a check box included to hide or show the password when the
user types it. After a username and a password is typed the user must click the add user
button to add the new user to the database. If the user wishes to clear the typed username and
password, the clear button can be used. If the user wishes to exit the add new user interface
the cancel button can be used.
The Change User Password Interface

Figure 76 Change User Password

111
This interface is used to change the password of the current user. The passwords of other user
accounts cannot be changed or viewed. To change the password the user only needs to simply
type a new password and click apply. Then the user can use the new password to login to the
system. if at any point the user wishes to exit the change user password interface the cancel
button can be used. Which will take the user back to the main interface.
Delete My Account Option
This option is used to delete he user account that is currently being used. After clicking on the
option, a confirmation message will appear asking the user to confirm the deletion.
Immediately after the account is deleted, the program will exit.
The Exit Option
As the name suggests the exit option is used to exit from the program. After it is clicked a
confirmation message will pop up asking whether the user really want to exit. If the user
clicks yes, the program will exit. If the user clicks no simply the message box will close.
Packages

Figure 77 Packages
The packages interface is used to search, insert, update and delete the records from the
package table in the database. A data grid view is included in the interface to improve the
user experience. To search a package, an existing package id must be entered and the search
button must be clicked. To insert a new record all the text boxes must be filled with valid
information and the insert button must be clicked. To update an existing record, it must first
be searched. Then the user can modify any value except the package id and click the update

112
button. To delete a record the user can enter the package id of the record and click delete.
Vehicles

Figure 78 Vehicles
This in interface is used to search, insert, update and delete records from the vehicle table in
the Ayubo Drive database. A data grid view is included in the interface to improve the user
experience. To search for a vehicle record, an existing vehicle license no. must be entered and
the search button must be clicked. To insert a new record all the text boxes must be filled
with valid information and the insert button must be clicked. To update an existing record, it
must first be searched. Then the user can modify any value except the vehicle license no. and
click the update button. To delete a record the user can enter the license no. of the record and
click delete.
Rent Calculator

113
Figure 79 Rent Calculator
The rent calculator is used to calculate the rent value of a vehicle depending on the selected
vehicle, renting period and the driver parameters. A data grid view is included in the interface
for the ease of the user. Before calculating the total rate, the user must calculate the no. of
days and must select a vehicle. If the vehicle is rented with a driver, the driver check box
must be checked. Else it should be left unchecked. After that the calculate the total rate button
must be clicked. Then the program will do its calculations and display the total rent value.
Day Tour – Hire Calculator

Figure 80 Day Tour - Hire Calculator

114
This interface is used to calculate the cost of a day tour hire depending on the following facts.
 The package selected
 The time period of the hire
 The distance the vehicle has traveled

A data grid containing the available package details is included in the interface to make it
easier. To calculate the total cost, the user must first select a package. And then the no. of
hours must be calculated. After that the no. of kilometers must be calculated. And then at last
the total cost can be calculated by clicking the calculate day hire button.
Long Tour – Hire Calculator

Figure 81 Long Tour Hire – Calculator


This interface is to calculate the total cost of a long tour hire. A data grid containing the
available package details is included in the interface to make it easier. The total cot value will
depend on the following facts.
 The selected package
 The no. of days the vehicle is rented
 The no of kilometers traveled during the rental period

To calculate the total cost, the following things have to be calculated first.
 A package should be selected
 The no. of days must be calculated
 The no. of kilometers must be calculated

115
After calculating the above things, the total cost can be found by clicking the calculated day
hire button.
4.2 What is debugging an application? Explain the importance of the debugging facility
in Visual studio IDE. Debug your source code by putting few debugging points in
your application (P4).

Debugging
Debugging can be identified as a process that locates and removes bugs, errors or any other
abnormalities in a computer program. Debugging is done by the developers of the program
by using debugging tools. These debugging tool can check, detect and correct the errors or
bugs that usually prevent the program by functioning as intended. Debugging is also known
as debug[ CITATION Tec19 \l 1033 ].
The Importance of Debugging Options
Debugging is an important part of the software development process. It helps to correct the
errors within the source code of the program so that the program can run smoothly. Following
are some reason that explains why debugging is important.
 Because if the debugging process did not take place then the program can’t be
expected to run as intended
 Because it helps the programmer to locate in which part of the program is the error in.
 Because it helps to correct the issues within the source codes.
 Because it helps to get a better idea on how the program is working
 Because it can be used to find mistakes in the code
 Because it can handle errors within the program

Debugging Methods
Breakpoints
Breakpoints are a debugging method that helps to identify the values in the variables while
running the program. It allows the execution of the program to be paused when the program
reach the line with the specific breakpoint. Multiple breakpoints can be set at once. They can
also be conditional so that only when the condition is met will it get triggered[ CITATION
INT19 \l 1033 ].
Following are some breakpoints implemented in the Ayubo Drive System.

116
Figure 82 Breakpoints
As shown in the above image breakpoint are implemented in the long tour hire calculation of
the system. When the program reaches the first break point it will be paused.

Figure 83 Breakpoints 2
As shown in the above image the program is paused at the breakpoint. And the current value
of the variable in the breakpoint is show in the “Autos” section.
The current value of the variable total_no_of_days is 00:00:00.
If the program id continued. It will again be paused at the next breakpoint.

117
Figure 84 Breakpoints 3
As shown in the above image the program is continued and is stopped at the second
breakpoint.
And the value of that breakpoint and the previous break point is shown in the “Autos”
section.
The value of the previous breakpoint is changed.
Now the value of the variable total_no_of_days is 5.00:00:00. Which means 5 hours.
This is why breakpoint are very useful when debugging an application. The developer can
easily identify where it went wrong.

4.3 Implement the above functionalities using the IDE while adopting the coding
standards to improve maintainability of the code. Explain the coding standards used
in your code in the written report (P5).

Coding Standards
Coding standard can be identified as a set of guidelines, practices, programming styles or
conventions that are adhered by professional developers when writing code. They help to
ensure the safety, security and the reliability of the code. They should be practiced by every
developer because they help to prevent glitches and defects in the code[ CITATION Per19 \l
1033 ].
Following are some of the coding standards that should be practiced by a programmer.
One statement per line

118
This coding standard is self-explanatory. It simply means that there should only be a single
statement in a single line of code. If this coding standard is not followed the code becomes
messy and hard to follow. So outside programmers might have difficulties in understanding
the code. Therefore, it is always best to follow this coding standard[ CITATION Ken16 \l
1033 ].
The following image serves as evidence to the fact that the source code of the Ayubo Drive
system is written with the adherence of this coding standard

Figure 85 Coding Standards 1


As show in the above image each line of code ends with the semi colon. Nothing is typed
after the semi colon. Therefore, each line only contains one statement. So, the above coding
standard is used.
Indentation
Indentation is another coding standard that can be used to maintain code integrity. In most of
the times the purpose of indentation is to make the code clearer and more beautiful. And
thereby making it easier to understand. In programming languages like C# this doesn’t matter
much because code sections are divided using brackets. But in programming languages like
python the indentation is a very important aspect. If at least a single line is indented wrongly
it can affect the whole function. When indenting it is important to use 4 spaces instead of
using the “TAB” key on the key board.
The following image serves as evidence to the fact that the above-mentioned coding standard
is used properly in the Ayubo Drive system.

119
Figure 86 Coding Standards 2
As shown in the above image with every if condition of the code the lines are indented,
making it clear and more visible. Even though indentation is not a must in C# it is used as a
good practice. Therefore, it is proved that the above coding standard is used.
Naming
When naming the elements in a code such as variable, fields, classes and objects it is
important to give proper names instead of gibberish names. Most of the beginner level
programmers are used to naming the variables as x or y or by another meaningless name.
This is completely wrong. The reason why this is such an important coding standard is
because it helps to better understand the code. And also, if an outside developer takes a look
at such a code, he or she will have no idea the about what the variables are used for. It also
makes it harder to identify errors in such a code.
The following image serves as evidence to the fact that proper names were used when writing
the code for the Ayubo Drive system.

120
Figure 87 Coding Standards 3
As shown in the above image each integer variable is named with a proper name. anyone who
looks at the code will understand the purpose of each variable easily. It is also easy to
remember the variable names when they are named properly. So, as proven by the above
image the naming coding standard is properly used.
Comments
Comments are a very important part of coding. They help to better understand a program
written by another programmer. When comments are included in a code, they show us what
the program is supposed to do and is doing. A properly commented code can guide another
programmer through the code without the help from the programmer who originally typed the
code. That is why comments are an important aspect when it comes to programming.
The following image serves as evidence to the fact that comments were used in the coding
process of the Ayubo Drive system.

121
Figure 88 Coding Standards 4
As shown in the above image there are green color lines included in the code. Those are the
comments. In the dark theme of the Visual Studio IDE comments are showed in green color.
There are 2 ways to comment when using C#. Those 2 ways are,
1) Using the // <comment>

This commenting method is used to comment on a single line


2) Using the /* <comment> */

This method can be used to comment on multiple lines


So, as proven by the above image comments are used as a coding standard in the Ayubo
Drive system.

4.4 Evaluate how you used the debugging process to develop more secure, robust
application with examples (M4).

In the task 4.2 the debugging mechanisms are explained and the use of breakpoints is also
given. But break point are not the only developing tool available in Visual Studio IDE.
Following are some other debugging tool in the Visual Studio IDE.
Data Tooltip
This debugging tool us used with the breakpoints. When the program is paused at the
breakpoint the developer can point the mouse to a variable in the source code. It will display
the current value of that variable.

122
The use of the data tooltip is given in the following image. It is used to debug the Ayubo
Drive system.

Figure 89 Data Tooltip


As shown in the above image the value of the variable total_no_of_days_as_double is display
near the mouse pointer when the cursor is hovering over the variable name. the current value
of that variable is 5.
So, the above image serves as evidence to the fact that data tooltips were used in the process
of debugging the Ayubo Drive system.
Diagnostic Tools
The diagnostic tools in the Visual Studio help to find errors and bugs using an event monitor.
It records all the events that are happening once the program is executed and displays them as
a timeline. If at any point of the execution an error occurs, this tool will display it as a red
color little diamond. When the developer double clicks this diamond shape it will show the
place of the code which causes the error.
The use of diagnostic tools in the Ayubo Drive system is given in the following image.

123
Figure 90 Diagnostic Tools
As shown in the above image red diamonds are displayed when the execution of the code
encounters an error. The diamond is shown on both the timeline and the event list. To go to
the place where the error exist the diamond must be double clicked.

Figure 91 Diagnostic Tools 1


As shown in the above image once the diamond is double clicked it will jump to the line of
the code where the error is. And also, a detailed description of the error is shown at the
bottom left of the window.

124
So, the above image serves as evidence to the fact that diagnostic tools were used as a
debugging method in the Ayubo Drive system.

According to the above example given regarding debugging methods, it is proven that help to
build more secure and robust applications. That’s because they are used to test the system
with various unexpected situations so that the system would withstand any error or bug that it
interacts with. Therefore, the use of debuggers helps to make the applications more secure
and error free.

4.5 Explain the coding standards you have used in your application development.
Critically evaluate why a coding standard is necessary in a team as well as for the
individual. (D4).

As previously established in the task 4.3 coding standards help to improve the maintainability
of the code. They help to make the code more beautiful and understandable. Which leads to
easier error detection.
Following is a list of coding standards used when developing the Ayubo Drive system.
 One statement per line
 Proper Indentation
 Proper Variable Naming
 Suitable Comments

Coding standards are important to a developer as an individual as well as for a team of


developers.
Following are the reasons that explains why they are important to an individual developer.
 Because then the developer can prevent problems in the code before they happen. If
no attention was paid to the coding standards definitely some problems are bound to
happen. And the developer will have to find them and fix them. And because he or
she is working as an individual developer this will waste their time. This could be
avoided by the use of coding standards.
 Because of minimal complexity. If the code is complicated then the chances of having
errors will be high. But if the coding standards are used, the code will not be
complicating as much. It will be more simplified. And thereby reducing the chance
for error.

125
 Because then the code can be easily maintained. If the application is maintained and
developed by an individual it’ll be hard to maintain if the code is not understandable
right away. If the code is written while following the coding standards then it will be
simple and easy to understand. Therefore, anyone can understand it and modify it
without any problem.

Following are the reasons that explain why the coding standards are important as a team
 When working in a developing team a developer should understand the piece of code
written by another member of the team. If it is not understandable the development
process will get more complicated. But if the coding standards are followed by every
member of the team, they will be able to understand each other codes because they
followed the same guidelines.
 When developing an application with a team it is a costly process. If any problems
occur in their code, they will have to spend more time on finding and fixing the
problem. And this will cost more for the team. But if coding standards are
implemented it reduces the chance of error. And therefore, it decreases the chance of
cost increase as well.
 In a code created with the adherence of the coding standards, the code is consistent.
So, it reduces the chances of failure. When doing a software project as a team it is
important to succeed. And because coding standards decrease the chance for failure it
increases the change to success.

As shown in the reason given in the above section coding standards are very important to
individuals as well as teams. Therefore, it is in a developer’s best interest to practice and use
them at all times.

126
References
Anon., 2019. Linear Search Algorithm | Studytonight. [Online]
Available at: https://www.studytonight.com/data-structures/linear-search-algorithm
[Accessed 16 June 2019].

Anon., 2019. What is an algorithm and why should you care? (video) | Khan Academy.
[Online]
Available at: https://www.khanacademy.org/computing/computer-science/algorithms/intro-
to-algorithms/v/what-are-algorithms
[Accessed 16 June 2019].

Anon., n.d. Binary Search - GeeksforGeeks. [Online]


Available at: https://www.geeksforgeeks.org/binary-search/
[Accessed 16 June 2019].

Anon., n.d. Computer Programming. [Online]


Available at: https://homepage.cs.uri.edu/faculty/wolfe/book/Readings/Reading13.htm
[Accessed 16 June 2019].

Anon., n.d. Event-driven programming features - Pearson Schools and FE Colleges. [Online]

Available at:
https://www.pearsonschoolsandfecolleges.co.uk/AssetsLibrary/SECTORS/FurtherEducation
Colleges/ReviseBTEC/samples/9781292150208-btec-comp-rg.pdf
[Accessed 17 June 2019].

Anon., n.d. Introduction of Programming Paradigms - GeeksforGeeks. [Online]


Available at: https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
[Accessed 16 June 2019].

Anon., n.d. Properties of Algorithms - Video & Lesson Transcript | Study.com. [Online]
Available at: https://study.com/academy/lesson/properties-of-algorithms.html
[Accessed 16 June 2019].

Anon., n.d. What is Event-driven Programming?. [Online]


Available at: https://www.computerhope.com/jargon/e/event-driven-prog.htm
[Accessed 16 June 2019].

127
David, M., 2015. Visual Studio IDE offers many advantages for developers. [Online]
Available at: https://searchsoftwarequality.techtarget.com/feature/Visual-Studio-IDE-offers-
many-advantages-for-developers
[Accessed 21 June 2019].

INTELLIGENT DATA MINING LIMITED, 2019. Visual Studio - Intelligent Data Mining.
[Online]
Available at: https://www.intel-datamining.co.uk/services/tools/visual-studio/
[Accessed 21 June 2019].

Kenneth Reitz, 2016. Code Style - The Hitchhiker's Guide to Python. [Online]
Available at: https://python-guide-fil.readthedocs.io/en/latest/writing/style.html
[Accessed 21 June 2019].

Margaret, R., n.d. What is integrated development environment (IDE)? - Definition from
WhatIs.com. [Online]
Available at: https://searchsoftwarequality.techtarget.com/definition/integrated-development-
environment
[Accessed 17 June 2019].

Perforce Software, Inc, 2019. Intro to Coding Standards — Coding Rules and Guidelines |
Perforce. [Online]
Available at: https://www.perforce.com/resources/qac/coding-standards
[Accessed 21 June 2019].

Techopedia Inc, 2019. What is Debugging? - Definition from Techopedia. [Online]


Available at: https://www.techopedia.com/definition/16373/debugging
[Accessed 21 June 2019].

Walker, A., n.d. What is an IDE: Integrated Development Environments for Beginners in
2019. [Online]
Available at: https://learn.g2.com/ide#ide-features
[Accessed 17 June 2019].

128
129
Grading Rubric

Grading Criteria Achieved Feedback

LO1 Define basic algorithms to carry out an operation


and outline the process of programming an application.

P1 Provide a definition of what an algorithm is and


outline the process in building an application.

M1 Determine the steps taken from writing code to


execution.
D1 Examine the implementation of an algorithm in a
suitable language. Evaluate the relationship between the
written algorithm and the code variant

LO2 Explain the characteristics of procedural, object


orientated and event-driven programming, conduct an
analysis of a suitable Integrated Development
Environment (IDE)

P2 Give explanations of what procedural, object


orientated, and event driven paradigms are; their
characteristics and the relationship between them.

M2 Analyze the common features that a developer has


access to in an IDE.

130
D2 Critically evaluate the source code of an application
which implements the programming paradigms, in terms
of the code structure and characteristics.

LO3 Implement basic algorithms in code using an IDE.

P3 Write a program that implements an algorithm using


an IDE.
M3 Use the IDE to manage the development process of
the program.

D3 Evaluate the use of an IDE for development of


applications contrasted with not using an IDE.

LO4 Determine the debugging process and explain the


importance of a coding standard

P4 Explain the debugging process and explain the


debugging facilities available in the IDE.

P5 Outline the coding standard you have used in your


code.

M4 Evaluate how the debugging process can be used to


help develop more secure, robust applications.

D4 Critically evaluate why a coding standard is


necessary in a team as well as for the individual.

131

You might also like