Final Programming 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 84

Programming

ISMT College

Anjir Gurung (HND / First Semester)


ISMT College
Programming ISMT
College

Table of Contents
Task 1/P1 ...............................................................................................................................................
5

Provide a definition of what an algorithm is and outline the process in building an application. .........
5

Introduction ............................................................................................................................................
5

Features of Algorithm ............................................................................................................................


5

Limitation of Algorithm .........................................................................................................................


5

Examples of Algorithm ..........................................................................................................................


5

Choice of Tools ......................................................................................................................................


6

IDE- Visual Studio .................................................................................................................................


6

Server side Programming Language: ASP.Net, c#, Visual Basic ..........................................................


6

Client side programming language: HTML, CSS, JavaScript ...............................................................


6

Database Management System: MS SQL Server 2014 .........................................................................


6

Server: MS SQL 2014 ............................................................................................................................


6

Platform: Desktop Application ..............................................................................................................


7

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Design of the layout for Cheque Management System(CMS) ..............................................................


7

Data Dictionary ......................................................................................................................................


9

Algorithm and Flowchart for Cheque Management System(CMS) ....................................................


11

Outline Process ....................................................................................................................................


12

1. Requirement Analysis...................................................................................................................
12

2. System Design ..............................................................................................................................


12

3. Implementation .............................................................................................................................
12

4. Testing ..........................................................................................................................................
12

5. Deployment ..................................................................................................................................
13

6. Maintenance ..................................................................................................................................

13

Conclusion .......................................................................................................................................

.... 13

Task4/P2 ..............................................................................................................................................
14
Introduction ..........................................................................................................................................1
4

Procedural Programming .....................................................................................................................


14

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Examples of Procedural Programming ................................................................................................


15

Example ...............................................................................................................................................
15

Program ................................................................................................................................................
16

Output ..................................................................................................................................................
16

Syntax ..................................................................................................................................................

16

Output ..................................................................................................................................................

17

Syntax ..................................................................................................................................................

18

Example ...............................................................................................................................................
18

Program ................................................................................................................................................
19

Output ..................................................................................................................................................
19

Syntax ..................................................................................................................................................
20

Program ................................................................................................................................................
20

Output ..................................................................................................................................................

20

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Syntax ..................................................................................................................................................

21

Program ................................................................................................................................................
21

Output ..................................................................................................................................................
22

Object Oriented Programming .............................................................................................................


22

Program ................................................................................................................................................
23

Output ..................................................................................................................................................

24

Syntax ..................................................................................................................................................

24

Program ................................................................................................................................................
25

Output ..................................................................................................................................................
25

Program ................................................................................................................................................
26

Output ..................................................................................................................................................
26
Program ................................................................................................................................................2
7

Output ..................................................................................................................................................
27

Limitation .............................................................................................................................................
27

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Event Driven Programming .................................................................................................................


27

Characteristics and Features ................................................................................................................


28

Syntax ..................................................................................................................................................
28

Program ................................................................................................................................................
29

Output ..................................................................................................................................................
30

Relationship between Procedural Programming, Object Oriented Programming and Event driven
Programming........................................................................................................................................
30

Presentation Slides ...............................................................................................................................


31

Conclusion ...........................................................................................................................................

34

Task7/P3 ..............................................................................................................................................

35

1. Login Form ...................................................................................................................................


35

2. Home Page ....................................................................................................................................


36

3. Bank Entry ....................................................................................................................................


37

4. Cheque Entry ................................................................................................................................


38

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

5. Party Entry ....................................................................................................................................


39

6. User Entry .....................................................................................................................................


40

Conclusion ...........................................................................................................................................

41

Task10/P4 ............................................................................................................................................

42

Introduction ..........................................................................................................................................
42

Debugging Process...............................................................................................................................
43

Debugging facilities .............................................................................................................................


43

Conclusion ...........................................................................................................................................

45

Task12/P5 ............................................................................................................................................

46

Introduction ..........................................................................................................................................4

Creating a new project .........................................................................................................................


46

Conclusion ...........................................................................................................................................
49

Task2/M1 .............................................................................................................................................
50

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Introduction ..........................................................................................................................................
50

Preprocessing .......................................................................................................................................
52

Compilation..........................................................................................................................................
52

Linking .................................................................................................................................................
53

Example ...............................................................................................................................................
54

Implementation of above algorithm in C++ language .........................................................................


54

Conclusion ...........................................................................................................................................

54

Task5/M2 .............................................................................................................................................

55

Introduction ..........................................................................................................................................
55

Features of Visual Studio(IDE) ........................................................................................................... 55

Conclusion ...........................................................................................................................................

59 Task

8/M3 ............................................................................................................................................ 60

Introduction ..........................................................................................................................................
60

Conclusion ...........................................................................................................................................
63

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Task11/M4 ...........................................................................................................................................
64

Introduction ..........................................................................................................................................
64

Debugging Process...............................................................................................................................
64

Use of debugging process to develop more secure and robust application .........................................
66

Conclusion ...........................................................................................................................................
67
Task 1/P1
Provide a definition of what an algorithm is and outline the process in building an application.

Introduction
(Rouse, 2016)An algorithm is a procedure or formula for solving a problem, based on conducting a
sequence of specified actions. As we realize that algorithms are the means by steps route intended to
play out the task, which can be as guide or stream outline, which lead for the outcome accurately.
Algorithm has its own definite starting, ending and has limited number of steps. Algorithm delivers a
similar output in which the user input a similar data. It can be joint to perform complex task, for
example, composing a PC programming and program. In the period of software engineering and
arithmetic, algorithm is known as the technique that figures the present period of annihilating issues
in program. It is used in the field of IT to build up the product and projects.

