You are on page 1of 68

Higher Nationals

Internal verification of assessment decisions – BTEC (RQF)


INTERNAL VERIFICATION – ASSESSMENT DECISIONS
Programme title

Assessor Internal Verifier

Unit(s)

Assignment title

Student’s name
List which assessment criteria Pass Merit Distinction
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 comments on the Y/N
student work?
Has the work been assessed
accurately? Y/N

Is the feedback to the student:


Give details:
• Constructive?
• Linked to relevant assessment criteria?
Y/N
• Identifying opportunities for
Y/N
improved performance?
Y/N
• Agreeing actions?
Y/N
Does the assessment decision need
amending? Y/N

Assessor signature Date

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
Assignment Number 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 & Distinction P1 M1 D1
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 & Distinction P2 M2 D2
Descripts
LO3. Implement basic algorithms in code using an IDE.
Pass, Merit & Distinction P3 M3 D3
Descripts
LO4. Determine the debugging process and explain the importance of a coding standard.
Pass, Merit & Distinction P4 P5 M4 D4
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
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.
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.
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.

Student’s Signature: Date:


(Provide E-mail ID) (Provide Submission Date)
Higher National Diploma in Computing
Assignment Brief

Student Name /ID Number

Unit Number and Title Unit 01: Programming


Academic Year 2017/18
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).

LO3. Implement basic algorithms in code using an IDE.

LO4. Determine the debugging process and explain the importance of a coding
standard
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
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).

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 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.2 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.3 Evaluate how you used the debugging process to develop more secure, robust
application with examples (M4).

4.4 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).
Table of Contents

Table of Contents
Acknowledgement...................................................................................................................11
Table of Contents.....................................................................................................................12
Table of Figures........................................................................................................................15
Task 1: Define basic algorithms to carry out an operation and outline the process of
programming an application (LO1)..........................................................................................17
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)..............17
1.1 What is an algorithm..................................................................................................17
1.1.1 Character of an algorithm.......................................................................................17
1.1.2 Linear search...........................................................................................................18
1.1.3 binary search...........................................................................................................18
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)...........................................................21
1.2.1 Steps of involving the writing and executing a program process...........................21
1.2.3 Linear search Dry run:.............................................................................................24
1.2.4 Binary search Dry run..............................................................................................25
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)..........................................................26
1.3.1 what is Big-O notation.............................................................................................26
Task 2: Explain the characteristics of procedural, object-orientated and event-driven
programming, conduct an analysis of a suitable Integrated Development Environment (LO2).
..................................................................................................................................................31
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)..............................................................................................................................31
2.1.1 What is programming paradigm.............................................................................31
2.1.2 paradigm.................................................................................................................31
2.2 Analyze the features of an Integrated Development Environment (IDE) and explain
how those features help in application development (M2)................................................33
2.2.1 What is IDE..............................................................................................................33
2.2.2 Purpose of IDE.........................................................................................................34
2.2.3 Advantage using IDE................................................................................................34
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)..............................................................................................................35
2.3.1 What is structure.....................................................................................................35
2.3.2 Rent Calculation......................................................................................................35
2.3.3 Day Tour..................................................................................................................36
2.3.4 Long Tour.................................................................................................................37
Task 03: Implement basic algorithms in code using an IDE (LO3)...........................................38
3.1Design suable algorithms for vehicle tariff calculation for rents and hires (P3).............38
3.1.1 Function 1: Rent calculation....................................................................................38
3.1.2 Function 2: Day tour calculation.............................................................................38
3.1.3 Function 3: Long tour calculation............................................................................39
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)......................................40
3.2.1 Function 01: Rent Calculation.................................................................................40
3.2.1.1 Days calculation....................................................................................................41
3.2.1.2 Data insert............................................................................................................42
3.2.1.3 Search data...........................................................................................................42
3.2.1.4 Update..................................................................................................................43
3.2.2 Function 02: Day Tour.............................................................................................43
3.2.2.1 Data insert............................................................................................................48
3.2.2.2 Data search...........................................................................................................48
3.2.2.3 Update..................................................................................................................49
3.2.3 Function 03: Long Tour............................................................................................49
3.2.3.1 300Km package....................................................................................................50
3.2.3.2 500Km package....................................................................................................51
3.2.3.3 800km package.....................................................................................................52
3.2.3.4 1000Km package..................................................................................................53
3.2.3.5 Insert Data............................................................................................................54
3.2.3.6 Search data...........................................................................................................54
3.2.3.7 Update..................................................................................................................54
3.3What 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).......................................................................................................................................55
3.3.1 Purpose of using an IDE application development.................................................55
3.3.2 Not using IDE...........................................................................................................56
Task 4: Determine the debugging process and explain the importance of a coding standard
(LO4).........................................................................................................................................57
4.1 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)....................................................................................................................57
4.1.1What is debugging an application............................................................................57
4.1.2 Debugging facility in visual studio...........................................................................57
4.1.3 Set a breakpoint......................................................................................................58
Breakpoint conditions......................................................................................................60
4.2 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)....................................................................................61
4.2.1 Why use coding standards......................................................................................61
4.2.2 Comment standards................................................................................................61
4.2.3 Naming standards...................................................................................................62
4.2.4 Variable...................................................................................................................62
4.3 Evaluate how you used the debugging process to develop more secure, robust
application with examples (M4)..........................................................................................63
4.4 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.........64
4.4.1Coding standards in my application.........................................................................64
4.4.2 coding standards necessary....................................................................................64
Reference.............................................................................................................................65
Table of Figures

