You are on page 1of 207

Higher Nationals

Internal verification of assessment decisions – BTEC (RQF)

INTERNAL VERIFICATION – ASSESSMENT DECISIONS

Programme title Higher National Diploma in Computing

Tharaka

Assessor Internal Verifier


Unit(s)

Assignment title

Mohamed Aiyoob Anas

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


Y/N
Y/N
Y/N

• Identifying opportunities for improved


performance?
• Agreeing actions?

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 Mohamed Aiyoob Anas / COL00079253

Unit Title

Assignment Number Assessor

Date Received 1st


submission
Submission Date

Date Received 2nd


submission

Re-submission Date

Assessor Feedback:

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

Pass, Merit & Distinction Descripts P1


M1
D1

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

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.

Student’s Signature: Date:


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

Student Name /ID Number

Unit Number and Title Unit 01: Programming

Academic Year 2021/22

Unit Tutor
Assignment Title Design &Implement a GUI based system using a suitable
Integrated Development Environment

Issue Date

Submission Date

IV Name & Date

Submission Format
This submission will have 3 components
1. Written Report
This submission is in the form of an individual written report. This should be written in a concise, formal
business style using single spacing and font size 12. You are required to make use of headings, paragraphs
and subsections as appropriate, and all work must be supported with research and referenced using the
Harvard referencing system. Please also provide a bibliography using the Harvard referencing system. (The
recommended word count is 1,500–2,000 words for the report excluding annexures)

2. Implemented System (Software)


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

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

Unit Learning Outcomes:

LO1. Define basic algorithms to carry out an operation and outline the process of
programming an application.
LO2. Explain the characteristics of procedural, object-orientated and event-driven
programming, conduct an analysis of a suitable Integrated Development
Environment (IDE).

LO3. Implement basic algorithms in code using an IDE.

LO4. Determine the debugging process and explain the importance of a coding
standard
Assignment Brief and Guidance:
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.
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 Explain 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). you also need to 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.

Ayubo Drive is the transport arm of Ayubo Leisure (Pvt) Ltd, an emerging travel & tour
company in Sri Lanka. It owns a fleet of vehicles ranging from cars, SUVs to vans.

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

Vehicle rent and hire options are described below.


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

Total rent = weekly Rent x 1 + dailyRent x 3 + daily Driver Cost x 10

2. Hire (with driver only) – These are based on packages such as airport drop, airport pickup,
100km per day package, 200km per day package etc. Standard rates are defined for a
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

Function 1: Rent calculation.


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

Function 2: Day tour - hire calculation.


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

Function 3: Long tour - hire calculation.


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

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

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

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

Grading Criteria Achieved Feedback


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

P1Provide a definition of what an algorithm is and outline the


process in building an application.

M1Determine the steps taken from writing code to execution.


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

LO2 Explain the characteristics of procedural,


objectorientated and event-driven programming,
conduct an analysis of a suitable Integrated
Development Environment (IDE)
P2Give explanations of what procedural, objectorientated,
and eventdriven paradigms are; their characteristics and the
relationship between them.

M2 Compare and contrast the procedural, object


orientated and event driven paradigms used in given
source code of an application

D2Critically evaluate the source code of an application which


implements the programming paradigms, in terms of the code
structure and characteristics.

LO3Implement basic algorithms in code using an


IDE.
P3Write a program that implements an algorithm using an
IDE.

M3Use the IDE to manage the development process of the


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

P4Explain the debugging process and explain the debugging


facilities available in the IDE.
P5Outline the coding standard you have used in your code.

M4Evaluate how the debugging process can be used to help


develop more secure, robust applications.
D4 Critically evaluate why a coding standard is necessary in
a team as well as for the individual.
Acknowledgement

I would like to express my deepest appreciation to all those who provided me


the possibility to complete this assignment. A special gratitude to my lecturer
Mr. Tharaka whose contribution in simulating suggestions and encouragement,
helped me to complete the programming assignment.

And, I would like to express my gratitude to all my batch mates who guided me
and taught me a great deal about this module.
Contents

Activity 01................................................................................................................................21

What is an algorithm............................................................................................................21
Algorithms to display the Fibonacci series and the factorial value......................................22

Fibonacci series................................................................................................................22
Factorial value..................................................................................................................23

Write the Python program code for the above two algorithms and critically evaluate their
efficiencies using Big-O notation.........................................................................................24
Python code for Fibonacci series......................................................................................24
Python code for factorial value........................................................................................25

Examining what Big-O notation is and explaining its role in evaluating efficiencies of
algorithms.............................................................................................................................26

What is Big-O notation.....................................................................................................26

Best-case, worst-case and average-case analysis.................................................................27


Determine the steps taken from writing code to execution..................................................29

Program............................................................................................................................29
Dry run.................................................................................................................................31

Dry run for Fibonacci series.............................................................................................31


Dry run for Factorial values.............................................................................................31

Activity 02................................................................................................................................32

Programming Paradigm........................................................................................................32
The main characteristics of Procedural, Object oriented and Event-driven paradigms.......33
The relationships among Procedural, Object oriented and Event driven paradigms...........40
Snippets of code as example for Procedural, Object oriented and Event-driven
programming paradigms using a suitable programming language(s)..................................41

Here is a simple code for procedural programming paradigms using python..................41


Simple code for Object oriented programming paradigms using c#................................42
simple code for Event-driven programming paradigms using c#....................................43

Critically evaluating the code samples given above in relation to their structure and the
unique characteristics...........................................................................................................44

Critically evaluating the snippets of code given as example for Procedural programming
..........................................................................................................................................44
Critically evaluating the snippets of code given as example for Object oriented............44
Critically evaluating the snippets of code given as example for Event-driven................45

Activity 03................................................................................................................................46

Suitable algorithms for vehicle tariff calculation for rents and hires...................................46
Function 1: Rent calculation.............................................................................................46
Function 2: Day tour - Hire calculation............................................................................47
Function 3: Long tour - Hire calculation..........................................................................48