In this task I am going to explain about algorithm, its features, limitation and some examples. I will
also explain its outline process in building an application.

Features of Algorithm
• The algorithm can get the correct input given by the users.
• The results are depended on input and the result of the preceding steps, so each result is
determined uniquely.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

• Algorithm stop after the limited number of steps are executed.


• Algorithm apply all inputs that re given by the user and can output the given procedures.

Limitation of Algorithm

• Executing and writing algorithm takes quite a while.


• An Algorithm isn't a PC program, it is fairly an idea of how a program ought to be.
• It is hard to put huge task in algorithm.

Examples of Algorithm

1. Determine whether number is odd number or even


number.

Step1: Start

Step2: Declare a.

Step3: Input a.

Step4: if a%2==o

Display a is “even number”

2. Print 1 to 50 Step 1: Start


Step 2: Initialize X as 0
Step 3: Increment X by 1
Step 4: Print X
Step 5: If x is less than 50 then go back to step 2 Step
6: Stop

Choice of Tools
IDE- Visual Studio

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

In the choice of tools, I have used Visual Studio as IDE because Visual Studio enables you to write
code accurately and efficiently without losing the current file context. It is used to develop computer
programs, as well as web sites, web apps, web services and mobile apps.

Server side Programming Language: ASP.Net, c#, Visual Basic


In the server side programing language I have used ASP.Net in this assignment. ASP.NET is an open-
source server-side web application system intended for web advancement to create dynamic site
pages. C# is a basic, modern, universally useful, object-oriented programming language created by
Microsoft inside its .NET. All language focusing on the Microsoft .NET Framework, programs are
written in Visual Basic advantage from security and language interoperability.

Client side programming language: HTML, CSS, JavaScript


Database Management System: MS SQL Server 2014
Database Management system is the software, which allows the people to generate, retrieve and store
data and information in database.

Server: MS SQL 2014


Microsoft SQL Server 2014 is a powerful free data management system, which brings reliable data
for application software and websites. It is the software product which stores and retrieve the data
requested by the applications.

Platform: Desktop Application


Design of the layout for Cheque Management System(CMS)

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Login
Form

Home Page

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Bank Entry

Party Entry

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Cheque
Entry

User
Entry

Data Dictionary
With the contact to the scenario the assignment tells to design the CMS to reduce the Haphazard in
CG Trader in which the cheque transactions are handled properly in time. Now, I have designed some

of the models like Bank Entry, Cheque entry, Party entry and User Entry.  Party Entry

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

 Cheque Entry

 Bank Entry

 User Entry

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Algorithm and Flowchart for Cheque Management System(CMS)


 Flowchart

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

 Algorithm
To insert
Step1: Start
Step2: Input data in the respective fields.
Step3: Click Save
Step4: If Edit mode= false, then run insert query.
Step5: Stop
To update
Step1: Start
Step2: Select the data to be updated
Step3: Click button „Edit‟
Step4: Run the update query
Step5: Stop
To delete
Step1: Start
Step2: Select data to be deleted
Step3: Click button „Delete‟
Step4: Run the delete query Step

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

5: Stop

Outline Process
While making application for assignment, I have used Software Development Life Cycle (SDLC).
(TutorialPoints, 2018)SDLC is a process in which consists of a detailed plan describing how to
develop, maintain, replace and alter or enhance specific software. I have made application with the
help of waterfall model of SDLC. Waterfall model consists of different steps like requirement
analysis, system design, implementation, testing, deployment and maintenance.

1. Requirement Analysis
In this phase, the requirement for the project was collected like the software for coding i.e. Visual
Studio 2013, information regarding cheques and banks. The information regarding the requirement
are documented.

2. System Design
In this phase, the requirements are studied and design is made for the application. Its rough
sketch for the application. This system design helps in specifying hardware and system
requirements and helps in defining the overall system architecture.

3. Implementation
In this phase, the requirements are implemented according to the design. The forms for different
entries are made. After making form, coding was done for forms.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

4. Testing
In this phase, the application was tested whether it satisfies the requirement or not. Application is
checked whether there are bugs or not. If bugs are found while testing, it is solved right there.

5. Deployment
After the completion of testing, application was shown to teachers and friends in this phase.

6. Maintenance
After the distribution of application to the customer, the feedback of the customer are taken in
mind and made changes according to their requests.

Conclusion
In this assignment, I have explained the definition of algorithm and the process to outline in the
building of the application software according to its algorithms and flowcharts.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Task4/P2
Give explanation of what procedural, object oriented and event driven paradigms are; their
characteristics and the relationship between them.

Introduction
In this task I am going to explain about the procedural programming, object-oriented programming,
event driven paradigms and their relationship between each other.

Procedural Programming
Procedural programming is a program, which comprise of different information and modules.
(Anon., n.d.)Procedural programming is a programming paradigm that uses a linear or top-down
approach. It relies on procedures or subroutines to perform computations. It is the route used to show
how the programmer composes a program. It makes the program by stepwise process that guides the
application through directions.

Characteristics

 Focuses for the most part on function, yet not information.


 Problem is partitioned into sub problems i.e. program is separated into a few littler projects