Figure 1 binary Search..............................................................................................................19


Figure 2 Dry run found.............................................................................................................25
Figure 3 Dry Run Not Found...................................................................................................25
Figure 4 Big-O complexity chart.............................................................................................26
Figure 5 IDE Circle..................................................................................................................33
Figure 6 Rent............................................................................................................................35
Figure 7 Day Tour....................................................................................................................36
Figure 8: Long Tour.................................................................................................................37
Figure 9 Rent Calculation........................................................................................................40
Figure 10 Rent Days calculate (1)............................................................................................41
Figure 11 Rent Days Calculate (2)...........................................................................................41
Figure 12 Save..........................................................................................................................42
Figure 13 Search.......................................................................................................................42
Figure 14 Update......................................................................................................................43
Figure 15 Day Tour..................................................................................................................43
Figure 16 Airport Drop (1).......................................................................................................44
Figure 17 Airport Drop (2).......................................................................................................44
Figure 18 Airport Pickup..........................................................................................................45
Figure 19 Airport Pickup..........................................................................................................45
Figure 20 100Km Package (1).................................................................................................46
Figure 21 100Km package (2)..................................................................................................46
Figure 22 200km package (1)...................................................................................................47
Figure 23 200Km package.......................................................................................................47
Figure 24 Data Insert................................................................................................................48
Figure 25 Search (1).................................................................................................................48
Figure 26 Search (2).................................................................................................................48
Figure 27 Update......................................................................................................................49
Figure 28 Long Tour................................................................................................................49
Figure 29 300Km package (2)..................................................................................................50
Figure 30 300km package........................................................................................................50
Figure 31 300Km package (1)...................................................................................................50
Figure 32 500Km package (1)..................................................................................................51
Figure 33 500Km package (2)..................................................................................................51
Figure 34 800Km package (1)..................................................................................................52
Figure 35 800Km package (2)..................................................................................................52
Figure 36 1000Km package (1)................................................................................................53
Figure 37 1000Km package (2)................................................................................................53
Figure 38 :Save.........................................................................................................................54
Figure 39: Search.....................................................................................................................54
Figure 40:Update......................................................................................................................54
Figure 41 purpose of IDE.........................................................................................................55
Figure 42 Debugger shortcut....................................................................................................57
Figure 43 Debugging shortcut..................................................................................................57
Figure 44 Debugging Tool Figure 45 Debugger After Tools.............................................58
Figure 46 Set breakpoint..........................................................................................................59
Figure 47 Navigate code in the debugger.................................................................................59
Figure 48 Trace Point setting...................................................................................................60
Figure 49 Trace point select Conditions..................................................................................60
Figure 50 Comment standards..................................................................................................61
Figure 51 Naming standards....................................................................................................62
Figure 52 variable.....................................................................................................................62
Figure 53 Debug.......................................................................................................................63
Figure 54 After Debug.............................................................................................................63
Figure 55 Debugging................................................................................................................63
Task 1: Define basic algorithms to carry out an operation and
outline the process of programming an application (LO1)

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.1 What is an algorithm.

