E172797 1683396459171 191092 Programming
E172797 1683396459171 191092 Programming
Unit(s)
Assignment title Design & Implement a GUI based system using a suitable Integrated
Development Environment
Student’s name Umair Faisal
List which assessment criteria Pass Merit Distinction
the Assessor has awarded.
Internal Verifier
Date
signature
Programme Leader
Date
signature (if required)
Higher Nationals - Summative Assignment Feedback Form
Student Name/ID Umair Faisal (E172797)
Unit Title Design & Implement a GUI based system using a suitable Integrated Development
Environment
Assignment Number Assessor Miss.Vishmi
12/28/2022 Date Received 1st
Submission Date
submission
LO2. Explain the characteristics of procedural, object-orientated and event-driven programming, conduct an analysis of a
Integrated Development Environment (IDE).
Pass, Merit & Distinction Descripts P2 M2 D2
LO4. Determine the debugging process and explain the importance of a coding standard.
Resubmission Feedback:
* 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.
Assignment Feedback
Formative Feedback: Assessor to Student
Action Plan
Summative feedback
Assessor Date
signature
05/06/2022
Student Date
signature
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 make sure all the details are accurately filled.
2. Attach this brief as the first section of your assignment.
3. All the assignments should be prepared using a word processing software.
4. All the assignments should be printed on A4 sized papers. Use single side printing.
5. Allow 1” for top, bottom , right margins and 1.25” for the left margin of each page.
1. The font size should be 12 point, and should be in the style of Time New Roman.
2. Use 1.5 line spacing. Left justify all paragraphs.
3. Ensure that all the headings are consistent in terms of the font size and font style.
4. Use footer function in 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 editing your
assignment.
Important Points:
1. It is strictly prohibited to use textboxes to add texts in the assignments, except for the
compulsory information. eg: Figures, tables of comparison etc. Adding text boxes in the body
except for the before mentioned compulsory information will result in rejection of your work.
2. Carefully check the hand in date and the instructions given in the assignment. Late submissions
will not be accepted.
3. Ensure that you give yourself enough time to complete the assignment by the due date.
4. Excuses of any nature will not be accepted for failure to hand in the work on time.
5. You must take responsibility for managing your own time effectively.
6. 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.
7. Failure to achieve at least PASS criteria will result in a REFERRAL grade .
8. Non-submission of work without valid reasons will lead to an automatic RE FERRAL. You
will then be asked to complete an alternative assignment.
9. If you use other people’s work or ideas in your assignment, reference them properly using
HARVARD referencing system to avoid plagiarism. You have to provide both in-text citation
and a reference list.
10. If you are proven to be guilty of plagiarism or any academic misconduct, your grade could be
reduced to A REFERRAL or at worst you could be expelled 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.
05/06/2022
Student’s Signature:
Date:
(Provide E-mail ID) (Provide Submission Date)
Higher National Diploma in Computing
Assignment Brief
Student Name /ID Number Umair Faisal (E172797)
Issue Date
Submission Date
Submission Format
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.
Activity 1
A. The Fibonacci numbers are the numbers in the following integer sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the
recurrence relation.
Fn = F n-1 + F n-2
Activity 2
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 typeif that is applicable for that type of
vehicle.For each package maximum km limit and maximum number of hours
arealso 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
Write suable algorithms for vehicle tariff calculation for rents and hires.
Ideally 3 functions should be developed for this purpose as above. Use the
visual studio IDE (using C#.net) to Implement the above algorithms 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.
Analyze the features of an Integrated Development Environment (IDE) and
explain how those features help in application development. Evaluate the use
of the Visual StudioIDE 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 forAyubo 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 Explain debugging process and 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 Outline 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.
Grading Rubric
Characteristics of an algorithm
Figure 2 Characteristics of an algorithm
Well-Defined Inputs
An algorithm requires some input values to generate the output. There can be any value as
input except 0.
Finiteness
The algorithm must finally come to an end. Stopping may indicate that you have received
the anticipated outcome or that no solution is possible. Algorithms must end after a certain
number of steps. An algorithm should never be limitless and should always end after a set
number of steps. It is pointless to create an endless algorithm because it will be
meaningless.
Well-Defined Outputs
At the end of an algorithm, there need to be at least one or more outcomes. If there’s no
output then no point in constructing an algorithm.
Feasible
The approach must be simple, broad, and practical enough to be implemented with the
resources available. There can be no technologies that are not integrated.
Unambiguity is one of the characteristics of a good algorithm, which indicates that its
instructions should be simple and easy. People must be able to understand the algorithm.
Language independent
An algorithm should have step-by-step instructions that are unrelated to any programming
code. It should be designed in such a way that it can run on any programming language.
This is the initial stage of programming, and it entails gathering the following data:
These elements are critical for programmers since they serve as the foundation for
planning programming and regulating any possible problems that may develop.
After creating the algorithm, the program is written in a high-level language. The
process of writing the software is known as coding.
Test Execution
The application must be run or executed in order to detect faults or bugs. This is
known as test execution. It aids in the verification of the program's logic and the
elimination of mistake
Debugging
We delete all errors from the program at this step since there is a probability that some
errors will arise while we are coding. The application is named "DRY RUN" and is
run manually here. This is repeated numerous times until all errors have been
eliminated from the application and the system is error-free.
Final Documentation
This is one of the most important steps to be followed, yet it is also critical since it will
assist the programmer in correcting any errors that may arise in the software.
• The user manual gives the user detailed instructions on how to use the application
and what to do if there is a problem.
•
The Technical Manual covers the program's technical details. When the system is
not operating properly or requires improvements, this is utilized to obtain
technical facts about the application.
Linear Search
Linear search, also known as sequential search, is a technique for locating a certain
value in a list. It checks each element of the list in turn for the target value until a match
is found or all of the items have been searched. This is one of the most fundamental
search algorithms, and it is inspired by real-world situations.
Iteration 2
Step 2 – The search element is compared with the next element (13)
Iteration 3
Step 3 – The search element is compared with the next element (25)
Iteration 4
Step 4 – The search element is compared with the next element (42)
Iteration 5
Step 5 – The search element is compared with the next element (50)
Both elements are matching. So we stop comparing and displaying elements found in
index 4.
Binary Search is a searching technique for determining the place of an element in a sorted
array. The element is always sought in the center of a part of an array in this manner.
Only a sorted list of elements can be used for binary search. If the items are not already
sorted, we must sort them first. Binary search can be implemented in two ways: Iterative
and recursive methods
Example of Binary Search
Iteration 1
Step 1 – The search element is compared with the middle number(55)
Both the numbers don’t match. Number 12 is smaller than 55. Then we only search on
the left side of the list for the number, the numbers on the left are (10,13,25,42).
Iteration 2
Step 2 – The search element is compared with the new middle number (13)
The Fibonacci series, named after Italian mathematician, named Leonardo Pisano
Bogollo, later known as Fibonacci, is a series (sum) formed by Fibonacci numbers
denoted as Fn. The numbers in Fibonacci sequence are given as: 0, 1, 1, 2, 3, 5, 8, 13,
21, 38, . . . In a Fibonacci series, every term is the sum of the preceding two terms,
starting from 0 and 1 as first and second terms. In some old references, the term '0'
might be omitted. (Gupta, 2020)
The Fibonacci sequence is a set of numbers that begins with a zero, then a one,
another one, then a sequence of progressively increasing numbers. Each number in the
series is equal to the sum of the two numbers before it. The Fibonacci sequence starts
with the 14 integers:0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 ...
Each number, beginning with the third, follows the formula. For example, the seventh
number, 8, is preceded by three numbers that sum up to eight.
The series can potentially go on indefinitely, with each new number utilizing the same
algorithm. Some resources display the Fibonacci sequence beginning with a one
rather than a zero, however, this is unusual.
1.2.2 History of Fibonacci’s series
The Italian mathematician Leonardo of Pisa, also known as Leonardo Pisano was
born in Italy in the eleventh century and discovered the features of the sequence
presumably while examining a form of logic issue about the expansion of a colony of
rabbits.
Start
Step 1: Take integer variables nterms, n1 and n2
Step 2: Set n1 = 0, n2 = 1
Step 3: Input Validation
Step 4: Display n1
Step 5: set nth = n2 + n2
Step 6: set n1 = n2
Step 7: set n2 = nth
Step 8: count +1
Step 9: REPEAT from 4 - 7, for x times
Stop
Python coding for the Fibonacci series
The figure above illustrates how I worked on the Fibonacci sequence using the Python
computer language.
Result after executing the program
As seen in the above figure, I was able to achieve a successful result after executing the
application. For example, I input the number 18 to obtain the sum of the 18th value of the
Fibonacci sequence, therefore we can see there are 18 values printed on the above figure
and the 18th value is "1597".
Factorial is meant by factorial numbers
A factorial is a mathematical function with the symbol (!) that multiplies a number (n) by
every number that comes before it. Simply put, the factorial function multiplies all whole
numbers from the selected number down to one. In further mathematical terms, a
number's factorial (n!) is equal to n. (n-1).
Start
Step 1: Make x and f integer variables.
Step 2: Set f=1 to begin.
Step 3: Set x value.
Step 4: Determine whether x<0;
Step 5: If x = 0; output factorial is 0
Step 6: repeat loop i in range (1, x+1)
Step 7: f = f*i
Step 8: Display the value of F.
Stop
The figure above illustrates how I worked on the factorial numbers using the Python
computer language. By implementing this code if was successfully able to get the
factorial numbers.
Results after implementing the code
Figure 7 Evidence of the answer which I got after implementing the code
This is the answer I got to my code for obtaining a factorial number, and it was successful
since after executing the program, I got the proper answer. I input ten and attempted to
get the factorial value of ten; I received "3628800" as the factorial of ten, which was the
correct result.
Big O notation
Big-O notation gives you a way to calculate how long it will take to run your code. You
can physically time how long your code takes to run, but with that method, it is hard to
catch small time differences. For example, the time it takes between running 20 and 50
lines of code is very small. However, in a large program, those inefficiencies can add up.
Big-O notation counts how many steps an algorithm must execute to gauge its efficiency.
Approaching your code in this manner can be very effective if you need to tune your code
to increase efficiency. A big-O notation will enable you to measure different algorithms
by the number of steps it requires to run and objectively compare the algorithms'
efficiency. (Seaton, 2020)
2 Activity
2.1 PROGRAMMING PARADIGM
Imperative Paradigm
The imperative programming paradigm employs a series of statements to change the state
of a program using variables. The imperative paradigm's purpose is to specify how
software should behave by explicit instructions. Imperative programming is frequently
contrasted with declarative programming, which is the principle underlying languages
that specify what to do rather than how to do it. Imperative paradigms are classified into
three categories:
➢ Procedural Programming
➢ Structured Programming
➢ Object Oriented Programming
2.1.2 The main characteristics of Procedural, Object-oriented, and Event-driven
paradigms
Procedural Programming
Modularity
It involves breaking down a complex problem into smaller parts in order to resolve it
quickly. It entails breaking the program's functionality into independent smaller
components, and each portion may execute the specific purpose for which it was created.
Pre-Defined function
A function is a procedure in software that may be invoked by its name. Built-in functions
are another name for predefined functions. They are a collection of subroutines that
perform specialized functions. These functions are often included in high-level
programming languages like Python and C++ but can also be imported into the
programming language via registries or programming libraries.
Local Variable
Variables are storage sectors with unique names in computer languages. Users can give
them values. They are used to refer to a program's stored value. Local variables, also
known as lexical variables, are variables that are declared within a certain method and
may only be used or referred to within that method. As a result, their reach is limited to
that approach, and they cannot be utilized elsewhere. Other methods in the program will
be unaware of the local variable created in this method. The application will throw an
error if a local variable is used in another procedure.
Parameter Passing
➢ Pass by value
➢ Pass by reference
➢ Pass by the name
➢ Pass by value-result
(Imam, 2022)
Advantages
• The programmed simplicity, as well as the ease with which compilers and
interpreters may be implemented
• Because the source code is portable, it may also be used to target a different CPU.
• A wide range of books and online course material on proven algorithms is
accessible, making it easy to study along the route.
• The program flow can be easily traced.
• Memory requirements are reduced by using the procedural programming
approach.
Disadvantages
• When Procedural Programming is used, the program code becomes more difficult
to write.
• The utilization of global data is an obstacle to sustaining and improving.
• It is difficult to relate to real-world items.
• It focuses on functions rather than data.
• The data is exposed to the entire program, making it less secure.
The phrase object-oriented is made up of two words: object and oriented. OOP is a
programming pattern that is constructed around objects or entities; therefore, the name is
object-oriented programming. It has a broad influence since it appeals to people on
several levels and offers faster and less expensive creation and maintenance.
Classes are user-defined data types that are used to build objects. A class is made up of
objects that have comparable characteristics and actions. As a result, a class is a collection
of things. The object is a class instance.
Data Abstraction
Inheritance
The process of deriving a new class from an existing class is known as inheritance. A
base, parent, or superclass is an existing class. The newly generated class is known as a
derived class, child class, or subclass. The derived class includes all of the characteristics
of the base class as well as some additional features.
Binding
Binding refers to the process of linking the function call to the function code that will be
performed in response to the call. The code associated with the function call is linked at
build time via static binding. Early binding or compile time polymorphism is another
name for it. The code associated with the function call is linked dynamically during
runtime. Also known as late-binding polymorphism or runtime polymorphism.
2.1.3.1 Advantages and Disadvantages of Object-Oriented Programming
Advantages
Disadvantages
Event-Driven Programming
Time-Driven
Events
Events include mouse, keyboard, and user interface events, which must be triggered in the
program in order to occur, which means the user must interact with an item in the
program, such as clicking a button with a mouse, selecting a button with the keyboard,
and so on.
Service Oriented
Trigger functions
In event-driven programming, trigger functions are functions that decide what code to
execute when a given event happens, and they are used to pick which event handler to use
for the event when a specific event occurs.
Advantages and Disadvantages of Event-Driven Programming
Advantages
Disadvantages
• Ones with complicated graphical user interfaces may take longer to load and
execute than simpler programs, especially if RAM is limited.
• Event-driven Programming is more complex than procedural and object-oriented
Programming.
• Event-driven programming is frequently more difficult and time-consuming than
batch programming for basic systems.
• The program's flow is frequently less logical and apparent.
• Creating many forms in a program can indeed be extremely confusing
and annoying for the user.
It is difficult to add new data and It is simple to add additional data and
functionalities. functions.
Procedural Programming
In procedural programming, the State of the system is generally passed directly between
the steps, so it does not need to exist in a context outside of the executing logic. From a
testing point of view, properly testing a pure Procedural Programming application will
require the whole application to be completed. This means that the external state is
generally less of a concern for testing PP logic.
Event-Driven Programming
Most Graphical User Interfaces will implement forms of Event Driven programming.
This is where the system raises event messages or responds to events raised from other
systems. The application logic is executed in direct response to these events, in explicit
contrast to Procedural Programming the timing of the events is considered not
controllable. This means that it is more important to check the state of the system when
performing decision logic.
Object Oriented Programming (OO) is a style of programming where the state of the
system is modeled using classes that describe a set of metadata and the behaviors and
interactions with other objects. From a testing point of view, OOP makes it possible to
replicate state or the environment without having access to the real operating
environment. This can become a burden though; more care needs to be taken to ensure the
state is defined accurately enough to obtain meaningful test results.
2.1.6 WRITE SMALL SNIPPETS OF CODE SAMPLES FOR PROCEDURAL,
OBJECT-ORIENTED, EVENT-DRIVEN PARADIGMS
Procedural Programming
code
Result
Code
Figure 12 Code for Object-Oriented programming
Result
Event-Driven Programming
Figure 14 Code for Event-driven programming
Result
3.1.1 Suitable algorithms for vehicle tariff calculation for rents and hires
Rent calculation
The term "IDE" refers to a sort of software that assists programmers in the creation of
code A source code editor, a compiler/interpreter, and a debugger are all common
components of an integrated development environment (IDE). Increase programmers'
productivity by encapsulating the entire code creation, compilation, and testing process. It
does this by merging several functions into one application, allowing users to develop,
test, and run programs all from the same location, often with a graphical user interface.
Text editor: Almost every IDE includes a text editor for writing and manipulating source
code. Some tools may include visual elements for dragging and dropping front-end
components, although the majority feature a plain interface that highlights language-
specific grammar. (Walker, 2021)
Debugger: Debugging tools let users find and correct mistakes in source code. To
evaluate functionality and performance, they frequently imitate real-world scenarios.
Before the application is deployed, programmers and software engineers may generally
test the various code parts and detect flaws. (Walker, 2021)
Advantages Disadvantages
The IDE can fix syntax, warn about memory Some IDEs do not enable users to interface
leaks, and help with code quality, among directly with the database.
other things.
Figure 27 Advantages and Disadvantages of using IDE
IDEs are useful for developing software Because the IDE has a graphical Interface. It
programs, drivers, and utilities. needs additional memory and computing
power.
It helps to keep track of the code The interface is not very user friendly
It is very easy to create database applications It is a hard task to remember the values when
using IDE implementing the codes
4 Activity
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.
• Login Page
• Signup Page
• Main Menu
• Packages Menu
• Customer Menu
• Employee Menu
• Reservations Menu
• Tour Calculations (3)
Login Page
Signup page
Figure 29 Evidence for the Ayubo Drive Sign up page interface
Main Menu
Figure 30 Evidence for the main menu of the Ayubo Drive User Interface
Customer Menu
Figure 31 Evidence for the customer menu of the Ayubo Drive User Interface
Employee menu
Packages Menu
4.2 DEBUGGING PROCESS AND THE FEATURES AVAILABLE IN VISUAL STUDIO IDE
Debugging
Debugging is the act of finding and eliminating current and prospective problems known
as bugs in software code that might cause it to behave abnormally or crash. Debugging
is used to detect and address faults or problems in software or systems to avoid
erroneous functioning. Debugging becomes more difficult when several subsystems or
modules are tightly connected, as each modification in one module may cause more
defects to arise in another. Debugging a program can take longer than writing it.
Any software that is created must be bug-free before it is released or placed on the
market. Because there is so much rivalry in the industry, every company wants to be at
the top. It is doable if your program is bug-free, and the consumer is satisfied with it. If
the consumer finds no errors when using the program, they will be satisfied. To satisfy a
consumer, software must be bug-free and fixed through the debugging process. This is
why every firm must go through the debugging procedure before releasing their
products to the market. (Tawdi, 2020)
Figure 39 Process of Debugging
Debugging process
Locate Error
Finding problems early on may save a lot of time. We waste a lot of time if we make a
mistake in detecting an error. Errors or faults that arise at a client location are difficult to
locate. Identifying the correct mistake is essential for saving time and avoiding problems
at the user site.
You must utilize an appropriate technique to design the error correction at this step. This
will assist you in comprehending the issue. This stage is essential because the error
which is being solved currently might take you to another error.
Repair Error
Then the fourth step is to implement the solution for the error which is being designed in
the above step. If the repair was not successful, try another way by designing another error-
repairing method.
Retest Program
Program testing must be performed on all code when changes are made at this level. If all
test cases pass the test, we can go to the next stage; otherwise, we must resolve the test case
that fails the test.
Coding standards are a collection of coding principles, regulations, and best practices
that assist developers in writing better code. Coding Standards also encourage good
programming habits and increase productivity. To build neat, dependable, and effective
code, whether a beginner or an experienced software developer, it’s always better to
stick to the appropriate coding standards. This not only eliminates future rework as our
code base expands, but it also increases the software performance.
5 References
Gupta, A. (2020, 11 5). Fibonacci Series. Retrieved from cuemath:
https://www.cuemath.com/numbers/fibonacci-series/
Hope, C. (2018, 12 13). Event Driven Programming. Retrieved from Computer Hope:
https://www.computerhope.com/jargon/e/event-driven-prog.htm
Huang, S. (2020, January 16). What is big O notation. Retrieved from free code camp:
https://www.freecodecamp.org/news/big-o-notation-why-it-matters-and-why-it-
doesnt-1674cfa8a23c
Imam, F. (2022, May 27). procedural Programming. Retrieved from finsliqblog:
https://www.finsliqblog.com/programming-languages/procedural-programming-
what-should-you-
know/#:~:text=Features%20of%20procedural%20programming%201%20Modula
rity%20Modularity%20means,of%20a%20funct
Seaton, J. (2020, December 20). What is Big O notation. Retrieved from make use of:
https://www.makeuseof.com/what-is-big-o-notation/
Tawdi, S. (2020, January 23). What is Debugging. Retrieved from EDUCUBA:
https://www.educba.com/what-is-debugging/
Walker, A. (2021, December 03). What Is an IDE? How It Helps Developers Code
Faster. Retrieved from G2: https://www.g2.com/articles/ide