Programming Assignment

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

Higher Nationals

Internal verification of assessment decisions – BTEC (RQF)


INTERNAL VERIFICATION – ASSESSMENT DECISIONS
Programme title Higher National Diploma in Computing

Miss. Navodi Sithara


Assessor Internal Verifier

Unit(s)

Assignment title
W G Kuchila Chamikara
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 &l Distinction Descripts P1 M1 D1

LO2. Explain the characteristics of procedural, object-orientated and event-driven programming, conduct an analysis of a suita
Integrated Development Environment (IDE).

Pass, Merit & Distinction Descripts P2 M2 D2

LO3. Implement basic algorithms in code using an IDE.

Pass, Merit & Distinction Descripts P3 M3 D3

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

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.

Assignment Feedback
Formative Feedback: Assessor to Student
Action Plan

Summative feedback

Feedback: Student to Assessor

Assessor Date
signature

Student Date
signature

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

Word Processing Rules

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.

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.

2024-02-02

Student’s Signature: Date:


(Provide E-mail ID) (Provide Submission Date)
Higher National Diploma in Computing
Assignment Brief
Student Name /ID Number W G Kuchila Chamikara

Unit Number and Title Unit 01: Programming

Academic Year 2021/22

Unit Tutor Miss. Navodi Sithara

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.

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:

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

B. Factorial of a non-negative integer, is multiplication of all integers smaller than or equal


to n. For example, factorial of 6 is 6*5*4*3*2*1 which is 720.

n! = n * (n - 1) * …….. 1

Define what an algorithm is and outline the characteristics of a good algorithm. Write the
algorithms to display the Fibonacci series and the factorial value for a given number using
Pseudo code. Determine the steps involved in the process of writing and executing a
program and carry out an analysis of writing the code phase by discussing the potential
challenges faced.
Take a sample number and dry run the above two algorithms. Show the outputs at the end
of each iteration and the final output. Examine 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 Compare and discuss what is meant by a Programming Paradigm and the main
characteristics of Procedural, Object oriented and Event-driven paradigms and the
relationships among them. Write small snippets of code as example for the above three
programming paradigms using a suitable programming language(s) and critically
evaluate the code samples that you have given above in relation to their structure and
the unique characteristics.

Activity 3 and Activity 4 are based on the following Scenario.

Grifindo Toys is a small-scale Toy building company which is located in United Kingdom
(UK) and currently they have 50 employees working at their headquarters. They are looking
for a simple payroll system to calculate the salaries of their employees and you are hired as a
freelance software developer to build their payroll system.
Specifications for the payroll system as follows,

Grifindo Toys Payroll System mainly contains five components and the specifications for the
components are follows,
1. Employee Component.
 Admin should be able to register employee details to the system (including
monthly salary, overtime rates-hourly, allowances).
 Admin should be able to update all employee details in the system (Update and
Delete including monthly salary, overtime rates-hourly, allowances).
 Admin should be able to view individual employee details, view all employees
details, search employees.
2. Salary Component

Admin should be able to input the date range to calculate the salary. Salary cycle
begin date and the end date should be given to calculate the monthly salary.
Salary cycle begin date and end date will be defined in the settings component
and if the user enters something else the system should display an error message.

The admin should be able to enter the no of leaves an employee has taken with
number of absent days, no of holidays for the given date range. If an employee
has worked any overtime hours the admin should be able to enter that also when
calculating the Base pay value.
Base Pay need to calculate based on the following points,

Base Pay (Monthly Salary: salary_cycle_date_range, eg: 30 days): Each


employee will be paid monthly
If any employee couldn’t cover salary_cycle_date_range (eg:-30 days) attendance
the system should calculate the no-pay value according to the below mention
formula,

No-pay-value = (Total_Salary/salary_cycle_date_range)
*No_of_absent_days

Base Pay need to calculate according to the below mentioned formula

Base Pay value = Monthly_Salary + Allowances +


(Over_time_rate*no_of_overtime_hours)
Gross Pay need to calculate according to the below mentioned formula

Gross Pay = Base_Pay_value – (No_pay_value +


Base_Pay_value*government_tax_rate)

All the calculated No-pay-value, Base-pay-value and Gross pay value should
record in the database under each employee for each month. This component
should generate reports such as monthly salary report for an employee, overall
salary summary for couple of months for an employee, No-pay-value, base-pay-
value, and gross pay value of all the employees for a given month range.