Algorithm is a step-by-step procedure for accomplishing some end. It is considered a


fundamental procedure in computer. As an effective method, which defines a set of
instruction to be executed in a certain order to get the desired output. However, this program
is executed by computer to produce solution and finding difficult data is easy to find and
which defines a set of instructions to be executed in a certain order to get the desired output.
In computer science and software engineering, when searching for data, the difference
between a fast application and a slower one often lies in the use of the proper search
algorithm.

1.1.1 Character of an algorithm

 Unambiguous – Algorithm should be clear and unambiguous. Each of its steps


(or phases), and their inputs/outputs should be clear and must lead to only one
meaning.
 Input – An algorithm should have 0 or more number of input values from
external.
 Output – Every algorithm must produce an output as result.
 Finiteness – Every algorithm must terminal after a finite number of steps.
 Feasibility – Should be feasible with the available resources.
 Independent – an algorithm should have step-by-step direction, which should
be independent of any programming code.
[Keep Spacing intentionally]

Search algorithm is set of introductions for solving a problem. Search data collection in a
given order, can be done it two ways.

01.linear search
02.binary search

1.1.2 Linear search.

Linear search is very simple search algorithm. It relies on the technique of traversing
a list from start to end by exploring the properties of all the elements that are found on
the way. Basically, a sequential search is made over all items one by one. Every item
is checked and if a match founds then that particular item is returned. Otherwise the
search continues until the end of the data collection.

Linear search example

Search item 5

1 2 3 4 5 6 7 8 9 10

1.1.3 binary search

binary search algorithm is a search algorithm that finds the position of a target value
within a sorted array. Binary search compares the target value to the middle element
of the array. If the middle item is greater than the item, then of the subarray to the left
compared. Otherwise, the middle item of the subarray to the right is compared. We
repeat this procedure on the lower or upper half of the array until the value is found. This
search algorithm can be quite fast but the caveat is that the data has to be in a sorted form.

Below is an example:
Search item 4

Figure 1 binary Search

Linear search pseudocode:


Input Array age
Input Integer n
Position=0
Found=False
While Position < Length (age)
If age [Position] = n
Found = True
Print "Index Is”, Index
Position = Position + 1
If Found = False
Print "Not Found"

[Keep Spacing intentionally]


Binary search pseudocode:
Input: Array age, integer item
Function Binary Search (age, item)
First = 0
Last = Length (age) - 1
Found = False
While First <= Last
Midpoint = (First + Last) DIV 2
If age [Midpoint] = Item Then
Found = True
Print Index
Else
If age [Midpoint] > Item Then
Last = Midpoint - 1
Else
First = Midpoint + 1
If Found = False
Print "Not Found"
End If
End If
End While
End Function

[Keep Spacing intentionally]


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.2.1 Steps of involving the writing and executing a program process

All programming involves creating something that solves a problem. Developing a program
involves steps similar to any problem-solving task. There are five main ingredients in the
programming process.

i. Defining the problem.


ii. Planning the solution.
iii. Coding the program.
iv. Testing the program.
v. Documenting the program.

1.2.1.1 Defining the problem

Suppose that, as a programmer, you are contacted because your services are needed. You
meet with users from the client organization to analyze the problem, or you meet with a
systems analyst who outlines the project. Specifically, the task of defining the problem
consists of identifying what it is you know (input-given data), and what it is you want to
obtain (output-the result). Eventually, you produce a written agreement that, among other
things, specifies the kind of input, processing, and output required.

[Keep Spacing intentionally]


1.2.1.2 Planning the solution

Two common ways of planning the solution to a problem are to draw a flowchart and to
write pseudocode, or possibly both. Essentially, a flowchart is a pictorial representation of a
step-by-step solution to a problem. It consists of arrows representing the direction the
program takes and boxes and other symbols representing actions. It is a map of what your
program is going to do and how it is going to do it. The American National Standards
Institute (ANSI) has developed a standard set of flowchart symbols. Figure 1 shows the
symbols and how they might be used in a simple flowchart of a common everyday act-
preparing a letter for mailing. (homepage .cs 2018)

Pseudocode:

Pseudocode is an informal program description that does not contain syntax or underlying
technology consideration. It is used for creating an outline or rough draft of a program and
pseudocode is not actual programming language. The purpose of using pseudocode is an
efficient key principle of an algorithm. software designers write pseudocode to ensure that
programmers understand a software project’s requirements and align the code accordingly.
It uses short terms or simple English language. this is done to identify to level flow errors
and understand the programming data flows that the final program is going to use. This
definitely help save time during actual programming as conceptual errors. Basically, it is
used in planning an algorithm with sketching out the structure of the program before the
actual cording takes place.

1.2.1.3 Cording the program


Next step is to code the program. After the program has been designed it must be coded or
written. Using the pseudocode and logic requirements from step two an appropriate
programming language must be selected. Once the appropriate code language has been
chosen, it is imperative that the programmer follow the syntax rules with as little deviation
as possible in order for the program to have high accuracy.
1.2.1.4 Testing the programming
Dry run

Dry run is programmer-built program work detail showing table. A desk check is performed
with the help of a table with columns for pseudocode line number column, condition
column, input/output column and a column for variables. All information is captured in
table columns. The input/output column helps in showing the inputs and outputs, and helps
in evaluating the input received by the user and the output displayed by the logic. Basically,
a dry run test consists of programmers manually reading their code line by line to find errors
and fix them. The evaluation is usually done with the help of pen/pencil and paper, and is
similar to proofreading. Dry is fast and inexpensive technique.

Debugging
When you first run your program, it will not work properly. Debugging is the process of
finding and correcting your errors. In testing a program, you should give it extreme inputs in
an attempt to force errors.

1.2.1.5 Documenting the program

The job is not finished when the program is working correctly. The programmer must
prepare documents describing both the external specification and the internal design of the
program. This documentation will be of value to users and programmers who must maintain
and modify your program.

[Keep Spacing intentionally]


1.2.3 Linear search Dry run:

Array:2,4,6,8,10,12,14,16,18,20

Table 1:Linear Search Dry run

Search Positio
Line Number Array Found Condition Output
Item n
2,4,6,8,10,12,14,16,18,
1          
20
2   12        
3     0      
4       FALSE    
5         0 < 10? T  
6         2== 12? F  
9     0+1      
5         1 < 10? T  
4 == 12?
6          
F
9     1+1      
5         2 < 10? T  
6 == 12?
6          
F
9     2+1      
5         3 < 10? T  
8 == 12?
6          
F
9 3+1
5 4<10? T
10==12?
6
F
9 4+1 5<10? T
12==12?
5
T
7       TRUE    
Index is
8          
5
1.2.4 Binary search Dry run

Found order:
Array:1,2,3,4,5,6,7,8,9,10

Figure 2 Dry run found

Not Found Order:


Array:1,2,3,4,5,6,7,8,9,10

Figure 3 Dry Run Not Found


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).

1.3.1 what is Big-O notation

Big-O notation is particular tool for evaluation algorithm efficiency. Big-O notation
specifically describes the worst-case scenario, and using large O notation helps to calculate
need as a program scale.

1.3.1.1 Big-O complexities.

 O (1) Constant
 O(N) Linear
 O (Log N) Logarithmic
 O(N2) Exponential

Figure 4 Big-O complexity chart


1.3.2.1 O (1) Constant
This means that the input array could be 1 item or 1,000 items, but this function would still
just require one “step.”
return elements [0] == null;
1.3.2.2 O(N)Linear
Where N is the number of items in the array. This means that if the array has 10 items, I have
to print 10 times. If it has 1,000 items, I have to print 1,000 times.
bool ContainsValue (IList<string> elements, string value)
{
foreach (var element in elements)
{
if (element == value) return true;
}

return false;
}
1.3.2.3O (Log N) Logarithmic
Each step of a binary search, you rule out an entire half of the space you're searching,
without having to examine what's in it. Since you can only split a space of n elements in
half log2(n) times before you're only looking at one item, you must have zeroed in on the
desired element after log2(n) steps at the worst. Therefore, binary search works in O(log(n))
time.

[Keep Spacing intentionally]