Evidence of using visual studio IDE (using C#.net) to Implement the above algorithms and
the design of suitable database structure to store the tariffs for vehicle types and different
packages...............................................................................................................................49
Visual studio IDE (C#.net) Implementation of the above algorithms..................................53
Integrated Development Environment (IDE).......................................................................65
Visual Studio IDE................................................................................................................68
Using Visual Studios IDE vs not using an IDE...................................................................71
Examples on how using Visual studio IDE was better compared to not using an IDE.......72

Example 01.......................................................................................................................72
Example 02.......................................................................................................................72
Example 03.......................................................................................................................73

Activity 04................................................................................................................................74
Designing and building a small system to calculate vehicle hire amounts and record them
in a database for customer billing and management reporting for Ayubo drive..................74
The debugging process and the features available in Visual studio IDE for debugging....100
Using the debugging process to develop more secure, robust application.........................102
Coding standards................................................................................................................105
The coding standards That I have used in my application development............................108
Critically evaluating why a coding standard is necessary for the team as well as for the
individual............................................................................................................................110

Conclusion..............................................................................................................................111
Activity 01

What is an algorithm
An algorithm is defined as a step-by-step procedure for successfully completing a task.
Algorithms can be written in a variety of languages, including English, Japanese, and others.
Algorithms have been precisely specified using a suitable math formalism. It is based on
completing a series of predefined activities. It is frequently used for data processing,
computation, and other computer and mathematical tasks. Using algorithms, we can develop
functions in computer programming (Anon., n.d.).
Those functions can be used as mini programs that a larger program can reference.

An example for algorithm to calculate its average and display the result.

Begin
Input a, b, c, d, e
Total = a+b+c+d+e
Average = total/5
Print average
End

An algorithm is representing or show an algorithm is representing or show by flow chart and


pseudo code.

Characteristics of a good algorithms


Not every written programming instruction is an algorithm. It must have the following
characteristics in order for some instructions to be an algorithm (Anon., n.d.).

 • The algorithm should be very clear. Each of its steps must be clear in every aspect
and lead to only one meaning.
 If an algorithm says to take inputs, it should be inputs that are well defined.
 • The algorithm must clearly define what output will be generated and must be well
defined.
 An Algorithm should have 0 or more inputs
 An Algorithm should have 1 or more outputs

Algorithms to display the Fibonacci series and the factorial value


Fibonacci series

Start
Step 01 – define function named fibona (n)
Step 02 – inside step 01 do the following if statement
Step 03 – start if statement where n == 0, return the value 0
Step 04 – in elif n == 1, return the value 1
Step 05 – in elif n == 2, return the value 1
Step 06 – if it not in the above, put else statement to return (fibona (n -1) + (n - 2))
Step 07 – End if
Step 08 – declare variable x
Step 09 – ask user to input a value for x
Step 10 – assign the value of x to n in fibona(n) and print it
End
Factorial value

Start
Step 01 – define a function named facto (n)
Step 02 – start if function
Step 03 – if the value of n == 0, then return 0
Step 04 - if the value of n == 1, then return 1
Step 05 – in else statement, return facto (n - 1) * n
Step 06 – end if
Step 07 – declare variable x, and ask user to input an int value for x
Step 08 – assign the value of x to the function above and print the answer
End
Write the Python program code for the above two algorithms and critically evaluate
their efficiencies using Big-O notation.

Python code for Fibonacci series

Input

Output
Python code for factorial value

Input
Output
Examining what Big-O notation is and explaining its role in evaluating efficiencies of
algorithms

What is Big-O notation

This is a way to describe the time taken (“time complexity”) and the memory (“space
complexity”) used by an algorithm. The Big-O notation can express the “best”, “worst”,
and “average-case” running time of an algorithm. Big-O mainly focusses on the “Upper
bound” also known as the “worst-case”. The “running time” in Big-O notation does not
refer to the normal time as we know, but the no of steps taken to complete a problem.
“Big-O notation is a way to track how quickly the runtime grows relative to the size of
the input” (Jamieson, 2022).

Efficiencies of algorithm
Algorithms are divided into efficiency classes based on big-o notation.

Algorithm class Algorithm Relationship Big-O


between T and N notation
Class A Hashing Tα1 O (1)
Class B Binary search T α n log2 n O (n log2 n)
Class C Leaner search Tαn O (n)
Class D Quick sort T α n log2 n O (n log2 n)
Class E Bubble sort T α n2 O (n2)

Best-case, worst-case and average-case analysis

Tree types of analysis used in big-o notation

Best-case: looking at most favorable situation and check the efficiency of the algorithm.

Worst-case: looking at most adverse situation and analyze the efficiency of the algorithm.

Average-case: this will be the average of best-case and worst-case scenarios.

Linear search
In linear search, to find a specific item in a data set (n), it starts from the beginning of a data
set and observes each item until a match is made. The number of steps/ running time that will
take to loop through n is directly related to the size of n. Linear search is simple but not
efficient. For example, if the item that is being searched is the last item in a set of 1,000
items, then the linear search would look for it in 999 items before 1,000 items before getting
the output. The advantage of linear search is that it would work on any data set (ordered or
unordered) (Jamieson, 2022).
Bubble sort

0this is simpler than linear search and binary search. It orders the
numbers in ascending order. For example, if we have a set of numbers that are
not ordered, bubble sort compares the first two numbers and if the first number is
greater than the second, then it swaps positions where the smaller number comes
to the first position. Then it moves to the second position a compare it with the
third number, if it is larger than the third it swaps place where the second becomes smaller
than the third. This process keeps on happening till there is
nothing to compare and all the numbers are in ascending order (Jamieson, 2022)

Binary search
this is considered to be more efficient compared to linear search.
In binary search, the list or set of data must be ordered. Binary search works by
halving the search range each try. For example, say you want to search for a
number in a set of ordered numbers (n), binary search first searches in from the
middle of the number (halves the set of numbers) (n/2), and compares the
number in the first half and second half. Say the number is less than the middle
number, then the number has to be in the first half and ignores the second half.
So, the search is halved again (it starts to compare at the mid-point of the first
half) (n/4). This keeps on going until the said number is found.
This is more efficient since if the number 25 has to be found in a set of 100
numbers, linear search would require 25 steps while binary search would only
require 2 steps (Jamieson, 2022).

Determine the steps taken from writing code to execution.

Program
A program is set of step-by-step instructions that guide the computer to perform the tasks you
want it to do and to produce the results you want.

The most important steps in write and executing a computer program would be like this

1. Defining the problem


2. Planning the solution
3. Coding the program
4. Testing the program
5. Documenting the program

(Anon., n.d.)

Defining the problem


At the beginning of the process, the problem needs to be identified, because it needs to be
clearly understood. If the problem is clearly defined, the programmers are able work towards
a goal. To identify the problem, the user and system requirements are defined in order to
provide the exact solution to the problem (Anon., n.d.).

Planning the solution


In the next step, the program needs to be designed. In order for the programmers to get a
better understanding of the concept, the outline of the program should be developed.
Concepts like pseudocodes and flow charts are used to represent the program (Anon., n.d.).

Coding the program


After the program is built, it is time to use a suitable programming language to code the
program. It is the responsibility of the programmer to choose a programming language as
needed. The program is coded using a suitable IDE once the language is selected (Anon.,
n.d.).

Testing the program


The next step is to review the coded program in order to detect any errors in it and to ensure
that it gives us the expected results. Testing is regarded as an essential component in the
creation of a program. Several approaches are used to conduct aa test according to the case.

Documenting the program


From the very beginning, the documentation should be ongoing because it is needed for those
who are complicated with program now and future. And also the program is finalized the user
documentation for commercial use to an operator. The documentation for the individuals who
run the computer system and the programmer documentation charged with maintenance.
Dry run

Dry run for Fibonacci series

Step Value of x x-1 x-2 Fibona (x-1) + Fibona (x-2) Output


1 0 0
2 1 1
3 2 1
4 3 2 1 1+0 2
5 10 9 8 34+21 55
6 12 11 10 89+55 144
Dry run for Factorial values

Step Input (x) Output


1 4 24
2 5 120
3 6 720
4 7 5040
5 8 40320
6 9 362880
7 10 3628800
Activity 02

Programming Paradigm

Paradigms are problem-solving methods. A programming paradigm is a method for solving


problems using a programming language. When a programming language is implemented, it
follows some methodology or strategy. A paradigm is the strategy or methodology employed.
There are two kinds of paradigms: Imperative paradigms and Declarative paradigms (Anon.,
n.d.).
The main characteristics of Procedural, Object oriented and Event-driven paradigms
The main characteristics of Procedural paradigms

The procedural programming paradigm is a programming method that allows for the division
of functionalities into a number of events. A large program is broken down into smaller, more
manageable parts called procedures or functions. Functions are given precedence over data. A
program in a procedural programming language consists primarily of a sequence of
instructions that instructs the computer to do something, such as reading user inputs,
performing necessary calculations, and displaying output.
Local and global data are used in procedural programming. Data contained within the
function is referred to as local data, while data not contained within any function is referred
to as global data. Local data are only accessible to the function where they are declared. As a
result, each function can access both local and global data (Anon., n.d.).

Characteristics of Procedural Programming


 • A large program can be divided into manageable chunks called procedures or
functions. This reduces code duplication, which improves code readability and
maintainability.
 • Data can be shared between functions via global variables. Because functions are
completely isolated, we must declare data in the upper scope in order to share it.
 Top-down methodology is used in procedural programming. So the workflow is from
top to bottom. (Anon., n.d.)

Advantages of procedural programming

 Coding is easy and simple.


 The same codes can be reused in different parts of the program.
 Programming paradigm take less memory on the computer
 The programming paradigm is best for to learning and implementing general
programming

Disadvantages of procedural programming

 It is focused on functions and not data.


 It is hard to find what belongs to global data in a large program.
 When maintaining and enhancing, the use of global data is an obstacle.
 To modify global data, functions used by it also have to be modified.
 As functions are action oriented, the procedural programming paradigm does not

model real-world problems well


The main characteristics of Object-oriented paradigms.

Object-Oriented programming (OOP) is a programming paradigm that connects data


structures with a set of data-working operators. An object is a specific instance of such an
entity. In other words, OOP is an implementation technique in which programs are made up
of objects. Each of these objects represents a class instance. Classes are all members of a
hierarchy of classes that are linked together by the concept of inheritance. (Anon., n.d.)

Examples of OOP languages are C++, C#, Java, JavaScript, Visual Basic.NET and
Python.

All OOP languages include mechanisms that aid in the implementation of the object-
oriented model.
Encapsulation, inheritance, polymorphism, and reusability are some of them.
an example for OOP using C#

a simple C++ class


class Rectangle {
int width, height;
public:
void Rectangle (int x, int y) {
width = x;
height = y;
}

Classes and Objects

We can use templates called classes to create objects. Each object contains data and
methods for accessing and manipulating data. A class defines the data and functionalities
that each object contains.
A class consists of a header and a body. The header contains attributes, modifiers, and the
class keyword, whereas the body contains the class members, which are the data members
and member functions.
A class declaration is made up of a class header and a class body. Attributes, modifiers, and
the class keyword are all included in the class header. The class body contains the class's
members, which are the data members and member functions. A class declaration has the
following syntax:
Attributes accessibility modifiers class identifier: baselist {body}
Attributes provide additional context to a class, like adjectives; for example, the
Serializable attribute. Accessibility is the visibility of the class. The default accessibility
of a class is internal. Private is the default accessibility of class members. The following
table lists the accessibility keywords (Anon., n.d.)

public - Public class is visible in the current and referencing assembly


private - Visible inside current class.
protected - Visible inside current and derived class
Internal - Visible inside containing assembly
Internal protected - Visible inside containing assembly and
descendent of the current class.
Encapsulation

Encapsulation is a mechanism that combines the data that it manipulates and codes. It
protects them from outside interference and misuse. In OOP, code and data can be
combined to form a self-contained box. When data and code are combined in this manner,
an object is created, and encapsulation is present.
To their object, code, data, or both can be private or public. A private piece of code or data
can only be accessed by another part of the same object; it cannot be accessed by a program
running outside of the object. However, when a code or data is made public, other parts of a
program outside of its object can access it (Anon., n.d.).

Inheritance

Inheritance is a process by which an object gains the properties of other objects.


There is a base class and a derived class in inheritance. The derived class derives from the
base class and has the ability to override inherited members as well as add new members to
extend the base class. A base type represents the generalization, whereas a derived type
represents an instance specification (Anon., n.d.).

Polymorphism
Polymorphism treats various objects in the same way. This is an advantage of inheritance.
Based on the derived type of the base reference, we can determine the correct call at
runtime. This is known as late binding (Anon., n.d.).

Reusability

Reusability refers to the ability of a class that has been written, created, and debugged to be
given to other programmers for use in their own program. This is referred to as a component
or a DLL in.NET terminology. In OOP, inheritance extends this concept (Reusability) by
allowing a programmer to use an existing class and add new features to it without
modifying it.

Advantages of OOP

 Eliminating redundant code using various techniques like inheritance and


templates.

 Data encapsulation: this allows programmers to hide parts of the code or restrict

access to data in parts of a program which makes the program more secure.

 Reduce code duplication

Disadvantages
 object-oriented program requires more time during compilation and for dynamic

and runtime support it requires more resource and processing time therefore
Compiler and runtime overhead is high.

 It is difficult to trace and debug messages passing between many objects in a

complex application.

 This requires programmers to be mastered in software engineering and


programming methodologies.

The main characteristics of Event-driven paradigms

The execution of a program in event-driven programming is determined by user events such


as mouse clicks, keypresses, message passing from other programs, and so on. Programmers
use event-driven programming in graphical user interfaces (GUIs) and applications that
perform actions based on user inputs. The main loop in an event-driven application listens
for events and calls a callback function when one is detected.
Programming languages that use Event-driven paradigms are Java, c++, c#, etc.

Characteristics Of Event-driven Programming

Service-Oriented - Event-driven programming creates programs for services that do not


slow the computer.
Time-Driven – Codes can be written to perform a predefined activity within a specified
time frame.
Trigger Functions – Coding functions determine which code to execute based on the
occurrence of an event.
Events – These are the ones who decide which code to execute based on user interaction,
such as mouse clicks.
The relationships among Procedural, Object oriented and Event driven paradigms.

Procedural programming is an imperative programming technique in which a larger


program is divided into smaller parts that are simpler and easier to work with. In other
words, procedural programming is when a computer is given a set of instructions step by
step and on how to perform them from one code to another.
Object oriented programming represents the entire world as objects. An object contains
information about the modelled object's state and behavior. A state refers to the
characteristics or words that can be used to describe an object, whereas behavior refers to
the things or actions that an object can perform. Encapsulation, inheritance, polymorphism,
and reusability are key features of an object-oriented program. (Note: these key
characteristics are discussed in 2.1.2.2.) Object-oriented paradigms' main characteristics).
Unlike procedural programming, object-oriented programs use classes rather than
procedures. Object-oriented programming investigates and overcomes the difficulties of
procedural programming. Procedural programming is good for simple code because it
makes it easier and faster to implement, but as the codes become more complex, procedural
programming becomes difficult to use, whereas object-oriented programming is good for
complex programming.
Event driven programming allows programs to function based on user actions such as
mouse clicks. This paradigm is primarily used to create graphical user interfaces (GUIs).
When the user clicks on
So, in conclusion, the three paradigms mentioned above are not strictly related, but are
mostly used together to create a complex program
Snippets of code as example for Procedural, Object oriented and Event-driven
programming paradigms using a suitable programming language(s)

Here is a simple code for procedural programming paradigms using python

Input
Output
Simple code for Object oriented programming paradigms using c#

Input

Output
Enter 1st number; 5
Enter 2nd number; 15
Enter 3rd number; 25
Average of three number is 15
simple code for Event-driven programming paradigms using c#
Critically evaluating the code samples given above in relation to their structure and the
unique characteristics

Critically evaluating the snippets of code given as example for Procedural programming

A problem is divided into smaller manageable parts in procedural programming.


The example code finds the sum of three numbers entered by the user. The first step is to
collect three user inputs (x, y, and z), then find the sum of all three numbers, and finally find
the average by dividing the sum by three. The average, sum, and numbers entered by the
user are then outputs.
As you can see, the problem is to find the average of three numbers. To get the required
output, the code is divided into four sections, as shown above.

Critically evaluating the snippets of code given as example for Object oriented

As shown in the code, I created an instance called 'averageNumbers' to calculate the average
of three numbers. Within this instance, I've written code to compute the sum of the three
numbers and the average by dividing it by three. The user is then prompted for three
variables inside Main, where the codes are executed. Then I use the instance
'averageNumbers' with the three inputs to calculate the average. In object-oriented
programming, we can create objects as described above and call them as needed (rather than
rewriting the entire code).
Critically evaluating the snippets of code given as example for Event-driven

As previously stated, event-driven programming executes a program in response to a user


event such as a mouse click. if the user enters the correct username and password and
"Invalid username or password" if the username or password is incorrect. The user must
enter the username and password, then click login (mouse click and keyboard inputs) for
this code to work.
Activity 03

Suitable algorithms for vehicle tariff calculation for rents and hires

Function 1: Rent calculation.

Begin
function getRentTotal(string vehicleID, int days, bool driver)
input: dailyRent, weeklyRent, monthlyRent, driverRent
process: noOfMonths = days/30
process: noOfWeeks = (days% 30)/7
process: noOfDays = (days % 30) % 7
process: if (driver == false) then
process: driverRent = 0
process: endif
process: totalRent = (noOfMonths * monthlyRent) + (noOfWeeks * weeklyRent) +
(noOfDays * dailyRent) + (days*driverRent)
output: totalRent, (noOfMonths * monthlyRent) , (noOfWeeks * weeklyRent) ,
(noOfDays * dailyRent) , (days*driverRent)
End
Function 2: Day tour - Hire calculation.

Begin
function getDayHire(string vehicleID, string packageName, int hours, int km)
input: baseCharge, waitingCharge, extrakmRate, maxHours, maxKm
process: if (hours > maxHours) then
process: extraHours = hours - maxHours
process: endif
process: if (km > maxKm) then
process: extraKm = km - maxKm
process: endif
process: totalCharge = baseCharge + (waitingCharge * extraHours) +
(extrakmRate * extrakm)
output: totalCharge, baseCharge, (waitingCharge * extraHours),
(extrakmRate * extrakm)
End
Function 3: Long tour - Hire calculation.

Begin
function getLongHire(string vehicleID, string packageName, int days, int km)
input: baseCharge, extrakmRate, driverOvernightRate, nightParkingRate, maxKm
process: if (days >= 2) then
process: extraDays = days - 2
process: endif
process: totalDriverOvernightCharge = driverOvernightRate * extraDays
process: totalNightParkingCharge = nightParkingRate * extraDays
process: if (km > (days * maxKm)) then
process: extraKm = km - (days * maxKm)
process: endif
process: totalExtraKmCharge = extraKm * extraKmRate
process: totalCharge = (baseCharge * days) + totalExtraKmCharge +
totalDriverOvernightCharge + totalNightParkingCharge
output: totalCharge, totalBaseCharge, totalExtraKmCharge,
totalDriverOvernightCharge, totalNightParkingCharge
End
Evidence of using visual studio IDE (using C#.net) to Implement the above algorithms
and the design of suitable database structure to store the tariffs for vehicle types and
different packages

1/ Rent Table
2/ Day Tour Hire Service

3/ Hire Table
4/ Long Tour Hire Service

5/ Package Table
6/ Rent Service Table
7/ Vehicle Table
Visual studio IDE (C#.net) Implementation of the above algorithms

1/ Rent calculations using Visual Studio


Rent calculation visual studio (object calculate class) code
public int[] getRentTotal(string vehicleID, int days, bool driver)
{
int[] values = new int[5];

SqlConnection con = new SqlConnection();


con.ConnectionString = @"Data Source=AIYOOB;Initial Catalog=AyuboDrive;Integrated Security=True";

con.Open();

SqlCommand cmd = new SqlCommand();


cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from Rent_Table where Vehicle_ID ='" + vehicleID + "'";

SqlDataReader sdr = cmd.ExecuteReader();

int weeklyRent = 0;
int dailyRent = 0;
int monthlyRent = 0;
int driverRent = 0;

while (sdr.Read())
{
weeklyRent = Convert.ToInt32(sdr["Weekly_Rent"]);
dailyRent = Convert.ToInt32(sdr["Daily_Rent"]);
monthlyRent = Convert.ToInt32(sdr["Monthly_Rent"]);
driverRent = Convert.ToInt32(sdr["Driver_Rent"]);
}

int noOfMonths = days / 30;


int noOfWeeks = (days % 30) / 7;
int noOfDays = (days % 30) % 7;

if (driver == false)
{
driverRent = 0;
}

int totalRent = (noOfMonths * monthlyRent) + (noOfWeeks * weeklyRent) + (noOfDays * dailyRent) + (days


* driverRent);

values[0] = noOfDays * dailyRent;


values[1] = noOfWeeks * weeklyRent;
values[2] = noOfMonths * monthlyRent;
values[3] = days * driverRent;
values[4] = totalRent;

con.Close();
return values;}
accessing the rent calculation property using calculate button in rent form

private void bunifuFlatButton2_Click(object sender, EventArgs e)


{
string vehicleID = comboBox1.Text;
int days = (dateTimePicker2.Value - dateTimePicker1.Value).Days;
bool driver = false;

if (checkBoxDriver.Checked == true)
{
driver = true;
}

Calculate cal = new Calculate();


int[] value = cal.getRentTotal(vehicleID, days, driver);

labelTotal.Text = value[4].ToString();
label6.Text = value[0].ToString();
label8.Text = value[2].ToString();
label7.Text = value[1].ToString();
label9.Text = value[3].ToString();
}
2/ Day tour – Hire calculations using Visual Studio
Day tour hire visual studio (object calculate class) code

public int[] getDayHire(string vehicleNo, string packageName, int hours, int km)
{
int[] values = new int[5];
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source=AIYOOB;Initial Catalog=AyuboDrive;Integrated Security=True";
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from [Hire Table] where Vehicle_No = '" + vehicleNo + "' and Package_Name
= '" + packageName + "'";
SqlDataReader sdr = cmd.ExecuteReader();
int baseCharge = 0;
int waitingCharge = 0;
int extraKmRate = 0;
int maxHours = 0;
int maxKm = 0;
while (sdr.Read())
{
baseCharge = Convert.ToInt32(sdr["Base_Charge"]);
waitingCharge = Convert.ToInt32(sdr["Waiting_Charge"]);
extraKmRate = Convert.ToInt32(sdr["Extra_km_rate"]);
maxHours = Convert.ToInt32(sdr["Max_no_of_hours"]);
maxKm = Convert.ToInt32(sdr["Max_km_limit"]);
}
int extraHours = 0;
if (hours > maxHours)
{
extraHours = hours - maxHours;
}
int extraKm = 0;
if (km > maxKm)
{
extraKm = km - maxKm;
}
int totalCharge = baseCharge + (waitingCharge * extraHours) + (extraKmRate * extraKm);
values[0] = totalCharge;
values[1] = baseCharge;
values[2] = waitingCharge * extraHours;
values[3] = extraKmRate * extraKm;
return values;
}

accessing the day toutr hire calculation property using calculate button in day tour form
private void bunifuFlatButton2_Click(object sender, EventArgs e)
{
string vehicleNo = daytourvehicleno.Text;
string packageName = daytourpkgtype.Text;

int hours = (daytourEndTime.Value.Hour - daytourStartTime.Value.Hour);


int km = int.Parse(daytourEndKm.Text) - int.Parse(daytourStartkm.Text);

Calculate cal = new Calculate();


int[] value = cal.getDayHire(vehicleNo, packageName, hours, km);

daytourTotalAmount.Text = value[0].ToString();
daytourExtraKM.Text = value[3].ToString();
dayTourWaitingCharge.Text = value[2].ToString();
daytourBaseHire.Text = value[1].ToString();
}
3/ Long tour – Hire calculations using Visual Studio
Long tour hire visual studio (object calculate class) code

public int[] getLongHire(string vehicleNo, string packageName, int days, int km)
{
int[] values = new int[5];

SqlConnection con = new SqlConnection();


con.ConnectionString = @"Data Source=AIYOOB;Initial Catalog=AyuboDrive;Integrated Security=True";
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from [Hire Table] where Vehicle_No ='" + vehicleNo + "' and Package_Name
='" + packageName + "'";
SqlDataReader sdr = cmd.ExecuteReader();
int baseCharge = 0;
int extraKmRate = 0;
int driverOvernightRate = 0;
int nightParkingRate = 0;
int maxKm = 0;
while (sdr.Read())
{
baseCharge = Convert.ToInt32(sdr["Base_Charge"]);
extraKmRate = Convert.ToInt32(sdr["Extra_km_rate"]);
driverOvernightRate = Convert.ToInt32(sdr["Driver_Overnight_Rate"]);
nightParkingRate = Convert.ToInt32(sdr["Night_Parking_Rate"]);
maxKm = Convert.ToInt32(sdr["Max_km_limit"]);
}
int extraDays = 0;
int extraKm = 0;
if (days >= 2)
{
extraDays = days - 2;
}
int totalDriverOvernightCharge = driverOvernightRate * extraDays;
int totalNightParkingCharge = nightParkingRate * extraDays;
if (km > (days * maxKm))
{
extraKm = km - (days * maxKm);
}
int totalExtraKmCharge = extraKm * extraKmRate;
int totalCharge = (baseCharge * days) + totalExtraKmCharge + totalDriverOvernightCharge +
totalNightParkingCharge;
values[0] = totalCharge;
values[1] = baseCharge * days;
values[2] = totalExtraKmCharge;
values[3] = totalDriverOvernightCharge;
values[4] = totalNightParkingCharge;
return values;
}
accessing the long toutr hire calculation property using calculate button in long tour form
private void bunifuFlatButton2_Click(object sender, EventArgs e)
{
string longVehicleName = longtourvehicleno.Text;
string longPackageName = longtourpkgtype.Text;

int longDays = (longtourEndDate.Value - longtourStartDate.Value).Days;


int longKm = int.Parse(longtourEndKM.Text) - int.Parse(longtourStartKm.Text);

Calculate cal = new Calculate();


int[] value = cal.getLongHire(longVehicleName, longPackageName, longDays, longKm);

longtourTotalAmount.Text = value[0].ToString();
longtourBaseCharge.Text = value[1].ToString();
longtourOverNightCharge.Text = value[3].ToString();
longtourExtraKM.Text = value[2].ToString();
}
Integrated Development Environment (IDE)

Definition 01- An integrated development environment (IDE) is a software package that


contains all of the tools required by programmers to design and test software. An IDE
typically includes a code editor, a compiler or interpreter, and a debugger, all of which are
accessed by the developer via a single graphical user interface (GUI). An IDE can be used
independently or as part of a suite of related programs.
An integrated development environment's toolbar is similar to that of a word processor. The
toolbar's capabilities facilitate color coding, source code formatting, fault diagnostics,
reporting, and intelligent code completion. The interface allows the developer to compile and
execute code incrementally while also managing source code changes in a consistent manner.
IDEs frequently integrate third-party version control libraries, such as GitHub or Apache
Subversion.
For IDEs, software-as-a-service (SaaS) distribution models are becoming increasingly
popular. Cloud IDEs provide access to software development tools from anywhere on the
planet, on any compatible device, with minimal to no download and installation, and ease of
collaboration among geographically dispersed developers. Popular integrated development
environments include NetBeans, Eclipse, IntelliJ, Visual Studio, and Windows PowerShell.

Definition 02- An integrated development environment (IDE) allows programmers to write


code, organize text groups, and automate programming redundancies. IDEs, as opposed to
traditional coed editors, combine the functionality of multiple programming processes into
one. As code editors, IDEs enable the addition of frameworks and element libraries to extend
base-level code. The main advantage of IDEs is that they have built-in debuggers that allow a
programmer to easily identify bugs or errors that are detected when they are activated. It also
allows multiple programmers to create hierarchies and assign grouped codes. The groups can
then be strung together, compiled, and built. (Anon., n.d.)

Features of IDEs

 Text editor - Any IDE will include text editors that allow you to write and
manipulate code. Some IDEs include tools for dragging and dropping front-end
components.
 Debugger - This feature enables programmers to easily identify and fix errors and
bugs in code. It also enables them to test various parts of the application in order to
identify and correct errors.
 Compiler - These convert programming language to machine language. To ensure
accuracy, machine codes are examined. Compilers can parse and optimize code in
order to improve performance.
 Code completion - This feature assists programmers in completing code by
identifying and inserting common code components. This saves time and reduces
bugs when writing code.
 Programming language support - Programmers can select a programming
language using IDEs. They provide IDE tools for many programming languages,
including Ruby, Python, and Java.
 Integrations and plugins - An IDE is a development portal that integrates all of
your other development tools in order to improve workflows and productivity.
 Auto-completion- This is intended to improve coding efficiency. As you enter the
first part of the code, it recommends or completes the function, along with any
parameters or variables.
 Syntax Checks- This detects inappropriate syntax usage and shows any errors.
 Bracket matching- This is for languages that utilize bracket pairs to separate code
blocks. It enables faster reading and comprehension of the code. Colored sections
may assist you in detecting missing brackets if you fail to close one while writing.

(Anon., n.d.)
How these features in an Integrated Development Environment (IDE) help in
application development

 It serves as a single environment for most of the needs of a developer such as version
control systems, debugging tools, and Platform-as-a-Service.
 Code completion capabilities can improve workflow of programming.
 It automatically checks for errors and bugs to ensure top quality code
 Refactoring capabilities help programmers to make comprehensive and mistakefree
name changes.
 Maintain a smooth development cycle.
 Increase developer efficiency and satisfaction
 Deliver top-quality software on schedule
Some of the best overall IDE in 2018 are, according to https://www.g2.com/articles/ide

 IntelliJ IDEA
 Visual Studio
 Eclipse
 RStudio
 WebStorm
 PhpStorm
 PyCharm
 NetBeans
 Xcode
 Visual LANSA
Visual Studio IDE

Visual Studio is the Integrated Development Environment (IDE) in which developers work
when creating programs for the.NET Framework in one of many languages, including C#. It
is used to develop console and graphical user interface (GUI) applications, as well as
Windows Forms or WPF (Windows Presentation Foundation) applications, web applications,
and web services in both native and managed code for all platforms supported by Microsoft
Windows, Windows Mobile, Windows CE,.NET Framework,.NET Compact Framework, and
Microsoft Silverlight.

It provides a set of tools to help you write and modify code for your programs, as well as
detect and correct errors. Visual Studio supports a variety of programming languages through
language services, which allow the code editor and debugger to support nearly any
programming language as long as a language-specific service is available. It includes a code
editor, just like any other IDE, that supports syntax highlighting and code completion with
IntelliSense for not only variables, functions, and methods, but also language constructs like
loops and queries.
Microsoft Visual Studio is a powerful integrated development environment (IDE) that
ensures quality code throughout the application lifecycle, from design to deployment. Some
windows are used to write code, others to design interfaces, and still others to get a general
overview of the files or classes in your application. Microsoft Visual Studio comes with a
slew of visual designers to help with the creation of various types of applications. Windows
Forms Designer, WPF (Windows Presentation Foundation) Designer, Web development,
Class designer, Data designer, and Mapping designer are among the tools available.
(Anon., n.d.)
C# is intended for the development of a wide range of applications that run on the.NET
Framework. Before you begin learning more about C# programming, you should first
understand the development environment and recognize some of the most commonly
used programming tools in the Visual Studio IDE.

1. Menu Bar
2. Standard Toolbar
3. ToolBox
4. Forms Designer
5. Output Window
6. Solution Explorer
7. Properties Window
Some other features available in The Visual Studio IDE.

 Squiggles and Quick Actions - Underlines with squiggles are wavy. They alert you
to code errors or problems. They enable programmers to find and correct errors
without having to run the program. When you hover your mouse over the Squiggle,
you will see information about the error. A light bulb may appear in the left margin
with Quick Actions to correct the error.
 Code Cleanup - Cleaning up the code Format your code and make any changes
recommended by your code style settings, editorconfig conventions, and Roslyn
analyzers. (Please keep in mind that this feature is currently only available for C#
code.)
 features available in The Visual Studio IDE.

– This includes operations such as intelligent variable renaming, extracting one or more
lines of code into a new method, rearranging method parameters, and more.
 IntelliSense - This is a term that refers to features that display information about your
code directly in the editor and, in some cases, write small bits of code for you.
 Visual Studio search – This feature allows to rapidly find IDE features and code in
one place.
 Live Share – This feature allows you to instantly and securely share your project.
 Call Hierarchy – This window displays the methods that call the method you've
chosen. It's useful information if you want to change or remove a method, or if you're
looking for a bug.
 Go To Definition – This feature takes you directly to the location where a function or
type is defined.

Using Visual Studios IDE vs not using an IDE.


Visual Studios IDE Not using an IDE
This enables programmers to access This allows to write, edit codes only.,
databases or automatically write code to which doesn’t save time.
create a graphical user interface (GUI), as
well as suggested ways to complete code
strings, which saves a significant amount of
time.
When developing large development Difficult to develop complex projects.
projects, Visual Studio's IDE features such as
debugging, code completion, and so on aid in
completing them more quickly than standard
text editors.
Because of the available shortcuts, you don't Text editors (non-IDEs) so not have these
need to use the mouse in Visual Studio's IDE, features.
which was designed to eliminate things that
cause pauses in your workflow.
When using languages like Java, IDEs are When using languages like PHP and Ruby,
much more effective. text editors are programmers choice.
Requires more space and memory Requires less memory and space
Because of the available features, it is best to Best to practice codes and requires more
develop error-free and secure time compared to IDEs
programs/projects in less time.
Examples on how using Visual studio IDE was better compared to not using an IDE.

Example 01

The code completion feature helped a lot to save time typing variable already declared
and calling names of tools to code.

Example 02

Tool box makes drag and drop much easier to build the GUI
Example 03

Most errors are shown by a red line and once you hover on top of it, it shows the reason
for error as well which makes it much easier to find errors and debug before running the
program.
Activity 04

Designing and building a small system to calculate vehicle hire amounts and record
them in a database for customer billing and management reporting for Ayubo drive

1/ Login Page
Code of login

Above picture shows password and user credential in login form


Above picture shows exit button code in login form
2/ Main Menu
Code of main menu
Above picture shows navigation code in main menu to navigate one to another form
3/ Rent Service
Code of rent service
Calculate button code in rent form
Insert button code in rent form
Update button code in rent form
Delete button code in rent form
4/ Day Tour Hire
Code of day tour hire
Calculate button code in day tour hire form
Insert button code in day tour hire form

Update button code in day tour hire form


Delete button code in day tour hire form
5/ Long Tour Hire
Code of long tour hire
Calculate buyyon in long tour hire form
Insert button code in long tour hire form

Update button code in long tour hire form


Delete button code in long tour hire form
6/ Rent Information
Code of rent information
Insert code in rent info form
Update code in rent info form
Delete code in rent info form
7/ Hire Information
Code of hire information
Insert code in hire info form
Update code in hire info

Delete code in hire info form


8/ Vehicle Information
Code of vehicle information
Insert code in vehicle info
Update code in vehicle info form

Delete code in vehicle info


The debugging process and the features available in Visual studio IDE for debugging

The debugging process

Debugging is the process of identifying and fixing/removing existing and potential


errors/bugs in software code that can cause it to behave unexpectedly or crash.
Debugging aids in the prevention of software flaws by identifying and correcting problems.

The debugging procedure consists of two steps: "fault localization" and "fault repair/bug
fixing." A programmer may duplicate a problem in software code to find the error and the
cause, and then modify or delete the code to prevent it from happening again. The first and
second steps are both time consuming and difficult. The first step is more important because
in order to fix an error, the problem must first be identified.
The steps in a debugging process, according to the website "The Economic Times," are as
follows:

 “Reproduce the problem.”


 “Describe the bug. Try to get as much input from the user to get the exact reason.”
 “Capture the program snapshot when the bug appears. Try to get all the variable
values and states of the program at that time”
 “Analyze the snapshot based on the state and action. Based on that try to find the
cause of the bug.”
 “Fix the existing bug, but also check that any new bug does not occur”
Features available in Visual studios IDE to debug.

There are several types of debugging, including "stepping through code with a debugger,"
"investigating logs," "unit testing," "profiling," and "analyzing dumps."
Visual studio focuses on "interactive debugging," which is defined as "attaching a debugger
to a running process and investigating the program's execution and state."

Here are some debugging features available in Visual Studio.

 Attaching the debugger: Once you press F5 or “select Debug | Start Debugging”,
debugging will automatically run in Visual studios.
 Debugger Break Mode: For debugging, the debugged process must be in “Break
Mode”. This means the program can be paused for a said line of code, and all the
running threads are paused after a line of code. To get breaker mode, use “Debug
| Break All menu item” or place break points. To place breaker points, press F9,
or “Debug | Toggle Breakpoint”. Once a break point is set, the program will stop
at that point and start break mode

 Investigate variables: When In break mode you can see the values of variables and
class members. Hovering over the variable lets you this via a pop-up, this is called
“Data tip”
 Breakpoint advanced features: There are lesser-know features of breakpoint. To see
the context menu for it, you can right click a break. A few examples are given bellow,

Conditions allows you to break on this breakpoint only when a condition is met.
Actions allow you to log a message to the output window whenever the breakpoint is
hit. You can continue execution, without stopping on the breakpoint. Edit labels…
allows to categorize breakpoints into labels. This makes it easier later to organize
them in the breakpoints tool window.
Using the debugging process to develop more secure, robust application

Thanks to the features in Visual studios, it was easy to debug the application and make the
application a bug free secure application. As mentioned above, in the debugging process, the
most crucial part is “fault localization”. Using the “select Debug | Start Debugging”, I was
able to start debugging while running the application and find the errors in my application
and fix them.
Here are a few instances as such,

Case 1
On the picture shown above, the variable ‘daytourBaseHird’ has not been initialized, which
the debugger showed instantly. I was able to save time and avoid bugs by identifying the
error.

Case 2
In this case, the variable type for Rent ID in the database was int and in the enterd data
was varchar. I had to enter the data in the text box as int to fix the error after
identifying it
and error show up in this display just because I used try catch statement here

Case 3

In here I forgot to enter (.Text) after the comboBox1 thanks for visual studio debugging
process its shows a red line near combobox I was able to avoid the error when the red line
showed and was able to fix it. These are some of the many instances that I used the
debugging process to debug the application to develop more secure, robust application.
Coding standards

Coding standards are used by good software developers and development organizations to
maintain a well-defined and standard style of coding. Coding standards are developed by
organizations/programmers based on their needs, what best suits their organization, and the
type of software developed. It is critical to maintain coding standards because if they are not
followed, the code may be rejected during code review in the organization.

Purpose of Having Coding Standards;

 Coding standard gives an uniform appearance to the codes written by different


programmers.
 It reduces complexity and improves readability, and maintainability of the code.
 It helps in code reuse and helps to detect error easily.
 It increases efficiency of the programmers
Some common coding standards
Limited use of global – This is about which types of data that can be declared
global and the data that can’t be.
Standard headers for different modules – To understand and maintain the code in
a better way, the header of different modules should follow some standard format
and information. The header format must contain below things that is being used
in various companies,
Name of the module
Date of module creation
Author of the module
Modification history
Synopsis of the module about what the module does Different functions supported in the
module along with their input

Naming conventions for local variables, global variables, constants and functions–
Names of variable should be meaningful and understandable as they help anyone to
understand the reason of using it. There are naming convections for local variable global
variables, constants and functions used by many programmers and organizations. Some of
them are,

“Avoiding the use of digits in variable names”


“Names of function should be written in camel case starting with
small letters”.
Indentation – To increase the code readability, proper indentation must be
followed. Some spacing/ indentation convections are,
A space must be left after giving a comma between two function arguments.
Each nested block should be properly indented and spaced Proper Indentation should be there
at the beginning and at the end of each block in the program.
All braces should start from a new line and the code following the end of braces also start
from a new line

Coding style – A code should understandable. If the code is too complex, debugging is
difficult. Using coding styles that is too difficult to understand must be avoided.

Do not using an identifier for multiple purposes - Descriptive and meaningful names
should be given for each variable that give the reason behind the name. If the same variable
name is used multiple times, it can lead to confusion and it would be difficult to debug.

Document codes – The codes should be properly documented in a way that is easy to
understand. Comments regarding the statements increase the understandability of the code.
The coding standards That I have used in my application development

Standards 1

Naming conventions – The naming convections I have used in coding are,

For tools, I have named them in a way that it shows the page it belongs to as well
as the type of tool it is and every word has a capital letter in the first letter (eg.
Base_Charge)
Standards 2

Indentation – I have followed proper indentations and use of bracts for if else statements
and others to increase code readability and understandability.
Critically evaluating why a coding standard is necessary for the team as well as for the
individual

Advantages using of Coding standards.

 They increase the efficiency of the software and reduces the development time.
 They help in identification of errors in an early stage.
 They increase readability and understandability of a code while reducing the
complexity of the code.
 It reduces the hidden cost for developing the software.
When creating programs, it is necessary to consider time, cost, debugging, and future
updates. Having specific standards when coding aids in meeting those criteria. As
previously stated, coding standards improve efficiency and reduce software development
time while also assisting us in identifying errors at an early stage. These standards also
make the code more readable and understandable, especially for future developers who may
do updates or debug errors that were not discovered initially. Making it easier to read,
understand, and debug reduces costs, which benefits the company, group, or individual. As
previously stated, having certain coding standards can help save time, money, and make
debugging easier.
Conclusion

I now end this assignment by completing all of the theoretical sections on Activity One and
giving all appropriate proofs for each and every piece of information acquired from various
sources.
The practical portion is then handled in relation to the scenario supplied by the institution,
and all steps are taken in relation to the grading rubrics as well to finish this project in a
meaningful manner.
Bibliography

Anon., n.d. bham. [Online]


Available at: https://www.cs.bham.ac.uk/~rxb/java/intro/2programming.html
[Accessed 10 5 2022].
Anon., n.d. career ride. [Online]
Available at: https://www.careerride.com/oops-characteristics.aspx
[Accessed 10 5 2022].
Anon., n.d. fsu. [Online]
Available at: https://www.cs.fsu.edu/~myers/c++/notes/classes.html
[Accessed 10 5 2022].
Anon., n.d. indicative. [Online]
Available at: https://www.indicative.com/resource/programming-paradigm/#:~:text=A
%20programming%20paradigm%20is%20the,of%20using%20a%20paradigm%20differs.
[Accessed 10 05 2022].
Anon., n.d. knowlage boat. [Online]
Available at: https://www.knowledgeboat.com/question/what-are-the-characteristics-of-
procedural-programming--28311496451138200
[Accessed 10 05 2022].
Anon., n.d. microsoft. [Online]
Available at: https://docs.microsoft.com/en-us/visualstudio/get-started/visual-studio-ide?
view=vs-2022
[Accessed 11 5 2022].
Anon., n.d. programiz. [Online]
Available at: https://www.programiz.com/dsa/algorithm#:~:text=In%20computer
%20programming%20terms%2C%20an,and%20produces%20a%20desired%20output.
Anon., n.d. RedHat. [Online]
Available at: https://www.redhat.com/en/topics/middleware/what-is-ide
[Accessed 11 05 2022].
Anon., n.d. stackify. [Online]
Available at: https://stackify.com/oop-concept-polymorphism/#:~:text=Polymorphism%20is
%20one%20of%20the,types%20through%20the%20same%20interface.
[Accessed 10 5 2022].
Anon., n.d. sumo logic. [Online]
Available at: https://www.sumologic.com/glossary/encapsulation/
[Accessed 10 5 2022].
Anon., n.d. tech target. [Online]
Available at: https://www.techtarget.com/searchsoftwarequality/definition/integrated-
development-environment#:~:text=Common%20features%20of%20integrated
%20development,code%20in%20the%20code%20editor.
[Accessed 11 5 2022].
Anon., n.d. wikipedia. [Online]
Available at: https://en.wikipedia.org/wiki/Inheritance
[Accessed 10 5 2022].
Jamieson, A., 2022. Towards Data Science. [Online]
Available at: https://towardsdatascience.com/introduction-to-big-o-notation-820d2e25d3fd
[Accessed 10 05 2022].

You might also like