Assignment Programing
Assignment Programing
Assignment Programing
Contents
Task 1/ P1...................................................................................................................................................3
Provide a definition of what an algorithm is and outline the process in Building an application.....3
Introduction:..........................................................................................................................................3
Algorithm...............................................................................................................................................3
Features of Algorithm...........................................................................................................................3
Examples of Algorithm........................................................................................................................3
Algorithm for project of JP Motors.....................................................................................................4
References..............................................................................................................................................6
Task 4/P2....................................................................................................................................................7
Give explanations of what procedural, object oriented and event driven paradigms are; their
characteristics and the relationship between them.................................................................................7
Introduction...........................................................................................................................................7
Procedural programming:....................................................................................................................7
Characteristics and principle of Procedural Programming...................................................................7
Features of procedural programming...................................................................................................9
Object oriented programming..............................................................................................................9
Principles of OOP................................................................................................................................9
Characteristics of OOP......................................................................................................................10
2 Constructor................................................................................................................................10
3 Inheritance.................................................................................................................................10
4 Polymorphism............................................................................................................................11
Features of Object-oriented Programming.........................................................................................12
Event-Driven Programming...............................................................................................................12
Characteristics and features of Event Driven Programming..............................................................12
Relationship between procedural, object and event driven programming.....................................14
Presentation.........................................................................................................................................14
Conclusion............................................................................................................................................18
References:...........................................................................................................................................19
Task 10/ P4...............................................................................................................................................21
Explain the debugging process and explain the debugging facilities available in the IDE.................21
Introduction.........................................................................................................................................21
Debugging process...............................................................................................................................21
BIKASH DHAKAL 1
Programming | JP Motor Vehicle Booking System
BIKASH DHAKAL 2
Programming | JP Motor Vehicle Booking System
Task 1/ P1
Introduction:
In this task, I am going to discuss about algorithm definition, example, application and
designation of algorithm on basis of scenario. In scenario we are suggested for JP Motor which is
situated at Hakim Chowk, Bharatpur.
Algorithm
An algorithm is a procedure for fixing mathematical difficulties in a finite variety of steps that
often involves repetition of an operation; widely: a step-by -step system for fixing a problem or
engaging in some cease mainly by means of a computer. A computer program can be viewed as
an elaborate algorithm. In mathematics and computer science, an algorithm usually means a
small procedure that solves a recurrent problem. It is fundamental unit of computer
programming. (Merriam-webster.com, 2018)
Features of Algorithm
The steps of an algorithm should be easily defined as easy to study.
Every step in an algorithm has its own logical sequence so it is easy to debug.
Each step should be well defined and should have meaning to it.
It should stop or terminate after a certain amount of time.
An algorithm should accept all input and should have at least one output.
(Tutorialink.com, 2018)
Examples of Algorithm
Following are some examples of algorithm
BIKASH DHAKAL 3
Programming | JP Motor Vehicle Booking System
Step 1: Start
Step 3: Use the formula l*b and store result in a variable AREA
Step 5: Stop
Step 1: Start
Step 4: Print F
Step 5: Stop
If (Role==” Admin”)
BIKASH DHAKAL 4
Programming | JP Motor Vehicle Booking System
Detect MenuStripClick;
If (fields! = blank)
Else
If (fields! = blank)
Else
Conclusion
So, in this task we have to describe what an algorithm with its advantages and disadvantages and
as well as the process of making an application with series of steps. At last, we also have to show
an algorithm of JP motor.
References
Merriam-webster.com. (2018). Definition of ALGORITHM. [online] Available at:
https://www.merriam-webster.com/dictionary/algorithm [Accessed 1 May 2018].
BIKASH DHAKAL 6
Programming | JP Motor Vehicle Booking System
Task 4/P2
Give explanations of what procedural, object oriented and event driven paradigms are;
their characteristics and the relationship between them.
Introduction
According to scenario, on this task I am going to explain about the principles, characteristics and
features of procedural programming with well explained examples: Basic I/O, Conditional,
Control Structures, Arrays, Array list, List, Structure and Unions, Functions, File Handling and
the principles, characteristics and features of object oriented programming with well explained
examples: Data Encapsulation, Inheritance ,Polymorphism, Data Abstraction, the principles,
characteristics and features of event driven programming with well explained examples: Abstract
Class, Interface, Generics, Delegates, Events and also the relationships among procedural, object
oriented programming and event driven programming. (Techopedia.com, 2018)
Procedural programming:
The programming paradigm which uses linear or top down approach is known as procedural
programming. The procedural programming is based on techniques to perform computations. In
procedural programming programs are defined as the organization of reusable code. This takes
place when any software starts with a trouble after which decompose into smaller problems or
sub-strategies. Those sub-problem continuously breaks down inside the technique known as
useful decomposition until and except the sub-troubles are small and easy sufficient to be solved.
Language like FORTRAN, ALGOL, BASIC, C, etc. are procedural programming language.
Examples:
4. Array List: Array List is a process of storing the elements by the use of dynamic array
which is a sequence of Objects.
5. Function: A function is a collection of statements that together carry out a task. Every c
application has at least one characteristic, which is main (), and all of the maximum
trivial applications can outline extra functions. (www.tutorialspoint.com, 2018)
6. Union: A union is a unique data type to be had in c that allows to keep extraordinary
records kinds within the equal memory region. You could define a union with many
members, however best one member can include a value at any given time. unions offer
an efficient way of the usage of the identical reminiscence vicinity for more than one-
purpose.
BIKASH DHAKAL 8
Programming | JP Motor Vehicle Booking System
7. File handling: file handling concept in c++ language is used for sore a data permanently
in computer. The usage of file handling with we will keep our data in hard disk.
(Sitesbay.com, 2018)
operate on that data into a single unit. That single unit is known as an object. The function
associated with that object is accessed only by the data of an object. Moreover, function of one
Principles of OOP
Data is emphasis over procedure
Number of object is divided for a program
The object is characterized i.e. data structure are designed
In data structure, functions operating data of an object are tied with each other
BIKASH DHAKAL 9
Programming | JP Motor Vehicle Booking System
Characteristics of OOP
1 Data encapsulation
Encapsulation is an Object Oriented Programming concept that binds together the data and
functions that manipulate the data, and that keeps both safe from outside interference and misuse.
Data encapsulation led to the important OOP concept of data hiding. the properties of
encapsulation and data hiding through the creation of user-defined types, called classes. class can
contain private, protected and public members. By default, all items defined in a class are
private. (SearchNetworking, 2018)
2 Constructor
Whenever a class or struct is created, its constructor is called. A class or struct may have
multiple constructors that take different arguments. Constructors enable the programmer to set
default values, limit instantiation, and write code that is flexible and easy to read.
If you do not provide a constructor for your object, C# will create one by default that instantiates
the object and sets member variables to the default values as listed in Default Values Table
3 Inheritance
The ability to create a new class from another base class is known as inheritance. It extends
functionality and state of parent’s base class to its derived class as well as allows to overload
methods from base class.
BIKASH DHAKAL 10
Programming | JP Motor Vehicle Booking System
a) Single inheritance: If only one class is derived from its base class, then this type of
inheritance is known as single class.
b) Multi-level inheritance: If class is derived from another derived class, then this type of
inheritance is multilevel inheritance.
c) Multiple inheritance: If one class is derived from more than one base class, this type of
inheritance is known as multiple inheritance.
d) Hierarchical inheritance: If more than one class is derived from a signal base class, this
type of inheritance is known as hierarchical inheritance.
e) Hybrid inheritance: Any type of combination of multi-level inheritances, hierarchical and
single inheritance is hybrid inheritance. (www.tutorialspoint.com, 2018)
4 Polymorphism
Polymorphism is the ability of an object to take on many forms. The most common use of
polymorphism in OOP occurs when a parent class reference is used to refer to a child class
object.
Type of polymorphism:
Compile time polymorphism means we will declare methods with same name but different
signatures because of this we will perform different tasks with same method name. This compile
time polymorphism also called as early binding or method overloading.
Run time polymorphism also called as late binding or method overriding or dynamic
polymorphism. Run time polymorphism or method overriding means same method names with
same signatures. IN this run time polymorphism or method overriding we can override a method
in base class by creating similar function in derived class this can be achieved by using
inheritance principle and using “virtual & override” keywords.
BIKASH DHAKAL 11
Programming | JP Motor Vehicle Booking System
Event-Driven Programming
Event driven programming does the programming by running the series of subroutines triggered
by event happening to object. The programming approach within which events decide the flow
of program execution is known as event driven programming. An event-driven net application
detects events as they occur and so decision acceptable event-handling procedures to come up
with the results desired by the user.
Most of the nowadays programs and software is based on Event-driven programming. The
functions like pressing the icon, clicking the mouse, etc. is all based on Event-driven
programming. So, we can say that this programming paradigm uses GUI (Graphical User
Interface).
1. Event: It is action or task which occurs in system. For example, mouse, keyboard etc.
2. Event Handlers: It helps to run the codes that matches the event.
3. Event loop: It helps to check if the event is completed or still running. If the event is still
running the program continues to run else it stops.
BIKASH DHAKAL 12
Programming | JP Motor Vehicle Booking System
4. Trigger functions: The function which helps to match the event is known as Trigger. The
main task of trigger is to get event handler started.
5. Simplicity of Programming: It is depending on events rather than code, it is easy to do
coding as programmer can concentrate on event handlers, breaking down the
development process.
6. Suitability for GUI: It is created taking event which are shown and triggered by GUI
elements like button clicks so it is easy to follow the command.
7. Flexibility: The event driven programming language can be easily modified with ease
8. Time driven: Event driven programming are the codes that runs at a set of time. They are
driven by time rather than commands.
9. Ease of Development: To develop an event driven is easier because the programs are
broken into event handlers for each event so it is easy to write and understand.
(M1404585, M1404585 and profile, 2018)
Abstract class: An abstract class is a generic class used as a foundation for creating
specific objects that comply with its protocol, or the set of operations it helps. Abstract
training is beneficial while growing hierarchies of training that model truth due to the fact
they make it possible to specify an invariant level of functionality in some techniques but
depart the implementation of different methods till a particular implementation of that
class is needed. (Techopedia.com, 2018)
Interface: It is a physical and logical arrangement of the computer system to which user
interact for the purpose of achieving specific goals. It is more friendly or easy to
communicate with the computer.
Generics: The feature in C# which allows defining a class or method with type as a
parameter is known as generics. It enables development of universal classes and methods
that help in improving performance, productivity and type-safety. (Techopedia.com,
2018)
Delegates: Delegates in the Object Orient Programming is a process of evaluating a
member of an object in the context of another.
Event: Events is a special Occurrence which has an important role for maintaining
hardware and Software of a Computer.
BIKASH DHAKAL 13
Programming | JP Motor Vehicle Booking System
Procedural paradigm is the method needed to remedy a problem. I do a, then I do b, after which I
do c. There’s a particular technique and the glide of the data is exceedingly predictable.
Object oriented is like at the actors and creating items to represent those actors. For example, an
emulator for a movie line queue.
Event driven, is used to spontaneous moments that want to be looked after. We may upload event
handlers to both procedural and object oriented paradigms. So, as a stand by myself, it’s not a
complete paradigm. As an instance your procedural document creator could have an occasion to
address out of paper. Or the object oriented program may want to have an event to handle when
lightning hits a person standing line for the film. So, these programming are related to each
other.
Presentation
Here, I inserted the presentation slide of given topic.
BIKASH DHAKAL 14
Programming | JP Motor Vehicle Booking System
BIKASH DHAKAL 15
Programming | JP Motor Vehicle Booking System
BIKASH DHAKAL 16
Programming | JP Motor Vehicle Booking System
BIKASH DHAKAL 17
Programming | JP Motor Vehicle Booking System
Conclusion
In conclusion, I have described and put evidences and details about procedural programming,
object oriented programming and event driven programming describing their features, principles,
BIKASH DHAKAL 18
Programming | JP Motor Vehicle Booking System
characters and presentation on given topic in this task. Above details give the clear idea about all
those paradigm and comparison between them is also done.
References:
Techopedia.com. (2018). What is Procedural Programming? - Definition from Techopedia.
[online] Available at: https://www.techopedia.com/definition/21481/procedural-programming
[Accessed 3 May 2018].
Bradstock, D., Curtis, H., Gao, M., Janmohamed, Z., Liu, C., McArthur, F. and Yip, P. (2018).
Conditional Statements | DB2 SQL Procedural Language: Using Flow of Control Statements |
InformIT. [online] Informit.com. Available at: http://www.informit.com/articles/article.aspx?
p=31963&seqNum=3 [Accessed 3 May 2018].
Tutorialspoint.com. (2018). C - Control Statements, if, elseif, while, do, for loop. [online]
Available at: http://www.tutorialspoint.com/ansi_c/c_control_statements.htm [Accessed 3 May
2018].
Techopedia.com. (2018). What are Generics in C#? - Definition from Techopedia. [online]
Available at: https://www.techopedia.com/definition/25616/generics-c-sharp [Accessed 5 May
2018].
M1404585, N., M1404585, N. and profile, V. (2018). Key Features of Event Driven Programs..
[online] Nathancockerillprogramming.blogspot.com. Available at:
BIKASH DHAKAL 19
Programming | JP Motor Vehicle Booking System
http://nathancockerillprogramming.blogspot.com/2014/11/key-features-of-event-driven-
programs.html [Accessed 6 May 2018].
BIKASH DHAKAL 20
Programming | JP Motor Vehicle Booking System
Task 10/ P4
Explain the debugging process and explain the debugging facilities available in the IDE.
Introduction
This task is all about explaining about debugging process and some debugging facilities that is
available in IDE like breakpoints, tracer etc.
Debugging is the recurring process of finding and getting rid of computer program bug, mistakes
or abnormalities, which is methodically treated by means of software programmers via
debugging gear. debugging checks, detects and corrects errors or bugs to permit software
operation. Debugging is also called debug. (Techopedia.com, 2018)
The process of analyzing the program or app and identifying the problems, error, bugs and after
finding the problem solving them by either correcting the code or them or solving with new way
is known as debugging. Errors and bugs are mistakes that is caused or made during the
implementation of code while creating the program may cause the programs to crash or behave
unexpectedly. Debugging is used to prevent these types of errors and incorrect information, so
debugging is used to resolve these problems.
Debugging process
The way of debugging the program is also known as debugging process. The overall process in
which we identify the problems and errors and fix them is called debugging process. There are
many ways to explain debugging process.
1. Understand the System: Understanding the System is difficult in the beginning. So,
How System works and what are its functions and limitations can only be known when
you are used to with it.
2. Track the problem: In this step first, we need to do is to track the problem in this
process we first check that the program gets processed or not. If there is problem during
the process then we can identify the problem as the program goes through many stages
so, it helps us to track where the problem is.
BIKASH DHAKAL 21
Programming | JP Motor Vehicle Booking System
3. Quit think and Look: To do a task and to think about it is a quite different thing. In the
same way during the process of programming we should use simple syntax that we are
thinking to know its result. Also, we should look at the whole program so that we can
find the debug or fault easily rather than thinking which time is consuming and less
productive.
4. Make it Fail: This is the process which is linked with the above process. Implementing
all the above process I have described helps us to debug a problem and solve it which
ultimately helps us to do a program in less time and accurately.
5. Correct the defect: The last step of the process is to correct all the problems and defect
in program and implementing the new corrected program. (The Economic Times, 2018)
1. Break point:
Break point is the process of intentional stopping the code of an application where execution
pauses for debugging. The breakpoint helps to speed up the debugging process in a large
program. In this debugging process we can skip directly to the desired next breakpoint by
skipping each line in a program which is less time consuming. To define a breakpoint in your
source code, right-click in the left margin in the Java editor and select Toggle Breakpoint.
Alternatively, you can double-click on this position”. The red line that appears on the code is the
visual representation of breakpoint. Breakpoint helps us to find the faults and correct it in short
amount of time. (Csharp.net-tutorials.com, 2018)
2. Call Stack
It is a set of process that are run from beginning to the end of the program execution for a
specific statement. The main use of the call track is for tracking the program from beginning to
its execution so that we can return to the problem and can solve easily. It helps to display the
name of each function and programming language that is written in program. The main
procedural name may be written and accompanied by optional information such as module name,
values, parameter etc. the optional values can be turned off or on in a program. (Techopedia.com,
2018)
BIKASH DHAKAL 22
Programming | JP Motor Vehicle Booking System
3. Tracer
The conditional breakpoint that allows the programmer to create the conditional breakpoint to
printout the message without halting at a breakpoint and cluttering the code base is known as
tracer.
Conclusion
In every program error and bugs are occurred and we need to solve them all to successfully run
the program. To solve all the problem debugging is necessary. We can debug the problem using
different debugging tools. In this task I described about debugging process used in project of JP
motors.
References
Techopedia.com. (2018). What is a Call Stack? - Definition from Techopedia. [online] Available
at: https://www.techopedia.com/definition/25586/call-stack-c [Accessed 8 May 2018].
BIKASH DHAKAL 23
Programming | JP Motor Vehicle Booking System
Task 12 [P5]
Introduction
In this task, I have to describe about the Coding as well as steps which I have used in making my
project JP motors. Also, I have to present a documentation on how it outlines the coding standard
/ architecture in my project.
The reasons for using consistent set of coding conventions is to standardize the structure and
coding style of an application or a software so that user and other users can read and understand
it easily. Good coding conventions consist of readable, unambiguous source code. The main
reason behind using coding standard is to make a programmer easy to understand and write a
program and also to standardized the coding style as well as quality of an application or a
software.
It improves the readability of the software, allowing engineers to understand new code
more quickly and thoroughly.
We can change, copy and maintain code in a program.
The good convention helps the programmer to maintain program for further use.
Many of these conventions are actually required for cross-compiler compatibility.
We cannot make complex system without Coding Standard.
(Docs.unrealengine.com, 2018)
Coding Standard
In making of my project on JP motors I have used different types of coding standard. Some of
coding standards are as follows:
1) Naming Conventions
BIKASH DHAKAL 24
Programming | JP Motor Vehicle Booking System
Naming conventions are general guidelines implemented when developing textual content scripts
for software programming. They have many kinds of purposes, such as adding readability and
uniformity to scripts, readability for third party applications, and capability in positive languages
and applications. They variety from capitalization and punctuation to adding symbols and
identifiers to indicate certain functions. (Techopedia.com, 2018)
2) Layout Convention:
Layout convention is one of the coding standards. The Standard layout helps us to read code
easily because it emphasizes the structure of our code by formatting. In this standard we can only
write and declare statement in a line
The meaning of Line length convention is to avoid the lines that contains more than 80
characters in it. This causes the difficulty in reading of codes as it is longer so code should be
short so that it can be easily understand.
4) Indentation
It is a process in which we write a text in such a way that It helps to separate it from the
surrounding text. Paragraph alignment against left margin is an example of Indentation. “There
should be Four spaces used as the unit of indentation. The exact construction of the indentation is
unspecified we can use both spaces and tabs. Tabs must be set exactly after every 8 spaces not
four spaces.”
(TutorialsPoint, 2018)
5) Package Naming
The package name is always uniquely written in all lowercase letters and should be or have one
of the top level domain names like edu, com, org, net etc. The package names are always written
in lowercase letters to avoid conflict of classes or interfaces. Reversed internet domain is used by
the companies to create their package name. com.package.my package is the example which is
used by the programmer to make their package.
BIKASH DHAKAL 25
Programming | JP Motor Vehicle Booking System
6) File Naming
File naming is a framework standard which is use for naming our created files, what are the
things that are contained in files and how it is related with the other files in the Projects.
conclusion
Code convention is very important part of programming. If we do not follow the coding standard
and do not maintain the coding convention the programming becomes all complicated and it will
be hard to understand by the other programmer. Coding standard gives the guideline for all the
programmer. If programming is done by maintaining coding standard then it will be easy to read
and understand by the other programmer also. I have written the importance of coding
convention and which coding convention is used in my JP motors project. I have also written the
importance of coding standard.
References
Docs.unrealengine.com. (2018). Coding Standard. [online] Available at:
https://docs.unrealengine.com/en-us/Programming/Development/CodingStandard [Accessed 8
May 2018].
BIKASH DHAKAL 26