1.3.2.4 O(n2) Exponential
O(N2) is a simple sorting algorithm. this sorting algorithm is comparison-based algorithm in
which each pair of adjacent elements is compared and elements are swapped if they are not
in order. If the array has 10 items, we have to print 100 times. If it has 1,000 items, we have
to print 1,000,000 times.
bool ContainsDuplicates (IList<string> elements)
{
for (var outer = 0; outer < elements. Count; outer++)
{
for (var inner = 0; inner < elements. Count; inner++)
{
// Don't compare with self
if (outer == inner) continue;
if (elements[outer] == elements[inner]) return true;
}
}
return false;
}

(rob-bell.net 2018)

[Keep Spacing intentionally]


# Create a function that
def logarithmic(n):
# Creates a list of the operations performed
operations = []

# While n is longer than 1, repeat this:


while len(n) > 1:
# Find half the lengh of n
half_length = int(len(n)/2)

# Add half the values of n to operations


operations = operations + [n[0:half_length]]

# make n half the length of itself, then restart the loop


n = n[0:half_length]

# Return the number of operations


return 'Number of operations: ' + str(len(operations))

(chrisalbon.com2018)

[Keep Spacing intentionally]


def Array (sortedList, target):
left = 0
right = len(sortedList) - 1
while (left <= right):
mid = (left + right)/2
if (sortedList(mid) == target):
return mid
elif (sortedList(mid) < target):
left = mid + 1
else:
right = mid - 1
# If target is not in the list, return -1
return -1
Array ([1,3,9,22,22)

[Keep Spacing intentionally]


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.1.1 What is programming paradigm

A programming paradigm is a fundamental style of building the structure and elements of a


program. The styles and capabilities of programming languages are defined by their
paradigms. For example, a programming language may only be designed to follow one
paradigm (i.e. Haskell), while others can support multiple paradigms (i.e. Python). Languages
can be classified into multiple paradigms. Some paradigms are concerned mainly with
implications for the execution model of the language, such as allowing side effects, or
whether the sequence of operations is defined by the execution model. Other paradigms are
concerned mainly with the way that code is organized, such as grouping a code into units
along with the state that is modified by the code. Basically, A Paradigm can be thought of as
a philosophical or theoretical framework. This framework is then used as the basis of a new
way of viewing problems.

2.1.2 paradigm

i. Imperative
ii. Object oriented
iii. Declaration
iv. Logic and constraint
v. Functional
vi. Event-driven
2.1.2.1 Imperative
Procedural programming is a programming paradigm that uses a linear or top-down
approach. It relies on procedures or subroutines to perform computations. Procedural
programming is also known as imperative programming. Languages that reflect this
paradigm recognize the fact that computers have re-usable memory that can change state.
So, they are characterized by statements, which effect the state of the machine, for example.
X = X+1
It means statement changes the state of “variable x” by incrementing it by 1. Procedural
language is one of the most common types of programming language in use, with notable
languages such as C++, Java, ColdFusion and PASCAL.
2.1.2.2 Object oriented
One of the great benefits of OPP is that of the scalability, with objects and definitions
having no finite limitation. Also, the separation of data from the method prevents common
problem found in order linear software languages. If a bug appears in a linear code, it can be
translated through a system and create masses of hard-to-trace errors. Conversely, an OPP
program, with its separation of method and data, is not susceptible to such proliferated
errors. Java, Python, C++, Visual studio .NET and Ruby are the most popular OPP
languages today.
2.1.2.3 Declaration
A declaration in computer programming con be confused with other sorts of designations
for variables. One such term is the definition of a variable, which refers to assigning a
storage location for that variable. Another similar term is the dimensioning the length or
size of the variables. Programmers commonly dimension variables and arrays to help the
program handle the elements of a specific size. The best example is SQL server.
2.1.2.5 Functional

Functional programming language are specially designed to handle symbolic computation and
list processing applications. Functional programming is based on mathematical functions. Some
of the popular function programming language include lisp, python, Haskell, clonjure, etc.
2.1.2.6 Event driven

An event-driven program is one that largely responds to user events or other similar input.
The concept of event-driven programming is an important one in application development
and other kinds of programming, and has spawned the emergence of event handlers and
other resources. An event-driven program is also known as an event-driven application.
2.2 Analyze the features of an Integrated Development Environment
(IDE) and explain how those features help in application development
(M2).

2.2.1 What is IDE


An integrated development environment (IDE) is a software suite that consolidates basic
tools required to write and test software. IDEs are designed to encompass all programming
tasks in one application. In general, an IDE is a graphical user Interface (GUI)-based
workbench designed to assist a developer in building software applications with an
integrated environment combined with all the required tools at hand. Most common
features, such as debugging, version control and data structure browsing, help a developer
quickly execute action without switching to other applications. Thus, it helps maximize
productivity by providing similar user interface (UI) for related components and reducing
the time taken to learn the language. An IDE supports single or multiple languages.

Figure 5 IDE Circle


[Keep Spacing intentionally]

2.2.2 Purpose of IDE


The purpose of an Ide is just that an Integrated Development Environment. Its purpose is to
make taskes quicker and centralized, basically. IDEs try to make everything simple by
allowing you to view, edit, debug, and complile code in one interface.

one downside to IDEs I have found (or at least popular ones such as Visual Studio .NET and
Eclipse, which are both excellent by the way) is the extra garbage it creates. by garbage I
mean all the extra files and folders. for example, a simple hello world c++ program written
in Visual Studio .NET would be a few megabytes, with the .cpp file being 1kb.
(www.linuxquestions.org 2018)

2.2.3 Advantage using IDE

Less time and effort


The entire purpose of an IDE is to make developing faster and its tools are supposed to help
you organize resources, prevent mistakes, and provide shortcuts.

Enforce project or company standards


Standards can be further enforced if the IDE offers templates, or if code libraries are shared
between different team members/teams working on the same project.

Project management
This can be twofold. Documentation tools that either automate the entry of developer
comments, or may actually force developers to write comment in different areas and simply
by having a visual presentation of resources, it should be much easier to know how an
application is laid.
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).