called function.
 Function shares worldwide information.
 No security to information, it moves freely among the functions.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

 Function transforms data from one form to another.


 Takes top-down approach.

Limitations

 As there are such a significant number of procedural languages, a developer has a tendency to
need to be expert in a specific language in order to get work. A COBOL expert has an
alternate demographic to a 'C' specialist.
 Should be exceptionally exact and learned about programming guidelines, thus a completely
repaired working project sets aside greater opportunity to assemble contrasted with fourth
generation language.

 Not as productive as hand-made source code written in a low-level language.

Examples of Procedural Programming


 Basic I/O:
In any programming language input means to provide some data in program where as output
means to display the data in screen, file or printer. C programming language provides a set of built-in
functions to read given input and provide it to the program as per requirement and also provides a set
of built-in functions to output required data. scanf() is the function which can be used to read an input
where as printf() is the most frequently used function for output. printf will generally examine from
left to right of the string. But scanf is total opposite of printf. The input is read, interpret using the
conversion specifier and stores it in the given variable. Syntax printf(“format string”, arg1, arg2,
…); scanf(“format string”, &arg1, &arg2,..);

Example
printf(“Enter a value:”);

scanf(“%f”,&radius); Program

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Output

 Array:
Array is a variable, which can hold and handle more than one value at a specific time. It can
deal with many values and numbers in the single name and can access value by referring
index numbers. At the point when there is each item in an array it is known as components or
elements. Also, it is accessed by numerical file. It is a best practice to initialize an array to
zero or null while declaring, if we don‟t assign any values to array.

Syntax
Type name[size];

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Program

Output

• File Handling:
File handling are frequently utilized excessively to read and compose the information from
text files. File input stream and file output stream classes are not prescribed to utilize on the

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

off chance that you need to read and compose the information data then these are called Byte
stream classes

• Structure:
(Singh, n.d.)Structure is a group of variables of different data types represented by a single
name. For example: we have to store the information of students like student name, age,
address, id and so forth. One method for doing this would make an alternate variable for
each attribute, however when you have to store the information of different students then all
things considered, you would need to make these few factors again for every students. We
can take care of this issue effortlessly by utilizing structure.

Syntax
Struct structure