3. Settings Component
This component should allow the admin to change parameter values such as
i. Date Range for a salary cycle. Eg:- 30 days
ii. Salary cycle begin date
iii. Salary cycle end date
iv. No of leaves for an employee for a year.

Activity 3

Write the complete pseudocode for the salary component of the above system (report
generation is not needed). Use the visual studio IDE (using C#.net) to implement the
above three components. Ideally there should be three separate classes for the above
three components and the developer can decide the methods which need to include in
those classes. Design the suitable database structure for keeping the data of the above
system.
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
2.1 Design and build a small GUI system for the above scenario and it should be a complete
functional system with all the functions which has described in the above scenario with the
database structure which has designed in activity 3.
2.2 Examine 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.

2.3 Explain and 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

Grading Criteria Achieved Feedback

LO1 Define basic algorithms to carry out an operation


and outline the process of programming an
application.

P1 Define an algorithm and outline the process in building an


application

P2 Determine the steps taken from writing code to


execution.

M1 Analyse the process of writing code, including the


potential challenges faced.

D1 Evaluate the implementation of an algorithm in a suitable


language and the relationship between the written algorithm
and the code variant

LO2 Explain the characteristics of procedural, object


orientated and event-driven programming

P3 Discuss what procedural, object orientated and event


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

M2 Compare the procedural, object-orientated and event


driven paradigms used in given source code of an application

D2 Critically evaluate the source code of an application that


implements the procedural, object-orientated and event-
driven paradigms, in terms of the code structure and
characteristics.
LO3 Implement basic algorithms in code using an IDE.
P4 Write a
program that
implements an algorithm using an IDE.

M3 Enhance the algorithm written,


using the features of the IDE to manage
the development process.

D3 Evaluate the use of an IDE for


development of applications contrasted
with not using an IDE.

LO4 Determine the debugging


process and explain the importance
of a coding standard
P5 Explain the debugging process and
explain the debugging facilities available
in the IDE.

P6 Explain the coding standard you have


used in your code.

M4 Examine how the debugging process


can be used to help develop more
secure, robust applications.

D4 Evaluate the role and purpose of a


coding standard and why it is necessary
in a team as well as for the individual.
Acknowledgement

There are people who have supported to make this assignment successful. First of all,
our lecturer Miss. Navodi Sithara is thankful to all the guidance, timely advice, and
encouragement throughout the module.

Secondly, I would like to thank my all teachers and staff for the cooperation support in
addition, a huge thank to Google and other recourse that I have used in this report.
Thirdly I would like to big thankful my teammates because we are sharing our
knowledge. It is big advantage of this successful report.

Finally, my report is successful because I have a great guide from lecture and very
humble teammates.

Thank You

W G K Chamikara Programming 17 | P a g e
Contents
1. Define basic algorithms to carry out an operation and outline the process of
programming an application.............................................................................................20
1.1 Algorithms..............................................................................................................20
1.2 What is an Algorithm?............................................................................................21
1.3 What is the need for algorithm................................................................................21
1.4 Characteristics of algorithm....................................................................................21
1.5 Types of algorithms................................................................................................22
1.6 Searching algorithms..............................................................................................22
1.7 The steps involved in the process of writing and executing a program...................23
2. Fibonacci Numbers.......................................................................................................24
2.1 Big-O-notation........................................................................................................29
2.2 The role of Big O notation in evaluating algorithm efficiencies.............................29
3. What is a programming paradigm?...............................................................................30
3.1 What is a procedural?............................................................................................. 30
3.2 The main characteristic of procedure......................................................................30
4. What is object-oriented?...............................................................................................30
4.1 Characteristics of an object-oriented paradigm?.....................................................31
4.2 What is an event-driven paradigm?........................................................................31
4.3 Characteristic of event-driven paradigm.................................................................31
4.4 Relationship between object-oriented, event-driven and procedural.......................31
5. Ayubo drive system features and capabilities...............................................................35
5.1 Rent Calculation..................................................................................................... 35
5.2 UI design of Ayubo drive.......................................................................................37
5.3 Connection to the SQL Server................................................................................46
6. Introduction to IDE.......................................................................................................48
6.1 Debugging.............................................................................................................. 49
6.2 Features available in Visual Studio IDE for debugging..........................................49
6.3 Using a debugging process to develop robust applications.....................................49
7. Critical Evaluation of coding standards........................................................................50
7.1 Coding standard requirements for teams and individual.........................................50
7.2 Ayubo Drive’s coding standards using...................................................................51
8. Gannt Chart.................................................................................................................. 52
9. Conclusion....................................................................................................................53
10. References.................................................................................................................. 54

W G K Chamikara Programming 18 | P a g e
1. Define basic algorithms to carry out an operation and outline the process of
programming an application.

1.1 Algorithms
An algorithm is a procedure for solving a mathematical problem using
recursive processes, which may be completed in a finite number of steps. A
algorithm is a collection of finite rules or instructions that must be adhered to
while doing computations or other problem-solving tasks. Algorithms are
essential in several domains and have numerous practical uses. Algorithms are
utilized in several significant domains, including:
Computer science - Computer programming involves algorithms, which are
utilized for activities such as sorting and searching.
Mathematics - Algorithms are utilized to solve mathematical issues, such as
finding the most efficient route in a graph or the optimal solution to linear
equations.
Operations research uses algorithms to optimize decision making processes in
domains such as transportation, logistics, and resource allocation.

1.2 What is an Algorithm?

An algorithm is a procedure used for solving a problem or performing a


computation. Algorithms act as an exact list of instructions that conduct specified
actions step by step in either hardware- or software-based routine.
Algorithms are widely used throughout all areas of IT. In mathematics and
computer science, an algorithm usually refers to a small procedure that solves a
recurrent problem. Algorithms are also used as specifications for performing data
processing and play a major role in automated systems.
An algorithm could be used for sorting sets of numbers or for more
complicated tasks, like recommending user content on social media. Algorithms

W G K Chamikara Programming 19 | P a g e
typically start with initial input and instructions that describe a specific
computation. When the computation is executed, the process produces an output.
(Gillis, 2023)

1.3 What is the need for algorithm.


Algorithms play a crucial role in swiftly and successfully addressing complicated
issues, allowing computers to execute jobs that would be challenging or
unattainable for people. They are utilized in many domains to enhance procedures,
analyze data, forecast outcomes, and provide answers to issues.

1.4 Characteristics of algorithm

Input

Output
Definiteness

Characteristic of Algorithm

Effectiveness Independent

Finiteness

Figure 1

W G K Chamikara Programming 20 | P a g e
 Input - Algorithms must take zero or more inputs.
 Output - Algorithms must accept zero or more inputs to create an output.
 Definiteness - Instructions in an algorithm must be explicit, precise, and easy to
interpret. Every basic operator must be defined without ambiguity.
 Effectiveness - Algorithms must be constructed using basic, straightforward, and
plausible operations to make it easy to draw out by utilizing paper and pencil.
 Finiteness - An algorithm must end after a limited number of steps in all test
scenarios. Every instruction containing a basic operator must be terminated
within a certain period. Infinite loops or recursive functions without base
conditions do not possess finiteness.
 Independent: An algorithm is independent of the language used.

1.5 Types of algorithms


Algorithms are grouped into numerous types, each of which is aimed at solving a
certain sort of difficulty or performing a certain task.

1.6 Searching algorithms.


The search algorithm is a systematic method employed to identify precise facts inside
a collection of information. It is regarded as fundamental computer operation. The
disparity between a rapid and feeble application while looking for data in computer
science is mostly determined by the employed searching approach.
There are 4 types of searches algorithm.
 Sequential search
 Interval search
 Serial search
 Binary search

Sequential Search
Each item undertakes a systematic search process, examining them one by one in a
logical order. Each item undergoes inspection, and if a corresponding item is
discovered, it is returned; otherwise, the search persists until all data is gathered.

W G K Chamikara Programming 21 | P a g e
Interval Search
Due to their consistent focus on the central part of the search structure and their
ability to divide the search space in half, these types of searching algorithms are
significantly more efficient than Linear Search. These algorithms are specifically
designed to perform searches within data structures that have been organized in a
sorted manner.

Serial Search
This is the most fundamental kind of search. It is sometimes referred to as a linear or
sequential search. The search starts with the first item and works its way through the
data set until a match is denied or the search reaches the end of the data set with no
matches. A list of criteria is defined before the search starts.

Binary Search
Binary search is a method for locating an element in a sorted array.
at this method, the element is always sought at the center of a subset of an array.
Only a sorted list of items may be employed for binary search. If the items are not
already sorted, sort them first.

1.7 The steps involved in the process of writing and executing a program.
• Clarify Programming Needs. / Identify the problem.
• Planning the solution.
• Coding the program.
• Testing the program.
• Documenting the program

Clarify Programming Needs. / Identify the problem.


First, you must determine what issue you are seeking to tackle. You must establish a
list of the requirements you will need to finish this project as well as the program
specifications you will be employing. The first consideration is to pick an objective.
Is it a payroll or editing program? It is also crucial to establish who will be the
ultimate user. The next step is to identify the inputs and outputs. What data is

W G K Chamikara Programming 22 | P a g e
essential to execute the software, and how will it function? After this has been
agreed upon, the next question is practical.
Planning the Solution
Programmer, you must plan how you would address this challenge. The Top-Down
Design Technique is the most common design technique. To support you, you may
design an algorithm using pseudocodes or flowcharts. Pseudocode is used to
deconstruct the program and link the program's rules to the machine. Keywords
such as if, otherwise, and then are utilized in pseudocode.

Cording the program


Computer code is essentially a list of instructions that can be run by a certain
program. Code is written in plain text, so that the compiler can read it. Compilers
see formatting characters as syntax errors. A unique file extension is given to the
document to indicate the nature of the code. For example, a file created using
Python is saved with a .py extension, like 'myprogram.py.' However, the actual
content of the file is still just plain text.

Testing the Program


After being developed, the program enters the software debugging and testing phase
of the Program Development Life Cycle (PDLC).

Documenting the Program


Documentation should begin immediately since it is essential for all program
participants. Now and in the future. Following completion, a User Manual for
commercial use, Operator Documentation for computer system operators, and
Developer Documentation for maintenance programmers will be accessible.
(Study.com, n.d.)

W G K Chamikara Programming 23 | P a g e
2. Fibonacci Numbers
The Fibonacci sequence is a series of numbers that begin with a one or a zero and
conclude. With a one, following the rule that each number (called a Fibonacci
number) is equal to the sum of the two numbers. The following equation is produced
for n = 0, where the first two terms are denoted as 0 and 1 by convention if the
Fibonacci sequence is called F (n),
(Imagination Station, 2021)
where n is the first term in the series:

F (0) = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 ...

It is common to use n = 1 in some writings. In such a situation, the first two words are
automatically defined as 1 and 1, resulting in:
F (1) = 1, 1, 2, 3, 5, 8, 13, 21, 34 ...

Here's a more comprehensive list:


0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765,
10946,17711, 28657, 46368, 75025, 121393, ...

The Fibonacci sequence is named for Leonardo Pisano an Italian mathematician who
lived from 1170 - 1250.
The Fibonacci Sequence can be written as a "Rule."

where: xn is term number "n" xn−1 is the previous term (n−1)


xn−2 is the term before that (n−2)
Ex-: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……...

Algorithm
Start
Declare variables i, a,b , show
Initialize the variables, a=0, b=1, and show =0
Enter the number of terms of Fibonacci series to be printed
Print First two terms of series
Use loop for the following steps

W G K Chamikara Programming 24 | P a g e
-> show=a+b
> a=b
-> b=show
-> increase value of i each time by 1
-> print the value of show
End

Floor Chart

Figure 2

W G K Chamikara Programming 25 | P a g e
Python code for Fibonacci Numbers

Figure 3 - Python code for Fibonacci Numbers

2.1 Big-O-notation
Big O Notation is a method used to determine the efficiency of an algorithm. As the
input increases, it calculates the estimated time required to perform your function. Put
simply, what is the level of effectiveness of the function scale? Efficiency may be
categorized into two components: temporal complexity, which refers to the time
required for a program to run, and spatial complexity, which refers to the amount of
memory or storage space used by a program.
Big O is sometimes referred to as the upper bound of an algorithm due to its focus on
the worst-case scenario. The optimal outcome provides no useful information; we will
locate our object on the initial attempt.
(Simply Learn, 2023)

2.2 The role of Big O notation in evaluating algorithm efficiencies.


In the present day, it is crucial to enhance the efficiency of programs to achieve
desired objectives without wasting resources. This stresses the relevance of algorithm
efficiency. Should your algorithms prove to be inefficient, even the most powerful
computers may encounter significant delays, especially when handling vast amounts
of data. Big O Notation is a mechanism for calculating an algorithm's efficiency. As
the input climbs, it estimates the time necessary to perform your function. Efficiency
may be judged in two ways.

 Time complexity - An algorithm's temporal complexity, which is calculated in


proportion to the amount of input, dictates the number of steps it takes.

W G K Chamikara Programming 26 | P a g e
 Space complexity - An algorithm's space complexity defines the amount of
space needed to run the algorithm in relation to n (input data to be processed).
When analyzing an algorithm's efficiency, it is crucial to evaluate the number of
operational steps involved in its execution, regardless of the programming language
used or the computer system on which it is performed. We may assert that the
efficiency of an algorithm is equal to the most conspicuous component of the equation
by defining the stages as an equation.

3. What is a programming paradigm?


In certain circumstances, procedural programming is referred to as imperative
programming. Anything other than writing style and code structure is included in the
programming paradigm. Because they are a set of instructions that inform the
computer what to accomplish step by step, procedural programming languages are
top-down languages. Each paradigm recommends a different technique to arrange
software code.
A programming language is fundamentally a problem-solving tool.
Each issue may have several solutions. Furthermore, each solution may take a diverse
approach to issue resolution.

3.1 What is a procedural?


The program code in procedural programming is structured as a series of procedures
called functions. These functions act on variables in the program. Variables are used
to store program data in procedural programming. Procedural programming aims to
break down huge programs into smaller programs known as procedures. The
procedures are sometimes known as subprograms, subroutines, methods, or functions.
Every function performs an operation on the program data. Each function is made up
of computational statements that handle a particular portion of the issue.
(Bhatia, 2022)

3.2 The main characteristic of procedure


Procedural programming is characterized by the independence of data and functions.
 Data in a program flows freely.
 By invoking another function, a function may have access to its data.
 A program's logic is straightforward to comprehend.

W G K Chamikara Programming 27 | P a g e
 Procedural programming employs the top-down approach.

4. What is object-oriented?
The goal of object-oriented programming (OOP) is to combine the benefits of
modularity and reusability using objects, which are collections of data and
operations. Programs are created using objects, which are often instances of classes.
Systems on computers converse with one another.
(Gillis, 2023)

4.1 Characteristics of an object-oriented paradigm?


The object-oriented technique is based on three characteristics of object-oriented
languages,
 Encapsulation
 Polymorphism
 Inheritance

4.2 What is an event-driven paradigm?


In event-driven programming, the program's execution flow is controlled by events,
such as a mouse click, key press, or communication from the operating system or
another program. Programming that monitors certain events is called an event
listener. Programming that monitors certain events is called an event listener.
Although it is easier to implement, event-driven programming is supported by all
programming languages in theory thanks to features like closures.
An event-driven application recognizes and
responds to events in real time by utilizing an appropriate event-handling system.
Any programming language may be used to create event-driven applications, but
some languages are designed with event-driven programming and an integrated
development environment in mind.
(Neubauer, 2023)

4.3 Characteristic of event-driven paradigm


 Event
 Event handler
 Event loop

W G K Chamikara Programming 28 | P a g e
 Service-oriented processing
 Time driven.
 Trigger function
4.4 Relationship between object-oriented, event-driven and procedural
A program and its subprograms are defined as a sequence of stages in procedural
programming. Declarative programs, on the other hand, provide a description or
denotation of the desired outcome rather than focusing on the procedures needed to
computerize it.
Encapsulation, inheritance, replacement, programming to
interfaces, and other ideas are the foundations of object-oriented programming, a
method of structuring code. Programming with objects is frequently procedural.
Precisely timing events and relying on the underlying system's main event loop are
prerequisites for event-based programming. By utilizing one of the numerous
libraries that are compatible with the system-provided loop, you may save yourself
the trouble of writing your own event loop. Even while object-oriented architecture
is typically used for creating event-driven systems, this isn't always the case. Because
of this, even though these three divisions are frequently nested inside one another in
common usage, they are not strictly hierarchically connected.

Snippets code of event-driven

Figure 4 Snippets code of event-driven Figure 5 Output

W G K Chamikara Programming 29 | P a g e
Code of Object oriented.

Figure 6 Snippets code of object-oriented

W G K Chamikara Programming 30 | P a g e
Figure 7 Output

Snipped Code Procedural

Figure 8 - Snipped code of Object Oriented

W G K Chamikara Programming 31 | P a g e
Figure 9 Output

5. Ayubo drive system features and capabilities.


Ayubo Drive is the transportation division of Ayubo Leisure (Pvt) Ltd, a recently
established travel and tour company. Its fleet comprises a variety of vehicles,
including cars, SUVs, and vans. The author developed the system in response to the
customer's request using the information provided. Many computations are included
in the system as requested by the customer. Additional options for renting a car
include different car types, different packages, cars with or without a driver, and much
more. All of your information is instantly entered into the system database when you
rent a car.
When designing the system, the author considered security. Standard security
requirements include system access, password management, and logging.
The system's user interface is designed to be simple to use. This software was
designed in Visual Studio 2022, and C# was the programming language used to create
it. This program uses SQL Server Management Studio to construct its database. Users
that are allowed to log in can also enter and see data using the payment form.
However, access to the admin panel is required before deleting a payment record, and
only the primary admin can accomplish this. Direct action is not possible in this case.
Once there, you may go to the previously described payment records form and
remove the relevant entries.

W G K Chamikara Programming 32 | P a g e
5.1 Rent Calculation
Return the whole rent amount when the vehicle number, rental date, return date, and
driver parameters are supplied. The width-driver setting is set to true or false
depending on whether the vehicle is rented with or without a driver.
FUNCTION Rent Calculation (Vehicle no, rented_date, return_date, with_driver)
GET month rate, week rate, day rate, dailyDriverCost FROM DATABASE
Total days = rented_date
return_date +1 Rent days
total days Month = rent days / 30
Rent days = rent days % 30
Week = rent days / 7 Rent days = rent days % 7
rent_value = month * month rate + week* week rate + day*day rate
If with_driver = true Total rent_value = rent_value + dailyDriverCost * totaldays
Else
Total rent_value = rent_value End if Return total rent_value
END FUNCTION

Day tour – Hire calculation.


The total rental value is determined once the parameters vehicle number, package
kind, start.
and finish timings and start and end km readings are submitted. Output parameters
should
include basic rental rate, waiting charge, and excess kilometer charge.
INPUT vehicle_no, package_type,start_time,end_time, start_km_reading,
end_km_reading
CALCULATION total hire_value
return base_hire_charge Waiting_charge and extra_km_charge
Long tour calculation
Private void button2_Click (object sender, EventArgs e)
{
Int driverovernight;
Int extrakm = 0;
Int overnightcharge = 0;
Int parkingcharge = 0;

W G K Chamikara Programming 33 | P a g e
DateTime Time1 = dateTimePicker1.Value.

DateTime Time2 = dateTimePicker2.Value;


Int numberdays = (int)Time2.Subtract(Time1).
TotalHours; Int start = int. Parse(textBox3.Text);
Int end = int.Parse(textBox4.Text); intdistance = end -start;
int basecharge, packagekm, priceperkm, totalhirecharge;
packagekm = int.Parse(textBox9.Text);
priceperkm = int.Parse(textBox10.Text);
basecharge = packagekm * priceperkm;
textBox5.Text = basecharge.ToString();
if (distance > 100)

{
extrakm = (distance - 100) * 150; // 150 per extra km
}

driverovernight = int.Parse(textBox11.Text);
if (numberdays > 2) { overnightcharge = (numberdays - 2) * 350 + parkingcharge +
driverovernight; }
totalhirecharge = basecharge + extrakm + overnightcharge; textBox8.Text =
totalhirecharge.ToString(); textBox6.Text = extrakm.ToString();
}

5.2 UI design of Ayubo drive

W G K Chamikara Programming 34 | P a g e
Figure 10 Loging UI

Figure 11 Algorithms used in system coding.

Figure 12 Design

W G K Chamikara Programming 35 | P a g e
Figure 13 Algorithms used in system coding.

Figure 14 Design

W G K Chamikara Programming 36 | P a g e
Figure 15 Algorithms used in system coding.

Figure 16 Design

W G K Chamikara Programming 37 | P a g e
Figure 17 Algorithms used in system coding.

Figure 18 – Design

W G K Chamikara Programming 38 | P a g e
Figure 19 Algorithm used in system coding

Figure 20 – Design

W G K Chamikara Programming 39 | P a g e
Figure 21 - Algorithm used in system coding

Figure 22 – Design

W G K Chamikara Programming 40 | P a g e
Figure 23 - Algorithm used in system coding

Figure 24 – Design

W G K Chamikara Programming 41 | P a g e
Figure 25 - Algorithm used in system coding

Figure 26 – Design

W G K Chamikara Programming 42 | P a g e
Figure 27 - Algorithm used in system coding

Figure 28 – Design

W G K Chamikara Programming 43 | P a g e
Figure 29 - Algorithm Used in system code

5.3 Connection to the SQL Server


client system for SQL.
using System.data's sqlclient When the link was queried, it gave information about the
missing library. It fills the area instantaneously as I click it. I utilize Reshape, a
supported extension for Visual Studio, when working on a project. Its goal is to avoid
errors and pave the way for upcoming code cleanup and revisions that adhere to
industry standards.

W G K Chamikara Programming 44 | P a g e
Figure 30 - SQL Connection

W G K Chamikara Programming 45 | P a g e
6. Introduction to IDE
A software application that combines the fundamental tools needed for software
design and testing is called an integrated development environment, or IDE.
Software developers create, develop, and test code using a variety of tools.
Test platforms, code libraries, compilers, and text editors are examples of
development tools. A developer would have to select, use, integrate, and oversee each
of these tools independently in the absence of an IDE. A framework, program, or
service called an integrated development environment (IDE) often includes a number
of these development-related tools. Software development may be made easier by
using the integrated toolset, which helps identify and reduce typos and coding errors.
While some IDEs are available for free, some need a fee. An IDE may be included in
a stand-alone application or in both components of a bigger package.

Combining a code editor, compiler or interpreter, and debugger under one graphical
user interface (GUI) is a common feature of integrated development environments
(IDEs). The code editor is used by the user to create and modify source code. The
source code is converted by the compiler into a language that a computer can
understand and use. The software is tested using the debugger to look for any bugs or
problems. A source code library, build automation tools, object and data modeling,
and unit testing may all be found in an IDE.

W G K Chamikara Programming 46 | P a g e
6.1 Debugging
The practice of locating and fixing code errors in computer programs is known as
debugging. In engineering and information technology, the phrases "bug" and "error"
are interchangeable. Finding and fixing a problem's core cause is the aim of
debugging.
In model-driven development, an IDE (MDD) might be useful. An IDE converts a
developer's initial model into pertinent code. The model-driven code is then
thoroughly automated and debugged by the IDE. Once the build is complete and well
tested, it may be shared for additional testing with the IDE or other tools.

6.2 Features available in Visual Studio IDE for debugging.


Debugging, diagnostics, and profiling are essential steps in the software development
process because before an application is published, any errors, flaws, and performance
bottlenecks must be identified and fixed.
It is the duty of every application developer to write error-free, logical, and
syntactically sound code.
In actual use, though, bugs and faults might show up and slow down the program.
Because of this, programmers are always searching for new approaches to arrange
code to improve efficiency and debugging.
Recent iterations of Visual Studio have added features that will increase code quality
and developer efficiency.

6.3 Using a debugging process to develop robust applications.


We are aware that fewer errors suggest a higher likelihood of security for our product.
Finding the locations, types, and causes of problems as well as the reasons behind
them is greatly aided by debugging. It provides a thorough explanation of all the
issues and shortcomings that we can simply fix with the debugger's assistance. It also
displays any potential mistakes or issues that arose during the writing of the code.
Therefore, if the errors are fixed, our application will be able to handle problems more
quickly and securely, strengthening the program's overall robustness and safety. Start
the first debugging session. The application now runs properly when the breakpoint is
set and the program is launched normally, either by using the menu, the toolbar, or
pressing F5. However, the execution of the application is paused just before it reaches
a line that contains a breakpoint.

W G K Chamikara Programming 47 | P a g e
since it won't be determined until the breakpoint line is evaluated Hovering the mouse
over the variables reveals their contents.

Figure 31 – Code

7. Critical Evaluation of coding standards


A set of guidelines and conventions that must be followed while writing source code
in a certain computer language is known as a coding standard. It is also referred to as
a programming style, a code style guide, a coding convention, and a code formatting
standard. The coding standard covers a wide range of topics related to creating and
managing program source code. These qualities include things like variable naming
conventions, comment style, bracket organization strategies, indent style, and the use
of spaces in arithmetic statement structure.

7.1 Coding standard requirements for teams and individual


The consistency of variable names used throughout the coding process is another
important consideration. Some advantages of implementing coding standards in your
development project are as follows: Coding standards improve productivity by
facilitating the early identification of issues, which helps the entire team—but
especially QA teams—when testing individual code segments. Moreover, there is a
greater chance that these problems in the future will be completely avoided. Using
code standards will stop problems and errors brought on by incorrect coding. Coding
standards help to simplify the development process, which is important so that
individual developers can understand what's happening with the product. Error is
more likely to occur in complex coding, especially when it comes to human error.

W G K Chamikara Programming 48 | P a g e
It establishes a benchmark for code quality and, above all, makes sure your
development project is secure.

7.2 Ayubo Drive’s coding standards using.


When creating this application for Ayubo Tours, the author adhered to several coding
standards and best practices, such as the use of comments, indentation patterns, and
variable declaration. These guidelines made it simple for the author to see errors and
misunderstandings in calculations and other processes.

Figure 32 – Coding

W G K Chamikara Programming 49 | P a g e
8. Gannt Chart
Task Month
Nov’23 December 2023
25 - 28 1- 7 8 - 14 15 - 28 29 - 30
Define basic algorithms to carry out an
operation and outline the process of
programming an application.
Explain the characteristics of procedural,
object orientated and event-driven
programming, conduct an analysis of a
suitable Integrated Development
Environment (IDE)
Implement basic algorithms in code using
an IDE.
Determine the debugging process and
explain the importance of a coding
standard.

W G K Chamikara Programming 50 | P a g e
9. Conclusion
Most mid-level advanced programming concepts are covered in this course,
including an introduction to algorithms, the fundamental theories of programming,
and the construction of a few algorithms using pseudocodes. Writing code for
both basic and sophisticated applications in C# and Python, defining important
programming paradigms including object-oriented programming, and
progressively creating a functional computer application with a complete database
while assessing the usage of IDEs, testing, and coding standards.

W G K Chamikara Programming 51 | P a g e
10. References
Bhatia, S., 2022. Procedural Programming. [Online]
Available at: https://hackr.io/blog/procedural-programming
[Accessed 05 11 2023].
Gillis, A. S., 2023. Algorithm. [Online]
Available at: https://www.techtarget.com/whatis/definition/algorithm
[Accessed 4 10 2023].
Gillis, A. S., 2023. object-oriented programming. [Online]
Available at: https://www.techtarget.com/searchapparchitecture/definition/object-
oriented-programming-OOP#:~:text=Object%2Doriented%20programming%20(OOP)
%20is%20a%20computer%20programming%20model,has%20unique%20attributes
%20and%20behavior.
[Accessed 18 10 2023].
Imagination Station, 2021. The Fibonacci Sequence. [Online]
Available at: https://www.imaginationstationtoledo.org/about/blog/the-fibonacci-
sequence#:~:text=The%20Fibonacci%20sequence%20is%20the,233%2C%20377%2C
%20610%2C%20%E2%80%A6
[Accessed 21 9 2023].
Neubauer, T., 2023. The what, why and how of event-driven programming. [Online]
Available at: https://quix.io/blog/what-why-how-of-event-driven-
programming#:~:text=Event%2Ddriven%20programming%20(EDP),programs%2C
%20sensor%20outputs%2C%20etc.
[Accessed 15 10 2023].
Simply Learn, 2023. Introduction to Big O Notation in Data Structure. [Online]
Available at: https://www.simplilearn.com/big-o-notation-in-data-structure-
article#:~:text=Big%20O%20Notation%20is%20a%20tool%20used%20to%20describe
%20the,bound%20of%20an%20algorithm's%20runtime.
[Accessed 6 10 2023].
Study.com, n.d. How to Write a Program: Coding, Testing & Debugging. [Online]
Available at: https://study.com/academy/lesson/how-to-write-a-program-coding-
testing-debugging.html
[Accessed 30 12 2023].

W G K Chamikara Programming 52 | P a g e

You might also like