2.3.1 What is structure


Structured programming is a logical programming method that is regarded as a precursor to
object-oriented programming (OOP). Structured programming facilitates understanding and
modification of programs and has a top-down design approach in which the system is
divided into configuration subsystems.

2.3.2 Rent Calculation

Figure 6 Rent

[Keep Spacing intentionally]


2.3.3 Day Tour

Figure 7 Day Tour

[Keep Spacing intentionally]


2.3.4 Long Tour

Figure 8: Long Tour

[Keep Spacing intentionally]


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

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

3.1.1 Function 1: Rent calculation


01. Start
02. Input: rent, driver_payment, v_rent, D_pay, week_Rent, monthly_rent, driver_charge
03. If with_driver=Yes
driver_payment = days* driver_charge
04. else with_driver=No
driver_payment = days*0
05. Total_rent = 1_week_car_rent + 1_day_rent x 3 + 1_day_driver_rent x 10
06. Return_Total rent
07. End If
08. End If
09. End

3.1.2 Function 2: Day tour calculation


01. Start

02. Input: Vehicle, Package, Start_time, End_time, Start_Km, End_Km,


One_Hour_Charge, One_Km_Charge

03. Time_Calculate= End_time – Start_time


04. If (Max_Hour > Time_Calculation)
Waiting Charge=(End_time-Start_Time) *One_Hour_Charge

05. Km_calculation = End Km - Start Km


06. If (Max_Km > Km Calculation)
07. Extra_Km_Charge=(End_Km-Start_Km) * One_Km_Charge

08. Total_Hire_Charge = Waiting Charge + Extra Km charge + Base hire charge


09. Return Total_Hire _Charge
10. End If
11. End If
12. End
3.1.3 Function 3: Long tour calculation
01. Start

02. Input: Vehicle, Package, start_Day, End_Day, Start_Km, End_Km

03. Day_Calculate= End_Day – Start_Day


04. If (Max_Day > Day_Calculation)
05. OveNight_Charge=(End_Day-Start_Day) *One_Day_Charge

06. Km_calculation = End Km - Start Km


07. If (Max_Km > Km Calculation)
08. Extra_Km_Charge=(End_Km-Start_Km) * One_Km_Charge

09. Total_Hire_Charge = OverNight_Charge + Extra Km charge + Base hire charge


10. Return Total_Hire _Charge
11. End If
12. End If
13. End

[Keep Spacing intentionally]


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.2.1 Function 01: Rent Calculation

Figure 9 Rent Calculation


3.2.1.1 Days calculation

Figure 10 Rent Days calculate (1)