name{ Datatype

structure_name{ data_type

member1; data_type

member2;

………..

};

Example
struct

person{ char

name[50]; int

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

citNo; float

salary;

};

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Program

Output

 Conditionals:
Conditional are statement which modify the generally direct execution stream of a program
depending upon the result of expression, which test for the presence of a specific
"condition". It performs distinctive calculations or activities relying upon whether a
programmer determined boolean condition assesses to true or false. Conditional statement in
C programming language are if statement, if else statement, nested if else statement, switch
statement and ternary statement.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Syntax if
(testExpression){

// code inside the body of if

Else{

// code inside the body of else

Program
If else statement

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Output

 Control Structure:
Control structure is a block of developers which pick the heading to go in view of parameters
and dissect the factors. Initials parameters and conditions are known as preconditions. It is
the gaze of factors before inflowing the control structure. For example: looping. Loops
provide a way to repeat commands and control how many times they are repeated. C
provides a number of looping way. C provides a number of looping way like while loop, for
loop and do while loop.

Syntax for( expression1; expression2;


expression3)

Single statement or Block of statements;

Program
For loop

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Output

Object Oriented Programming


(Beal, n.d.)Object Oriented Programming (OOP) is a type of computer programming in which
programmers characterize not just the information sort of an information structure, yet in addition the
types of operation that can be connected to the data structure. Object oriented programming is the
style of programming which is connected with the thoughts of class, objects, and a few of other idea
related with this two like encapsulation, inheritance, and polymorphism.

Features

• Focus on information as opposed to technique.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

• Programs are divided into elements known as objects.


• Data Structures are composed to portray objects
• Functions that work on data of an object are tied together in data structures

• Data is covered up and can't be accessed by outer or external function.


• Objects communicate with each other through function.
• New data and function can be added whenever it is needed.
• Follows base up configuration in program plan.

Characteristics

The Objects Oriented programming language supports all of the components of ordinary
programming language. Likewise, it supports some critical ideas and wording which has made it
prominent among programming strategy.

 Encapsulation
In object oriented programming, binding of information and function into a single class type
variable is called encapsulation. The number of member data and member function relies
upon the needs. The protection of the information from direct access by the program is the
way toward hiding figures or data.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Program

Output

 Inheritance
(Rouse, 2005) In object-oriented programming, inheritance is the idea that when a class of
object is characterized, any subclass that is characterized can acquire the meanings of at least
one or more general classes. This implies for the programmer that a object in a subclass
require not convey its own particular meaning of information and methods that are generic to
the class (or classes) of which it is a part. This not just accelerates program improvement; it
additionally guarantees an inherent validity to the characterized subclass object. There are

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

different types of inheritance like single inheritance, multiple inheritance, multilevel


inheritance, hierarchical inheritance and hybrid inheritance.

Syntax
class subclass_name: access_mode base_class_name

//body of subclass

};

Program
Multiple Inheritance

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Output

 Abstraction

Abstraction is an idea which encourages extracting out the basic data of an object. In OOP,
Abstraction Facilitates the simple conceptualization of real world objects into the software
program. It is the best approach to speak to the information in an applied level without any
details.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Program

Output

 Polymorphism
The expression "poly" implies many and "morphs" implies forms. It relates various objects using
a similar technique and plays out the task. In this way, it has brought the element of reusability.
Real life example of polymorphism, a person at a same time can have different characteristic.
Like a man at a same time is a father, a husband, a employee. So same person posses have

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

different behavior in different situations. This is called polymorphism. Function overloading and
operator overloading are the different polymorphism. Program

Output

Limitation
 Object oriented programming are slower than other programming programs because of its
size. Increasingly the size the speed of the projects isn't run rapidly so that program requests
more system so run the system quicker.
 It requires a lot of effort to create object-oriented program which is large in size because
programmer should spend more time in writing code.

Event Driven Programming


(Anon., 2017) Event driven programming is a PC programming worldview in which control stream
of the program is controlled by the occurrence of event. An event driven application is intended to
distinguish events as they happen, and after that arrangement with them utilizing a proper event
handling technique. In principle, all programming languages support the event-driven style of
programming, although some language features, such as closures, make it easier to implement.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Characteristics and Features


 Event Handler
Event handler is a kind of function or strategy that run a particular activity when a particular
event is activated. For example, it could be a button that when user click it, it will show a
message, and it will close the message when user tap it once more, this is an event handler.
 Event Loops
Event loops are the programs which are incorporated with the environment. It continues
testing to distinguish in the case of anything occurs in the program.
 Time driven
Event driven programming, time driven is a paradigm, it's a code that keeps running on a
period trigger, time driven can be a particular code that keeps running on a particular time,
which could be once per hour, once per week or once every month, this implies it's a pre-set
to do task. For example, windows refresh is the case of time driven, which user can set when
to refresh or when to check and download the refresh.
 Forms
Form contains all the different controls which the user permits to interface with the program
in different courses for example buttons, boxes and menus.
 Flexibility
Flexibility, in each protest it has a decent selection of occasions in which the program can
react to. Programmers have control over place code and begin it.

Abstract Class

Abstract class are the class designed to b used as base class. It is a base class which cannot b
instantiated. In other words, you can create object of the class. A pure virtual function can be
declared by using a pure specifier (=0) in the declaration of a virtual member function in the class
declaration.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Syntax

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Program

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Output

Relationship between Procedural Programming, Object Oriented Programming and Event


driven Programming
Differences

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

In Event driven programming it gives graphical user interface to make program, In procedural
Programming it gives character user interface to do orders and in Object-situated programming it
makes action and words in input. One is required for another they are interrelated with each other.
Event driven programming center around choosing user interface where procedural programming
centers around successive execution of steps and on object-oriented programming language it centers
around object or data and encourage to secure it from unapproved access. The most well-known
language which event driven programming takes after are visual Basic and C#. In procedural
programming the normal language used to take after are BASIC, FORTRAN and COBOL. What's
more, in Object-oriented programming it takes after the Prolog language. In this manner, they are
related with each other. Programming paradigm is another strategy for characterization of
programming language. Illustrations like (BASIC, COBAL, ADA) are the example of procedural
programming, (JAVA, C++) are the Object-situated Programming and (VB, C#) are the example of
Event driven Programming.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Presentation Slides

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Conclusion
I want to conclude this task by explaining the feature, limitation and characteristics of procedural
programming, object-oriented programming and event driven programming.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Task7/P3
Write a program that implements an algorithm using an IDE.

In this task I am going to implement algorithms using an IDE which I have discussed in Task1. I have
designed Cheque Management System (CMS) for CG traders to manage the cheques that are
collected. The algorithms are taken as rough sketch for coding. Those algorithms are turned into
coding which are shown below.

1. Login Form
Design

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Code

Output

2. Home Page

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Design

Code

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Output

3. Bank Entry
Desig n

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Code

Output

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

4. Cheque Entry
Desig
n

Code

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Output

5. Party Entry
Design

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Code

Output

6. User Entry

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Design

Code

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Output

Conclusion In conclusion, I have viewed the source code and designed the cheque management
system (CMS) for CG traders for the given scenario.

Task10/P4
Introduction
Debugging is a process of finding and removing existing error or bugs in a software code. Debugging
is a repetitive process of finding and removing errors, bugs to prevent incorrect operation of software
or system. Debugging is used to discovery and determination bugs or defects. When various modules
are coupled tightly debugging becomes harder because while debugging one module it may arise
more bugs in other module. Sometimes it takes more time to debug the program than to code it.

(Rouse, 2016) Debugging, in PC programming, is a multistep procedure that includes recognizing an


problem, disengaging the source of a problem, and afterward either correcting the problem or
deciding an approach to work around it. The last step of troubleshooting is to test the correctness or
workaround and ensure it works. In software development, debugging includes finding and rectifying
code blunders in a computer program. Debugging is a piece of the product testing process and is a
vital piece of the whole programming advancement lifecycle.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Debugging Process
The process of debugging and the steps involved are explained below:

1. Describe the bug


To debug any bugs, identifying the bugs is very important.
Basically, bugs are the errors or mistakes done while coding that
are seen while executing a program. So, to debug any bugs, it is
very important to identify the type of bug which helps in
debugging the bugs in easier way. We cannot continue debugging
unless we know detail information of the bug that occurs.
2. Get the problem
After finding what type of bug it is, then the location of the bug
and effect of bug are seen. To find the location of the bug, we go
through the every line of codes or on the information of bug, it
shows the line number where the error are found.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

3. Analyze the bug and search for the cause


After we found the location and area affected by bugs, bugs are analyzed properly to find the
root cause of the bug. Finding the root cause of the bug helps to debug it in easier way as it
shows how the bug affects the program. The bugs can be analyzed by tracing previous
movements with in the program and also area where we have made recent changes should be
traced and by inputting different data
4. Fix the bug
After identifying, getting as well as analyzing the bugs, it is time to fix it. The possible
solution for solving the error or bugs are found. Then out of all possible solutions, the most
reasonable and best solution is used to fix it.

Debugging facilities
1. Runtime Tracing
It is a feature which enables user to make conditional breakpoints to output the message
without wavering the breakpoints and littering the code base. This tracing software is
extraordinarily utilized as a part of debugging process by programmers, depending upon
detail of data information and type encased in a trace log. When a function is traced, each call
to the function will be displayed to the console with the function's trace identifier and the
values of the operands the function is being applied to. Each nested call is indented slightly,
so as to illustrate the depth of calls. When the function application returns, the value of the
function-call is displayed at the same indentation as the call itself. Once indented to a certain
depth, the same indentation is kept for further nesting, but the depth of the call is displayed as
an integer preceding the call.
2. Break points
Breakpoints is the way, which advises the debuggers to incidentally suspend executions of the
projects in an application code. Breakpoints enables the users to erase and deactivate watch
focuses and breakpoints in code. Programmer create the brake point to stop the program later
the certain quantity of appearances of code in program. To place a break point for To where
you wants to allowed a breakpoint on a definite line of code, the pointer must be placed on
the line of code where you want to debug and then press right click on cursor on click F9.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Example of breakpoint

You can see breakpoint in above figure which shows that it can be easy to find a break point because
it is highlight by red color.

3. Call Stack
A call stack, in C#, is the list of names of methods called at run time from the beginning of a
program until the execution of the current statement (Anon., n.d.). The call stack is a rich
source of information for programming, accessible in debugging mode in different
development environments. A call stack is mainly used to keep track of the point to which
each active subroutine should return control when it finishes executing. Call stack can be
used as debugger tool for debugging the applications when the method to be traced can be
called in more than one context. This forms a better alternative than adding tracing code to all
methods that call the given method. It is also called the machine stack or the execution stack.
You can look at the stack and jump forward and backward into the stack to debug at any point
with the help of stack viewer. Its function is the ways procedures and functions call each
other‟s and to control the way they pass the parameter.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Example of Call Stack

Conclusion
As a conclusion, I have explained about the debugging, debugging process as well as debugging
facilities.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Task12/P5
Outline the coding standard you have used in your code.

Introduction
In this task, I am going to explain about the coding standards that has been used in project “Cheque
Management System”.

Coding is a process of assigning the code to something for specification or identification. Coding
plays the vital role in software or application development. The famous application like twitter,
Facebook, YouTube are nothing without coding, for the complete completion of project, coding plays
the vital role.

Coding standard characterize a programming style. A coding standard does not concern about wrong
or right in a more abstract sense. It is basically an arrangement of guidelines and rules for the
designing of source code. In some cases, a coding standard is an acknowledged practice for a specific
language. For example, programmer acknowledge that when composing C# source code, they will
compose parameters and private and secured fields utilizing Camel packaging. They will compose
every other identifier utilizing Pascal packaging. What this implies for the C# developer is that they
can take a look at a bit of C# source code composed by another and rapidly recognize sections. This
builds intelligibility considerably.

Creating a new project


You can create a new project in Visual studio easily. All you have to do it is click in “New Project”
and choose “Window application” and give name to the project.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Naming convention and organizing package

As we realize that naming convention are the principles which are connected to make content for the
software programming which have numerous reasons like adding consistency and clearness to
content and practically in specific dialects and applications. "A naming tradition can incorporate
promoting a whole word to mean a consistent or static variable (which is ordinarily done in Flash
programming), or it could be a straightforward character constrain in a coding dialect, (for example,

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

SQL). Naming convention is utilized for the most part to search contents with text editor not just
adversary the visual examining.

Commenting code

Commenting code is an information written for the easier understanding of the code when it is used
by the other programmer than that who wrote code. It provides the information about what the code
is doing and what is executed. It provides the theoretical explanation of code to the programmer.

There are two type of commenting code i.e. single commenting and multiple line commenting.
Single-line commenting code is denoted by // which is shown below as an example. Multiple line
commenting is denoted by “ */ ”. The part that start with “//‟ is single-line commenting code.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Indentation

Indentation is process of giving spaces and tabs between codes. Indentation is also a very important
for standard coding. Indentation lets programmer to find the starting as well as the end part of the
code. Following screenshot shows the proper indentation. Opening curly braces lets you to know the
starting or opening part of code of certain part where as the closing braces shows the ending part of
code of code.

Variable declaration

Variable declaration is a most common standard used while coding. A variable is a term specified to a
storing area where our programs can work. Those variables are declared inside programs without any
static converter are instance variables and variables without the converter is known as local variables.
A variable statement is beneficial in the several documents and you describe your adjustable in one
of the documents which will be existing at the time of linking of the program. Variable statements
should be extensive and symbolize the function of variable which they store.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Conclusion
In this task I have outlined the coding standard that I have used in convention.

Task2/M1
Determine the steps in writing the code to execution.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Introduction
In launching a successful project, there are many steps that should be followed to execute project.
basically the life cycle of executing project has five steps that is planning, designing, coding, testing
and deploying project. in this task, I am going to explain about the steps in writing code to execution.

SDLC is a framework or structure which consists tasks to be done during the development of
software. SDLC is used by software analyst to analysis the project. In this task, I am going to explain
the steps to successful execution of project. Naturally, SDLC has five steps that any project should go
through for deploying project. Each phase in the life cycle has its individual procedure and
deliverables that feed into the next phase of the cycle. The main purpose of using SDLC is to create a
project or software in such a way that it beats the customer expectation, grasps to the conclusion
within period and their rate estimates.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Fig. Phases of SDLC

At the first phase of the SDLC requirements for creating a project is decided. Since the first phase
determines everything that are required in creating project, this phase is very important. For
programmer to determine the requirements similar to; How will they maintained and use the system?
What is the output data by the system? Who have permission to use the system? What type of data
has permission to input into the system? These types of general questions that become responded
throughout a requirement gathering phase.

Then after doing all that, requirements are gathered and stored. Then, those data are used to start
another phase for algorithm development. Algorithm should be in human readable form so that it will
be easier for other to understand it. It makes easier to write program in better way. So algorithm must
be written before starting coding.

While creating project, it is very important to find the relation of the contents that are included. And
to find the relationship between elements that are included, flowchart helps by presenting project
through graphical representation. It helps in agreeing hardware and organization necessities and also
helps in defining inclusive structure planning. After completing the design, we write the code for the
program which transform the programming logic of programmer into computer language.

After designing the project, the implementation starts or coding program is started. Since in this
phase, the main focus is creating a program it may take long period of time. so this phase is also
known as the longest phase in a cycle.in this phase, programmer starts coding in different
programming language like JAVA, C++, C, Python and so on.

After coding then come next is testing program. In this phase, the programs or coding that has been
done in previous phase is tested. There are many types of challenging will be made with integration
and system testing for better result of application and for meets to their expectations. During this

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

testing phase, there will be chance to finding defects and requirement of more work is formed in the
analysis, design or coding. During compilation it consists of two major stages Compile stage and
Linking stage. During compile stage it checks the correctness of the syntax correct calls and
declaration of function and variables and in linking stage it links the object code into an executable
database. The process of changing high level programming language into machine level language is
known as compilation. compilation process tests the program if it found error compiler cannot
change the program and After compilation program is completed. After programmer design and
coding there, program there may remain bugs in the program and may occur through compilation or
execution of the program.

After completion of testing, the project is deployed. The size of the project determines the quality of
the program. The clients which uses project may not be familiar with the project so the training
should be given or user manual are given while deploying the project. Waterfall model of SDLC
helps in creating project in easy and proper way with step by step tracing the necessities of project.
Compilation Process

Preprocessing
Preprocessing is a first step of compilation. In this stage, program line starting with “#” character
which are interpreted by the preprocessor as preprocessor commands during program. A preprocessor
that methods its input data to make output that is used as input to another program.
These “#” orders method a simple macro language with its individual syntax and semantics. To
decrease the duplication in code, macro language are used by providing functionality to parallel
system. The nature of the preprocessor determine the quantity and type of processing done. Some
may have capacity of execution quite simple written replacement and macro expansion, while other
preprocessors have the authority of full-fledged programming languages.

Compilation
While coding, programmer code in different languages according to their wish. But, the computer
only understand the machine language for execution. Since the language in which programmer code
and the language that computer understand are different, program must be explained first the code

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

into machine code on the base of some definite programs in order to execute the program perfectly.
For this, compiler is used to convert the languages into machine level language. Some of the
compilers supports the usage of an combined assembler, in which the compiling phase produces
machine code directly, without any overhead of producing the transitional assemblage commands
and raising the assembler. The object program of the programmer can be executed a numeral of
periods without interpreting it again and again.

Assembly

During the programming of the assembly step, of the program of an assembler is used to explain the
assembly commands to machine code. An explainer works by explaining the code into object code
line by line. Assembly investigates and implements individual line or declaration of basis code in
sequence without observing at the whole program. Which shows a translator delivers the basis code
of the program one line at a time, execution the definite commands checked in that line which is
executed immediately. The translator explains the high-level language of the program into an
transitional method, which is then executed by compile.it is better for the short program than a
lengthy program for interactive programming. It helps to trace out and exact errors in the basis
program coding by programmer, but it consumes time to method of explaining and executing
statements through one by one.

Linking
The basic code that are created in assembly phase are the collection of those codes which are
recognized by the machine. But there may be some code that may be missing. For executing
program, those missing code should be reorganized and the gaps should be filled. This process is
known as linking. In this phase, programmer can write different bits of programs called modules for
most of the programming language. Those modules should be connected for executing program.
Linker is a program used after execution that combines object elements to translate the program into
an executable program. When the program is start, dynamic connection libraries are full as well.
Linker does not want dynamic linking which is a comparable method, existing on many operational
systems, which suspends the determination of some signs till the program is executed. The linker will

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

display the parts of object code in program so that purposes in some bits can successfully call
functions in other bits.

Example

Implementation of above algorithm in C++ language

Conclusion
In this task, I have explained about the steps to the code execution. The software development cycle
that can be used to create a high quality project is also explained in this task.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Task5/M2
Analyze the common features which the developer has access to in an IDE.

Introduction
Microsoft Visual Studio is a suite of devices for making programming, from the planning stage
through UI design, coding, testing, troubleshooting, analyzing code quality and execution, conveying
to clients, and gathering telemetry on utilization. These tools are designed to cooperate as
consistently as could reasonably be expected, and are altogether exposed through the Visual Studio
Integrated Development Environment (IDE).

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

You can utilize Visual Studio to make numerous type of application, from basic store applications
and games for versatile customers, to extensive, complex frameworks that power enterprises and data
centers. You can make applications and games that run on Windows, as well as Android and iOS,
sites and web service based on ASP.NET, JQuery, AngularJS, and other prevalent systems,
applications for stages and gadgets as various as Azure, Office, Sharepoint, Hololens, Kinect, and
Internet of Things, to give some examples cases, diversions and designs serious applications for an
assortment of Windows devices, including Xbox, utilizing DirectX.

Features of Visual Studio(IDE)


 Visual Studio Tools:
Visual studio tools is an extension that supports the deep learning of system including
Microsoft Cognitive Toolkit (CNTK), Google TensorFlow, Theano, Keras, Caffe2 and more.
Additional deep learning can be utilized through open architecture. Visual tool leverages
existing code and supports Python, C, C++, C# and provides additional support for the
cognitive tool. There are various tools which are described below: o Text Box
A Text Box control is utilized to show, or acknowledge as input, a single line of
content. This control has extra usefulness that isn't found in the standard Windows
text box control, including multiline altering and password character masking. A text
box is utilized to show text on a form or to get client input while a C# program is
running. In a text box, a user can type data
o Button
A button is a control, which is an intelligent segment that empowers users and
application to communicate with each other. o Group Box
In a Group Box different controls can be placed. When outlining user interface in
Windows Forms, you can utilize this control to make a square shape where you can
put different controls.
o Combo Box

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

C# controls are situated in the Toolbox of the Visual Studio which are utilize to make
objects on form. A Combo Box shows a content box joined with a List Box, which
empowers the user to choose things from the list or enter a new value. o Label
Labels are C# control which are used frequently. We can utilize the Label control to
show message in a set area on the page. Label controls can be utilized to add
descriptive text to a Form to provide the user with supportive data.

The figure that is shown shows the toolbox which


consists of many tools that makes easy to build modules
of project

Fig. Toolbox

 Roles of compiler
A compiler is a program that processes statements
written in a specific programming language and

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

transforms them into machine language or "code" that a PC's processor uses. Its not true that
the computer understand code. The computer understands only machine code. A few
programs come in both 32-bit and 64-bit variants, and those utilizing a 32-bit working
framework can't run 64-bit programs. Compilers transform the code that the programmer
composes into machine code.
 Database connectivity options
You can create, fabricate, test and distribute your database from a source-controlled
undertaking, much the same as you build up your application code. Begin without any
preparation with another Database task or import a current database. You can use table
designer to design another table, change existing table, or rapidly include new or alter
existing columns, requirements and files. You don't have to compose the difficult code to
modify influenced indexes, views, procedures and functions. Visual Studio composes the
change content for you. It focuses on what your table ought to be. The most frequent task
done by programmer or developer is to view and edit the data in a table but yet it requires
queries to be written. But visual studio view and edit data in a tabular grid, filter the grid
using a simple UI and save changes to your database.
 Options available in solution explorer
Solution Explorer is a tool window in the Visual Studio integrated development environment
(IDE) that shows the contents of solution, which incorporates the solution's project and each
project's things. Like other apparatus windows in Visual Studio, you can control its physical
parameters, for example, size, location, and whether it is docked or free-floating. For data
about how to control this tool window and additionally other Visual Studio tool windows.
The easiest approach to make a new project is to begin with a pre-characterized project
template, which consists of a fundamental arrangement of pre-produced code files, config
files, resources, and settings that get you started making a specific kind of application or site
in a specific programming language. These templates are what you find in the New Project
Dialog when you pick File | New | Project or File | New | Web Site from the main menu, and
after that navigate. After you create a new project, you utilize Solution Explorer to see and
manage project and solution and their related items.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

 Debugging
Visual Studio gives an amazing
debugging experience regardless of
what language you utilize – from
C#/VB and C++, to JavaScript and
Python, to XAML and HTML, every
single language has
debugging support. Visual
studio can debug code wherever
your code runs from
launching a local Windows app on the
desktop or in the Android emulator, to
attaching a remote Azure instance,
iOS device, or gaming console; or to
any web browser. You can debug issues offline by using capabilities such as IntelliTrace and
deep analysis of dump files.
The Visual Studio debugger gives you a chance to control execution, that is, choose precisely
where you need to stop every one of the strings in the process, and investigate state by then.
You can break All at any time, step over statement, step into and out of functions, run to
click, edit and continue, and the widely adored, set breakpoints. When you stop the
application where you need it, Visual Studio offers numerous courses for you to review the
estimation of variable, to shape or check a theory. You can monitor a value while venturing
through your code; look at nearby variable and assess complex expression without leaving
the debugger.
 Form Builder
Form is a platform for user to interact with an application. Control is an individual object
which is added to the form for allowing interaction. Controls like textbox, combobox, label
and so on are added to the form by using toolbox. Toolbox can be accessed by clicking on the
Toolbox tab to the left of the Visual Studio main window. Controls are dragged and dropped

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

in the required location. The positioning of form is maintained and size are adjusted. In this
way forms are made in Visual Studio2013.
 Windows Console
Windows Console is one of the first Windows NT GUI apps, and is one of the oldest
Windows apps in general use. Windows console accept the inputs from keyboard, mouse,
touch, pen etc. It also translates input to relevant characters. Windows Console accept text
output from a connected Command-Line app or tool. It helps to update the display as
required, based on the received output like output text. Move the cursor, set text color etc. it
handles the system interaction like launching when requested, managing resources, resizing
like minimizing and maximizing and terminate when required.

Conclusion
In this task I have analyze the common features like visual studio tools, database connectivity
options, options available in solution explorer and debugging option.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Task 8/M3
Use the IDE to manage the development process of program.

Introduction
(Techopedia, 2018) Integrated Development Environment (IDE) is an application that facilitates
application development. In general, an IDE is a graphical user interface (GUI)-based workbench
designed to aid a developer in building software applications with an integrated environment
combined with all the required tools at hand. In this task I am going to explain about how IDE
manages the program.

• Creating a new project

Creating a new project in Visual Studio 2013 is very easy. All you have to do it is follow the
steps which are mentioned below.
Steps Snapshots
Click on
“New
Project”.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Click on
“Windows
Application
Form” and
write name
of

your
project.
Then

click
“OK”. New
project
is
created.
• Graphics Design
Different types of forms can be made by using different tools. Toolbox are used to make
forms. Form are the container which allows users to interact with application. Then controls
are added to form and adjust their size and position. In this way form is created. Controls are
accessed from toolbox. Some controls that are used to make form are listed and explained
below briefly:
o Text Box and Labels:
Text boxes are used to input from the user. It can accept more than one line according
to the text boxes attributes.
Label controls are the control that are used to display text. It can be changed from one
execution of a page to another.
o Check Box and Radio Buttons:
Check box is a control in which user can check only one option. User are required to
either check or uncheck the option. Whereas radio buttons are the group where user
can select different option at the same time. Group of radio button can be created by

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

providing same group name. Checked attribute should be true for selecting check boxes
or radio buttons when the form is initially displayed. o Button:
A button is a control, which is an intelligent segment that empowers users and
application to communicate with each other. when user click button two event is
opened i.e. Click and command.
o Group Box and Combo Box:
In a Group Box different controls can be placed. When outlining user interface in
Windows Forms, you can utilize this control to make a square shape where you can
put different controls. C# controls are situated in the Toolbox of the Visual Studio
which are utilize to make objects on form. A Combo Box shows a content box joined
with a List Box, which empowers the user to choose things from the list or enter a
new value.
• Solution Explorer
Solution Explorer is a type of window which can be found in the right-hand side of a
visualstudio. It provides the details about the module in the project. With the help of solution
explorer, you can edit, view and delete the forms that have been created in the project. Also,
there are many facilities available in solution explorer like change the location, name and size
and of the forms.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Fig. Solution Explorer


• Debugging Tools
The Visual Studio debugger gives you
a chance to control execution, that is,
choose precisely where you need to
stop every one of the strings in the
process, and investigate state by then.
You can break all at any time, step
over statement, step into and out of
functions, run to click, edit and
continue, and the widely adored, set
breakpoints.
When you stop the application where
you need it, Visual Studio offers
numerous courses for you to review the estimation of variable, to shape or check a theory.
You can monitor a value while venturing through your code; look at nearby variable and
assess complex expression without leaving the debugger.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Conclusion
In this task, I have explained about opening new project, graphic tools that can be used to build
modules or form of the project, the debugging option that can be used to debug and the solution
explorer that provides the details about the module of project. Using these I have created different
modules of project.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Task11/M4
Evaluate how the debugging process can be used to help develop more secure, robust
application.

Introduction
(Rouse, 2016) Debugging is a multistep process that involves identifying a problem, isolating the
source of the problem, and then either correcting the problem or determining a way to work around
it. In simple language debugging is a process of finding the bugs in a system and fix it. Finally,
debugging test the correction and make sure it works. In this task I am going to show how debugging
is done and how it helps to develop more secure and good application.

Debugging Process
Now I am going to show how debugging is done. First, I have to open project.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

The problem or error is found in a system. Above error list shows the details of error like description,
file, line, column and project name. it helps to find the error‟s location which helps to fix the error
easily.

After correcting the error, its required to check its correctness whether the correction is done properly
or not. To check the correction has some effect in system or not we try to run program.

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Since program run smoothly and doesn‟t show any error it shows that debugging is successful and
project runs without interference

Anjir Gurung (HND / First Semester) 2


Programming ISMT
College

Use of debugging process to develop more secure and robust application


Robustness means the capacity of survival of computer system with error while executing and also
survive with wrong input in the program. To develop more secure and robust application, debugging
plays big role. Debugging is all about detecting errors in the program and solving them. During
coding a program, problem may arise and if problem is very lengthy it is very difficult to find error ‟s
location. In that case, debugging process plays a very important role for lengthy coding for example
if he/she write a code which contains more than five hundred lines of code then it becomes very
hard for the programmer to check the code perfectly and for this it may take too much time and the
output might not be as programmer expected it means that he/she may not invention the bugs in the
lines of code this time using the debugging process is suitable to find the bugs in the program and
through this process programmer saves the time and makes the code robust.

Conclusion
Debugging helps to find the error and also help to counterattack it. Login form is made to make
application more secured. Login form only allows certain users to access it. Login form requires
username and password. So, user without username and password cannot access the application. As a
conclusion debugging process helps application to develop secure and robust application.

Anjir Gurung (HND / First Semester) 2

You might also like