Unit 01 - Programming Assignment
Unit 01 - Programming Assignment
Assignment title Design & Implement a GUI based system using a suitable Integrated
Development Environment
Student’s name K. A. Damith Sriyantha Karunathilake
List which assessment criteria Pass Merit Distinction
the Assessor has awarded.
Give details:
Internal Verifier
Date
signature
Programme Leader
Date
signature (if required)
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 suit
Integrated Development Environment (IDE).
LO4. Determine the debugging process and explain the importance of a coding standard.
Pass, Merit & Distinction Descripts P4 P5 M4 D4
* 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.
Action Plan
Summative feedback
Assessor Date
signature
Student Date
signature
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.
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.
Unit Tutor
Assignment Title Design & Implement a GUI based system using a suitable
Integrated Development Environment
Issue Date
Submission Date
Submission Format
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)
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.
LO1. Define basic algorithms to carry out an operation and outline the process of
programming an application.
LO4. Determine the debugging process and explain the importance of a coding
standard
Activity 1
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.
1.2 Describe the steps involved 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.
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.
Activity 2
2.1 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.
2.2 Write small snippets of code as example for the above three programming paradigms using
a suitable programming language(s).
2.3 Critically evaluate the code samples that you have above in relation to their structure and
the unique characteristics.
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.
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:
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
package type of a vehicle type if 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.
Activity 3
3.1 Design suable algorithms for vehicle tariff calculation for rents and hires.
Ideally 3 functions should be developed for this purpose as follows:
3.3 Analyze the features of an Integrated Development Environment (IDE) and explain how
those features help in application development. Evaluate the use of the Visual Studio IDE
for your application development contrasted with not using an IDE.
Activity 4
4.1 Design and build a small system to calculate vehicle hire amounts and record them in a
database for customer billing and management reporting for Ayubo drive. This includes the
completing the database design started in 3.2 and implementing one or more GUIs for
vehicle, vehicle type, and package add/edit/delete functions. It essentially requires an
interface for hire calculation and recording function described above. Generating customer
reports and customer invoices are not required for this course work.
4.2 What is debugging an application? Explain the features available in Visual studio IDE for
debugging your code more easily. Evaluate how you used the debugging process to develop
more secure, robust application with examples.
4.3 Explain the coding standards you have used in your application development. Critically
evaluate why a coding standard is necessary for the team as well as for the individual.
I would like to thanks for our HND coordinator Mr. Theekshana Gunathilake. And also I
would like to thank my parents and all of my friends who gave hand to make this subject
assignment in a successful way.
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. ...................... 23
1.2. Describe the steps involved 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. ...................................................................... 26
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. ................................................................. 30
Activity 02................................................................................................................................ 33
2.1. 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. 33
2.2. Write small snippets of code as example for the above three programming
paradigms using a suitable programming language(s)......................................................... 36
2.3. Critically evaluate the code samples that you have above in relation to their structure
and the unique characteristics. ............................................................................................. 41
Activity 03................................................................................................................................ 45
3.1. Design suable algorithms for vehicle tariff calculation for rents and hires. Ideally 3
functions should be developed for this purpose as follows: ................................................ 45
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. ................................ 48
3.3. Analyze the features of an Integrated Development Environment (IDE) and explain
how those features help in application development. Evaluate the use of the Visual Studio
IDE for your application development contrasted with not using an IDE. .......................... 54
Activity 04................................................................................................................................ 58
4.1.5. History................................................................................................................ 68
4.2. What is debugging an application? Explain the features available in Visual studio
IDE for debugging your code more easily. Evaluate how you used the debugging process
to develop more secure, robust application with examples. ................................................ 72
4.3. Explain the coding standards you have used in your application development.
Critically evaluate why a coding standard is necessary for the team as well as for the
individual. ............................................................................................................................ 77
4.3.3. Why a coding standard is necessary in a team as well as for the individual? .... 79
Bibliography............................................................................................................................. 81
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.
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 well-defined inputs.
Output − An algorithm should have 1 or more well-defined outputs, and should
match the desired output.
Finiteness − Algorithms must terminate after a finite number of steps.
Feasibility − Should be feasible with the available resources.
Independent − An algorithm should have step-by-step directions, which should be
independent of any programming code.
(tutorialspoint, 2020)
Begin
else
endif
endwhile
End
(dyclassroom)
It usually consists of a code generation method and an execution method. Code generation is
usually done in a special computer language. This is usually a collection of short words and
special characters written in a special structure called syntax.
Code execution means that the computer usually reads the code and understands what it takes
to start processing it. The code will be based on the method used by the computer to convert
it into machine instructions.
Pseudo code is a non-standard language such as English. That solution allows you to
pronounce more accurately in plain English, but with less accuracy than is required when
using a formal programming language. Pseudo code allows you to focus on program logic
without having to worry about the specific phrase in any programming language.
Programming languages are grammatically functional. They are as accurate as the English
language. In order for the program to run, the phrase in the language used must be applied
correctly. Of course, using the language correctly does not guarantee that the program will
work. The main point here is that the first step is to use the language correctly. The coded
program must then be typed. Often in a way that the computer can understand using a
terminal or personal computer.
Finally, the program will encode the test after encryption. These step-by-step steps include:
The trusted programmer documents those facts throughout the program design, development,
and testing. It is essential to document human memory and program design, and
documentation will be very important for dealing with others who are interested in the
program.
Time efficiency
Space efficiency
Time efficiency is calculated using the CPU. Space efficiency is calculated using an
algorithm memory and disk.
The developer will know the difference between performance and complexity. Complex
analysis does not depend on any computer resource. It will vary depending on the size of the
input. Algorithm performance is machine independent and does not depend on other factors.
The algorithm should be based on analysis machines independently. RAM mode is the
analysis of memory models that measure the runtime by calculating the steps used to compute
the algorithm. It may vary depending on the size of the input. However, this algorithm
analysis does not depend on the type of computer. The worst case scenario is to help the
algorithm behave in the worst case scenario and to understand the algorithm functionality.
If you are programming from Python or C, you are using essential programs. Essential
programming defines a solution to a problem as a series of steps. Programs written in the
essential style are often similar to recipes. Essential programs often assign new variables that
change the status of the program on each line and refer to or modify the old ones. Small
problems are intelligent to solve and essential programs cannot be controlled quickly when
they are large.
(Smyth, 2018)
(lightbringer, 2019)
(careerride)
Service Orientation - Service focus will be a key component of the programs used to
create programs. At the same time, service orientation is a small part of computer
control power because it is not slow.
Time Driven - Affected time is an ideal in an event-driven programming.
Event handlers - Event handlers are the kind of people who execute a specific action
when a specific event is requested.
Triggers Functions - Induction-based coding functions are functions that determine
which code should be performed when a specific event occurs.
Events - Events include the mouse, computer keyboard, and user interface, and events
must be triggered in order for this to happen.
(Maria, 2018)
Creates a hierarchy in the IDE for one or more users throughout the writing process, attaching
those code groups to their named region. Of these, teams can be grouped together, organized
and built. Most IDEs come with Built-Debugger, which enables build. Visual debugging is a
significant benefit of most IDEs. If any errors or omissions are found, the IDE will indicate
which parts of the code are having problems.
1. Text editor - Almost every IDE has a text editor for writing source code and running
code. Some tools may have visible components for dragging the front parts. But most of
them have a simple interface with the highlighting of language specific syntax.
2. Debugger - debugging tools that help users identify and fix bugs in the source code. They
often mimic real-world events to test functionality. Programmers and software engineers
usually check various parts of the code and identify errors before releasing the
application.
3. Compiler - A programming language that converts components into a format machine
and can function as binary code. The machine code is analyzed to ensure its accuracy.
The compiler then analyzes and optimizes the code to optimize performance.
4. Code completion - Supports complete code programmers by intelligently identifying and
entering minor code formats these features save developers time-consuming code and
reduce the likelihood of typos and errors.
5. Programming language support - IDEs are usually specific to a single programming
language, but several will provide multilingual support. So, the first step is to find out
(Walker, 2018)
(Bhatia, 2020)
As mentioned above, the subclass “Rectangle” is called the main class. Here “r” is used as the
local variable for the subclass called “Rectangle”. That local variable is represented by a void
program called “EventHandler”. Then “Length” is represented for the “public double” in the
subclass and a value is added under it. It reads “r.Length = 10;” as. The subclass “Rectangle”
is called the “sender” parameter under a separate static method “r_Changed” in the main
class. Finally here is “Console.WriteLine("Value Changed: Length = {0}”, r.Length);” The
value mentioned earlier will run in parentheses mentioned here.
Re-usability - This method is easier than re-creating a program. This is done using a
class. It can be used any number of times as required.
Data Redundancy - Data redundancy is one of the biggest advantages of OOP. If a
user wants similar functionality in multiple classes, they can proceed by writing
common class definitions for similar functions.
Code Maintenance - This feature is more required than any other programming
language and allows users to rework it in many different ways. Existing codes always
save time in maintaining and modifying it by adding new changes to it.
Security - The programmer maintains security and provides the data needed to view.
Design Benefits - The design benefit to the user is that they can easily design and
correct things as well as eliminate risks. Here object-oriented programs force
designers to enter a design phase.
Better productivity - Definitely increases the overall productivity of its users when
using the app. This allows them to do more work, complete a better program, has
more unique features and is easier to read, write and maintain.
(educba)
(Partner, 2019)
3.1. Design suable algorithms for vehicle tariff calculation for rents and hires. Ideally 3
functions should be developed for this purpose as follows:
Step 1: Start
Step 2: Rent per day / Rent per week / Rent per month
Step 4: Set a table in MySQL, Daily rent and drive rent, Linking Visual Studio to MySql
Step 5: Calculate the charges for the numbers of days with module:
Rent with driver: Basic rent (Daily rent * Number of days) + driver rent
Step 9: End
Step 1: Start
Step 2: Rent per day / Rent per week / Rent per month
Step 4: Set a table in MySQL, Daily rent and drive rent, Linking Visual Studio to MySql
Step 7: End
Step 3: Select vehicle category, Select package type, input driver fee, Start km, Ending km
Step 5: According to select package type on display the base hire, night park charge,
overnight charge, waiting charge, extra km charge and extra hour charge.
Total hire: Base hire + Night Park + overnight + waiting charge + extra km charge + extra
hour charge
Step 8: End
Step 3: Select vehicle category, Select package type, input driver fee, Start km, Ending km
Step 5: According to select package type on display the base hire, night park charge,
overnight charge, waiting charge, extra km charge and extra hour charge.
Total hire: Base hire + Night Park + overnight + waiting charge + extra km charge + extra
hour charge
Step 8: End
2 Sedan 2000
3 SUV 2500
4 Jeep 3000
Function 2
Function 3
VEHICLE CHARGES
RENT
HIRE
PACKAGE
Debugger - This is how the source code is fixed when there is a problem with the code.
Compiler - This is how it works as a translator for various programs such as binary code.
Here the translator looks at the accuracy of the data and the compiler interprets the code.
Code completion - This helps the programmer to identify common code elements. This saves
the programmer time and minimizes problems before they occur.
Integrations and plugins - The gateway to developing an IDE program. This is because
development and sophistication can be improved by integrating other development tools.
Therefore, a developer must understand whether this potential IDE fits the essence of his
work.
Advantages of IDE:
Easy to use.
Simplifies the creation of database applications.
No detailed knowledge of the database is required.
Provides predefined facilities for searching, sorting, retrieving and processing data
within a database
(jabeen)
Correct Coding
The C# programming language is used here in the Visual Studio IDE, providing live
encoding support regardless of the programming language. Provides hints and details about
the platform's built-in IntelliSense API, and automatically completes lines for better speed. In
addition, the user completes the code required for the system. If there is any error in the code,
it is indicated by an underline.
Error detection can be a challenge, but the left side of the Visual Studio IDE has a lot of
tools. The troubleshooting support platform is available for all languages included. This
process can be done locally, remotely, and in the middle of production, allowing developers
to apply it to desktop or mobile devices and other debugging methods.
Rigorous Testing
Visual Studio features an IDE application testing platform that ensures that developers are
ready to deploy high quality products. They can do this in the language and test framework of
their choice with minimal effort.
Team Collaboration
The makers of Visual Studio IDE understand that eye sets are better than one eye. That‟s why
the platform has collaborative capabilities that increase team productivity. These tools are
closely integrated with the development life cycle.
Customized Options
Visual Studio IDE offers customization options for every user. They can expand the
functionality of the platform through extensions and add-ons available from the Visual Studio
market.
4.1. Design and build a small system to calculate vehicle hire amounts and record them
in a database for customer billing and management reporting for Ayubo drive.
This includes the completing the database design started in 3.2 and implementing
one or more GUIs for vehicle, vehicle type, and package add/edit/delete functions.
It essentially requires an interface for hire calculation and recording function
described above. Generating customer reports and customer invoices are not
required for this course work.
4.1.5. History
History of Rent
In software development, the debugging process begins when a developer is able to find and
reproduce an error in the code of a computer program. Debugging is part of the software
testing process and is an integral part of the overall software development lifecycle.
(Rouse)
Debugging that appears in a line or expression in the source code is machine code for a
running memory program. Instead of machine control instructions and memory, it is used to
analyze the behavior of programs for high-level applications such as root control flow control
constructions, operating procedures, and designated variables.
This is a troubleshooting process in the visual studio used by the programmer. If this is the
source code, the code is displayed.
Debugging allows you to set breakpoints. This allowed them to suspend their operations.
The following 4 steps will help you to control how Breakpoints work.
I. Step End
II. Take action
III. Exit
IV. IntelliTrace
There are three options for checking current values encoded by the visual studio programmer.
I. Data tools
II. Quick clock
III. Add the clock
Benefits:
Code integration
Team member integration
Maintenance
Uniform problem solving
Minimizes communication
Minimizes performance pitfalls
Saves money due to Less man hours
1. Security Issues: Inconsistencies and logic errors are the main reasons for software
insecurities that are commonly exploited in software. Many of these problems arise due to
poor coding and programming errors caused by their running.
2. Site Performance Issues: Incompatible encoding will affect the overall functionality of
the site. Various performance issues include:
User interaction
Server response
Ability to reuse code
Flow problems
Implementing coding standards avoids these issues and provides the user with a secure
website with minimal performance issues.
That‟s why Ayubo developers have used application-specific encoding standards, such as
camel masks, Pascal casing, Hungarian numbering, screaming hats, short applications, curved
brackets, and space between all operators and brackets. These standards make the
programmer‟s application more effective. Any developer can and will easily implement new
updates now and in the future because the structure is easily identifiable.
The coding standards of a group will not be the same for an individual. Since group
communication requires good communication, there should be no misunderstandings when
developing applications. For example, if a developer uses a short application, the application
may not be understood by another developer. Encoding standards should therefore be
discussed and outlined, as this can save time, money and labor.
Coding standards even help keep secrets between members of one group and members of the
other.
Task 03 - Implement
basic algorithms in code
using an IDE.
3. Doherty, E. (2020, April 15). What is Object Oriented Programming? OOP Explained in
Depth. Retrieved October 07, 2020, from educative:
https://www.educative.io/blog/object-oriented-programming
5. Edge Tech Academy. (n.d.). Event-Driven Programming. Retrieved October 07, 2020,
from edgetechacademy: https://www.edgetechacademy.edu/node-js/event-driven-
programming/
6. educba. (n.d.). Advantages of OOP. Retrieved October 08, 2020, from EDUCBA:
https://www.educba.com/advantages-of-oop/
7. jabeen, s. (n.d.). What Is IDE? What Are The Advantages And Disadvantages Of IDE?
Retrieved October 12, 2020, from business-finance: https://business-
finance.blurtit.com/109106/what-is-ide-what-are-the-advantages-and-disadvantages-of-
ide
9. Maria. (2018, October 23). Event-Driven Programming Features. Retrieved October 07,
2020, from Studybay: https://studybay.com/blog/event-driven-development-features/
14. tutorialspoint. (2020). Data Structures - Algorithms Basics. Retrieved October 04, 2020,
from
https://www.tutorialspoint.com/data_structures_algorithms/algorithms_basics.htm#:~:text
=Characteristics%20of%20an%20Algorithm&text=Input%20%E2%88%92%20An%20al
gorithm%20should%20have,a%20finite%20number%20of%20steps.