Figure 11 Rent Days Calculate (2)


3.2.1.2 Data insert

Figure 12 Save

3.2.1.3 Search data

Figure 13 Search
3.2.1.4 Update

Figure 14 Update

3.2.2 Function 02: Day Tour

Figure 15 Day Tour


Figure 16 Airport Drop (1)

Figure 17 Airport Drop (2)


Figure 18 Airport Pickup

Figure 19 Airport Pickup


Figure 20 100Km Package (1)

Figure 21 100Km package (2)


Figure 22 200km package (1)

Figure 23 200Km package


3.2.2.1 Data insert

Figure 24 Data Insert

3.2.2.2 Data search

Figure 25 Search (1)

Figure 26 Search (2)


3.2.2.3 Update

Figure 27 Update

3.2.3 Function 03: Long Tour

Figure 28 Long Tour


3.2.3.1 300Km package

Figure 29 300km package


Figure 30 300Km package (1)

Figure 31 300Km package (2)


3.2.3.2 500Km package

Figure 32 500Km package (1)

Figure 33 500Km package (2)


3.2.3.3 800km package

Figure 34 800Km package (1)

Figure 35 800Km package (2)


3.2.3.4 1000Km package

Figure 36 1000Km package (1)

Figure 37 1000Km package (2)


3.2.3.5 Insert Data

Figure 38 :Save

3.2.3.6 Search data

Figure 39: Search

3.2.3.7 Update

Figure 40:Update
3.3What 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).

3.3.1 Purpose of using an IDE application development


The processing development environment consists of a simple editor for writing code, a
message area, a text console, tabs for managing files, a toolbox, toolbar with buttons
common action, and a series of menus. The menu option changes from mode to code.

Example visual studio IDE:

1
2

Figure 41 purpose of IDE

1.Tool bar 2.Cord editor and write 3.Debug output and Error list

 New file  Undo  Syntax error


 Open  Redo  Debug error
 Open recent  Cut
 Close  Copy
 Save  Past
 Save as  Select all
 Comment
 Find
3.3.2 Not using IDE

Because of not using IDE, will unable the ability to checkout syntax errors and spelling
errors. Also, I will not let a chance to use and checkout any of the debug options. Moreover,
using short options as new page will be unable. Because of this avoiding IDE will increase
the period of time to create a software

Learning curve
Ides are complicated tools. Maximizing their benefit will require time and patience.

IDE may not be good tool for beginning programmers


Further, features and shortcuts for experienced programmers often hide crucial but mundane
details of a language. Details should not overlook when learning a new language. Using an
integrated development environment may hamper the learning a new language.

[Keep Spacing intentionally]


Task 4: Determine the debugging process and explain the
importance of a coding standard (LO4).

4.1 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.1.1What is debugging an application

Debugging is the routine process of locating and removing computer program bugs, errors
or abnormalities, which is methodically handled by software programmers via debugging
tools. Debugging checks, detects and corrects errors or bugs to allow proper program
operation according to set specifications. Debugging is also known as debug. Large
software programs, which contain millions of source code lines, are divided into small
components. For efficiency, each component is debugged separately at first, followed by the
program as a whole.

4.1.2 Debugging facility in visual studio


The visual studio debugging is a complicated environment, but it is more efficiently and
productively item. Under the debug menu, there are two shortcut menu items for executing
your code its start (F5) and Start without debugging (Ctrl+F5). But you can set breakpoints
and debug your code more easily.

Figure 42 Debugger shortcut

Figure 43 Debugging shortcut


Figure 44 Debugging Tool Figure 45 Debugger After Tools

4.1.3 Set a breakpoint

Set a breakpoint, place your cursor on a line of code and light click. Press F5 or debug>start
debugging, start debugging button in the toolbar, and the debugger run to the first
breakpoint that it encounters. Delete breakpoint from the pop-up menu or you can press the
F9. When the program is started by the continue, it will stop at every line that has a
breakpoint, allowing you to debug easily.

[Keep Spacing intentionally]


Figure 46 Set breakpoint

Figure 47 Navigate code in the debugger

[Keep Spacing intentionally]

Breakpoint conditions
Right click breakpoint > Settings > Select condition. The behavior of the When changed
field is different for different programming languages. If you choose When changed for
native code, the debugger doesn't consider the first evaluation of the condition to be a
change, so the breakpoint won't be hit on the first evaluation. If you choose When changed
for managed code, the breakpoint is hit on the first evaluation after When changed is
selected. If you set a breakpoint condition with invalid syntax, a warning message appears.
If you specify a breakpoint condition with valid syntax but invalid semantics, a warning
message appears the first time the breakpoint is hit. In either case, the debugger breaks
execution when the invalid breakpoint is hit. The breakpoint is skipped only if the condition
is valid and evaluates to false.

Figure 48 Trace Point setting

Figure 49 Trace point select Conditions

[Keep Spacing intentionally]


4.2 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.2.1 Why use coding standards


Coding standards are very important piece of high-quality software. Just as style is often
overlooked but very critical attribute of writing, coding standards are also an often
overlooked but very critical attribute of software development. Following a consistent
cording stand helps improve the quality of the overall software system and you need to
make guidelines don’t contradict one another.by creating source code that is easier for a
developer to understand, it becomes easier to find and correct bugs.

4.2.2 Comment standards


At the beginning of block comment or multiline comment, the symbol / * is attached. The
symbol * / indicates the end. This type of comment is called so that it can span multiple
lines. When the compiler reads / *, it ignores everything following it. * /. Comments are
lines in the program and are used to inform you and others about how the program works.
They are ignored by the compiler and are not exported to the processor, so they do not
occupy the space in the microcontroller's flash memory. The purpose of 'comment' is to

understand (or remember) how your program works or to inform others.

Figure 50 Comment standards


4.2.3 Naming standards
Objects need to be named by objects that make it easy to identify the category of objects.
Some objects supported by Visual Basic have the recommended procedures.

Figure 51 Naming standards

(https://code.tutsplus.com 18 September)

4.2.4 Variable
Creating functions with matching codes of it will be easy to understand for the user.

Figure 52 variable

[Keep Spacing intentionally]


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

You can connect the Visual Studio debugger to a running process on a local or remote
computer. When the process is running, click on Debug> Attach to Process (or press CTRL
+ ALT + P) to open the Attach to Process dialog box. Can use this function to debug
applications running on the local computer or remote computer, debug multiple processes at
the same time, or debug applications that are not created in Visual Studio. This is useful
when you want to debug an application, but for some reason it did not start up by attaching
the debugger from Visual Studio. For example, if you run an application without using the
debugger and an exception occurs, you can attach to the process running the application and
start debugging.

Figure 53 Debug

Figure 54 After Debug

(docs.microsoft.com 2018)

Figure 55 Debugging
4.4 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.

4.4.1Coding standards in my application


For any software it is important to have coding standards. I have used functions, comments
and naming. Because of that, I believe whoever the person is using my software will be
able to figure out the errors and other problems easily.

4.4.2 coding standards necessary


Coding standards can be understood as a series of procedure for a specific programming
language that determines the programming style, procedures, methods, for various aspects
of the program written in that language. They are a very critical attribute of software
development.

A coding standard ensures that all developers writing the code in a particular language write
according to the guidelines specified. This makes the code easy to understand and provides
consistency in the code.

One of the most essential factors in a software system is the consistency of the coding
standard. This is because it positively impacts the quality of the system. While using a
software system, you need to ensure that the guidelines do not contradict each other. The
source code that uses the standard should also be in harmony with the standard. The
completed source code should indicate as if the code has been written by a single developer
in a single session. Because coding stands is coding standards can be changed according to
the person there.
(www.webguruz.in 2018)
Reference

https://www.linuxquestions.org/questions/programming-9/purpose-of-ide-536023/ [17
September 2018]

https://www.techopedia.com/definition/21481/procedural-programming [12 September


2018]

https://code.tutsplus.com/tutorials/top-15-best-practices-for-writing-super-readable-code--
net-8118 [17 September 2018]

https://www.webguruz.in/the-significance-of-coding-standards/ [19 September 2018]

https://docs.microsoft.com/en-us/visualstudio/debugger/attach-to-running-processes-with-
the-visual-studio-debugger?view=vs-2017 [20 September 2018]

https://chrisalbon.com/software_engineering/algorithms/big-o_notation/
[20 September 2018]

(https://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/) [20 September 2018]

You might also like