Uploaded by أنس السيد رمضان

Programming Document Table of Contents

advertisement
Table of Contents
1.
Abstract: ............................................................................................................................4
2.
Algorithms: .......................................................................................................................4
Methods of an algorithm: ........................................................................................4
2.1
3.
Flow chart: ........................................................................................................................5

Determine the steps taken from writing code to the execution. ...................................7
.1

Insertion sort:................................................................................................................7
Paradigms: ..................................................................................................................... 14
.1
Procedural Programming: ........................................................................................ 14
.2
Object – Oriented Programming: ............................................................................ 15
.3
Event – Driven Programming: ................................................................................. 16
.4
The relationship between them: ............................................................................... 16

Implement basic algorithms in code using an IDE. .................................................... 26
.1
Creating a Sorting algorithm By NetBeans: ........................................................... 26
.2
Features of NetBeans: ............................................................................................... 36
.3
Evaluating NetBeans IDE ......................................................................................... 36

7.3.1
File Menu of NetBeans IDE ............................................................................ 36
7.3.2
Edit Menu of NetBeans IDE ............................................................................ 37
7.3.3
View Menu of NetBeans IDE .......................................................................... 38
7.3.4
Navigate Menu of NetBeans IDE .................................................................... 38
7.3.5
Source Menu of NetBeans IDE ....................................................................... 39
7.3.6
Refactor Menu of NetBeans IDE ..................................................................... 39
7.3.7
Run Menu of NetBeans IDE ............................................................................ 40
7.3.8
Debug Menu of NetBeans IDE ........................................................................ 40
7.3.9
Profile Menu of NetBeans IDE ....................................................................... 41
7.3.10
Team Menu of NetBeans IDE ......................................................................... 41
7.3.11
Tools Menu of NetBeans IDE ......................................................................... 42
7.3.12
Window Menu of NetBeans IDE ..................................................................... 42
7.3.13
Help Menu of NetBeans IDE........................................................................... 43
7.3.14
An example of running a Program of NetBeans IDE ...................................... 43
Introduction to Debugging............................................................................................ 44
.1
Process of Debugging: ............................................................................................... 44
.2
Advantages of Debugging: ........................................................................................ 45
.3
As an example for debugging an error in a code: ................................................... 46
1|Page
Programming
Coding Standard and its Importance in Software Development .............................. 50
9.
10.
Critically evaluate why a coding standard is necessary in a team as well as for the
individual. ............................................................................................................................... 52
10.1
Coding Standard in Team:.................................................................................... 52
10.2
Coding Standard by Individual:........................................................................... 52
11.
Conclusion:................................................................................................................. 53
Figure 1Methods of Algorithm ...................................................................................................4
Figure 2 Steps Of Programming..................................................................................................6
Figure 3 Insertion Algorithm Flow Chart ....................................................................................7
Figure 4Opening a new project ..................................................................................................9
Figure 5Opening a new project ..................................................................................................9
Figure 7Type the new project name ....................................................................................... 10
Figure 6 Writing the code ........................................................................................................ 10
Figure 8 Running the Project ................................................................................................... 11
Figure 9 The result of Insertion ............................................................................................... 11
Figure 10 Comparing between Java & c# ................................................................................ 12
Figure 11 Welcoming Message................................................................................................ 18
Figure 12 Entering the weigh .................................................................................................. 18
Figure 13 Entering Height ........................................................................................................ 18
Figure 14 The Result ................................................................................................................ 18
Figure 15 Creating a class ........................................................................................................ 19
Figure 16 Welcoming Message................................................................................................ 22
Figure 17 Entering Height ........................................................................................................ 22
Figure 18 Entering Weight ....................................................................................................... 22
Figure 19 The Result ................................................................................................................ 22
Figure 20 Designing the Interface ........................................................................................... 23
Figure 21 The result ................................................................................................................. 24
Figure 22 Time Taken in PP ..................................................................................................... 25
Figure 23 Time Taken in O.O.P ................................................................................................ 25
Figure 24 Time Taken in E-D .................................................................................................... 25
Figure 25 Creating new project ............................................................................................... 26
Figure 26 naming the project .................................................................................................. 27
Figure 27 creating new project................................................................................................ 27
Figure 28 creating a class ........................................................................................................ 28
Figure 29 naming the class ...................................................................................................... 28
Figure 30 creating Interface .................................................................................................... 29
Figure 31 Naming the interface ............................................................................................... 29
Figure 32 Designing the Interface ........................................................................................... 32
Figure 33 Before clicking ......................................................................................................... 34
Figure 34 After clicking ............................................................................................................ 34
Figure 35Time taken ................................................................................................................ 35
Figure 36 Time of sorting by hand ........................................................................................... 35
Figure 37 File Menu ................................................................................................................. 36
Figure 38 Edit menu ................................................................................................................ 37
Figure 39 View Menu............................................................................................................... 38
2|Page
Programming
Figure 40 Navigate Menu ........................................................................................................ 38
Figure 41 Source Menu........................................................................................................... 39
Figure 42 Refactor Menu ......................................................................................................... 39
Figure 43 Run Menu ................................................................................................................ 40
Figure 44 Debug Menu ............................................................................................................ 40
Figure 45 Profile Menu ............................................................................................................ 41
Figure 46 Team Menu.............................................................................................................. 41
Figure 47 Tools Menu .............................................................................................................. 42
Figure 48 Window Menu ......................................................................................................... 42
Figure 49 Help Menu ............................................................................................................... 43
Figure 50 Example ................................................................................................................... 43
Figure 51 Example Of Debugging ............................................................................................ 46
Figure 52 Using Debug Menu .................................................................................................. 46
Figure 53 Starting Debug Step by Step .................................................................................... 47
Figure 54 Step By Step Debugging ........................................................................................... 48
Figure 55 Showing The Error Line ............................................................................................ 48
Figure 56 Debug Shows Variables box..................................................................................... 49
Figure 57 Showing coding standards ....................................................................................... 51
Figure 58 Showing coding standards ....................................................................................... 51
Figure 59 Showing coding standards ....................................................................................... 51
3|Page
Programming
1. Abstract:
In this content we will define basic algorithms and the process in building an
application, determining the steps taken from writing code to execution.
We will explain what procedural, object-orientated and event-driven paradigms are, and
we talk about their characteristics and the relationship between them.
And we will write a program that implements an algorithm using an IDE.
Also, we will talk about the debugging process and explain the importance of a coding
standard.
Define Basic Algorithm to Carry out an Operation an Outline the Process of
Programming an Application.
2. Algorithms:
Are the steps that leads to solution of problem which be written and read by human.
Example: if I want to make a job interview, I will think and prepare my self by the
following steps:
1- Prepare my C.V.
2- Know what is the job.
3- Where is the job place?
4- How can I go to the interview (the way, by what, .. etc).
2.1 Methods of an algorithm:
The Algorithm can be described by three methods:
a- The natural language (English, Arabic, Spanish, ..).
b- Pseudo code: which is a mannered language that helps programmers to
develop an algorithm.
c- Flow chart: which convert algorithm to be read by computer.
Figure 1Methods of Algorithm
4|Page
Programming
3. Flow chart:
Flow chart can be described by the following shape:
Meaning
Beginning of the flow chart
Ending of flow chart
Data input
Output data
Processing data
Yes or no decision
Flow chart large
If are many pages
5|Page
Shape
Start
Stop
Read
Write
Processing
Condition
Num
Programming

Steps Of Programming:
To build an application there are many steps that we can take, these steps can be
represented as following stages:
Figure 2 Steps Of Programming
1- The Planning Stage: where we can plan and figure the application.
2- Analysis stage: in this stage we collect all the details that required for the
application.
3- Design stage: here we can put the details for the application.
4- Development stage: in this stage we start the coding and write the application
codes.
5- Testing stage: in this step we must test the application to make sure that there
aren't any mistakes.
6- Integration stage: in this stage we can make much development and control the
design so the application will be much better.
7- Maintenance stage: this is the final stage were we should begin practicing any
activities required to handle issues reported by the end users.
6|Page
Programming

Determine the steps taken from
writing code to the execution.
There are many algorithms that are ready to be
used, such as Searching and sorting algorithms.
Insertion sort is an example for searching
algorithms.
.1 Insertion sort:
Is a simple algorithm where the matrix is
practically divided into sorted and unsorted part,
and the unsorted indexes are piked and be placed
in the right position in the sorted part.
The next flow chart explains how Insertion sort
works.
Figure 3 Insertion Algorithm Flow Chart
7|Page
Programming
Insertion sort can be written by the next way in JAVA language:
8|Page
Programming
In the following we can see how to apply and run it;
Figure 4Opening a new project
Figure 5Opening a new project
9|Page
Programming
Figure 7Type the new project name
Figure 6 Writing the code
10 | P a g e
Programming
Figure 8 Running the Project
Figure 9 The result of Insertion
11 | P a g e
Programming
C#
JAVA
int n = arr.Length;
int n = arr.Length;
int i = 1;
int i = 1;
for(int i = 1; i < n; ++i)
for(int i = 1; i < n; ++i)
int j = i - 1;
int j = i - 1;
while (j >= 0 && arr[j] > key)
while (j >= 0 && arr[j] > key)
arr[j + 1] = arr[j];
arr[j + 1] = arr[j];
j = j - 1;
j = j - 1;
arr[j + 1] = key;
arr[j + 1] = key;
for(int i = 1; i < n; ++i)
for(int i = 1; i < n; ++i)
for(int i = 1; i < n; ++i)
int[] arr = { 12,11,13,5,6};
InsertionSort ob = new
InsertionSort();
ob.sort(arr);
printArray(arr);
12 | P a g e
for(int i = 1; i < n; ++i)
Figure 10 Comparing between Java & c#
int arr[] = {12,11,13,5,6};
InsertionSort ob = new
InsertionSort();
ob.sort(arr);
printArray(arr);
Programming
So, there is very big benefit of using flowchart, because it explains the algorithm in any
programming language that we write the algorithm in it.
As we can see, the instructions of the flow chart explained every thing in the two
languages.
So, we can use the flow chart to explain anything we want, then we can convert it to
any programming language we know.
13 | P a g e
Programming
Explain the Characteristics of Procedural, Object Oriented and Event – Driven
Programming.

Paradigms:
A paradigm is a way of doing something (like programming), not a concrete thing like
a language.
Types of main Paradigms are:



Procedural Paradigms
Object – Oriented Paradigms
Event – Driven Paradigms
.1 Procedural Programming:
Procedural programming focuses on break down a programming task into a set of
variables, data structures and subroutines.
Procedural programming which is the first and simplest programming paradigm is very
good for small codes projects.
Procedural programming works by telling the computer what and how to do.
Advantages and Disadvantages of Procedural Paradigm:
As an advantage of it that it produces a run quickly programs and uses system resources
efficiently.
And as a disadvantage of it that it doesn't fit perfectly with certain types of problems
and forces programmers to show problems as list of steps.
Features of Procedural Programming:
o
o
o
o
Top-Down Design
Limited Code reuse
Complex Code
Global Data focused
14 | P a g e
Programming
.2 Object – Oriented Programming:
Is a set of objects that work together to solve a specific problem at hand.
The most important thing in OOP is encapsulation, which means that all the
components that make the structure are in it.
Features of Object – Oriented programming:





Its data is private and hidden from external functions.
Its objects may connect with each other through the methods.
Methods are tied together in data structure.
Programs are divided into objects.
Single and Multi-Inheritance
Advantages of Object – Oriented Programming:



It works easy on small projects.
Provide new technology.
Higher reuse levels.
Disadvantages of Object – Oriented Programming:


The programmer can be tricked by modeling the problem with objects.
Object often fails in practice.
15 | P a g e
Programming
.3 Event – Driven Programming:
Is a computer program paradigm and it used the cases of events to set control flow of
program. It supports all programming languages but every language has its own way
to perform.
Features of Event – Driven Programming:


It is used to write a program for service and don't slow down the computer.
It is a run-on time excite.
Advantages of Event – Driven Programming:


It grants for more reactive programs.
It grants sensors and other hardware easily reacts with software.
Disadvantages of Event – Driven Programming:


It is intricate for small programs.
Difficult to control.
.4 The relationship between them:
The first programming method discovered of them is Procedural Programming where
we write the methods code, then the Object-Oriented programming which has classes
that contains methods and variables, that means that the Object-Oriented programing
contains the Procedural Programming. Then Event-Driven programming which has
classes and procedurals within it. That means in the Event-Driven programming we use
Procedural and Object-Oriented programming together.
16 | P a g e
Programming
Compare and contrast the Procedural, Object-Oriented and Event-Driven
programming used in given source code of an application.
Writing a Body Mass Index (BMI) program by those three paradigms.
A- By Procedural Programming:
public static void main(String[] args) {
JOptionPane.showMessageDialog(null,"Welcome To The BMI calculater");
double h,w,ma; //declare a double parameters
h= Double.parseDouble(JOptionPane.showInputDialog("Enter your hight in
Meter"));
//assigning the hight of person to a parameter
w=Double.parseDouble(JOptionPane.showInputDialog("Enter your weight in
Kilogram"));
ma=calc_bmi(h,w);//call for method calcs the bmi
if (ma< 18.5)
JOptionPane.showMessageDialog(null,"Your buddy mass index is:"+ma+"
You are ''Underweight''");
else if (ma>=18.5 && ma<=25)
JOptionPane.showMessageDialog(null,"Your buddy mass index is:"+ma+"
Your Body Is Normal");
else if (ma>25 && ma<=30)
JOptionPane.showMessageDialog(null,"Your buddy mass index is:"+ma+"
You are ''Overweight''");
else
JOptionPane.showMessageDialog(null,"Your buddy mass index is:"+ma+"
Take care of your Helath because you are ''Obese''");
}
//here we write the method
public static double calc_bmi(double height,double weight)
{
return(weight/(height*height)); } }
17 | P a g e
Programming
Here we are welcoming the user
Figure 11 Welcoming Message
Here the user enters his height in meter
Figure 13 Entering Height
Here the user enters his weight in kilograms
And the result shown here as the ranges of BMI:




Figure 12 Entering the weigh
below 18.5 – you're in the underweight range.
between 18.5 and 24.9 – you're in the healthy weight range.
between 25 and 29.9 – you're in the overweight range.
between 30 and 39.9 – you're in the obese range.
Figure 14 The Result
18 | P a g e
Programming
B- By Object – Oriented Programming:
First, we should create a class then the main structure.
Figure 15 Creating a class
package bmi_op;
class BMI {
private double hight; // declare a standard of oop
private double wight; // declare a standard of oop
public BMI(double h, double w) //declare a constructure with given parameter
{
height=h;
weight=w;
}
public void set_hieght(double h) //encapsulating height
{
height =h;
}
public double get_height()
{
return height;
}
public void set_weight(double w)
//encapsulating weight
{
19 | P a g e
Programming
weight=w;
}
public double get_weight()
{
return weight;
}
public double calc_mass() //calculating the BMI and return its value
{
return weight/(height*height);
}
}
20 | P a g e
Programming
Then we write the main structure:
package bmi_op;
import javax.swing.JOptionPane;
public class BMI_OP {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null,"Welcome To The BMI calculater");
double h,w,ma;
h= Double.parseDouble(JOptionPane.showInputDialog("Enter your hight in
Meter"));
w= Double.parseDouble(JOptionPane.showInputDialog("Enter your weight in
Kilogram"));
BMI m = new BMI(h,w); //creating opject
ma= m.calc_mass();
if (ma< 18.5)
JOptionPane.showMessageDialog(null,"Your
is:"+m.calc_mass()+" You are ''Underweight''");
buddy
mass
index
buddy
mass
index
buddy
mass
index
JOptionPane.showMessageDialog(null,"Your
buddy
mass
is:"+m.calc_mass()+" Take care of your Helath because you are ''Obese''");
}}
index
else if (ma>=18.5 && ma<=25)
JOptionPane.showMessageDialog(null,"Your
is:"+m.calc_mass()+" Your Body Is Normal");
else if (ma>25 && ma<=30)
JOptionPane.showMessageDialog(null,"Your
is:"+m.calc_mass()+" You are ''Overweight''");
else
21 | P a g e
Programming
Here we are welcoming the user
Figure 16 Welcoming Message
Here the user enters his height in meter
Figure 17 Entering Height
Here the user enters his weight in kilograms
And the result shown here as the ranges of BMI:




Figure 18 Entering Weight
below 18.5 – you're in the underweight range.
between 18.5 and 24.9 – you're in the healthy weight range.
between 25 and 29.9 – you're in the overweight range.
between 30 and 39.9 – you're in the obese range.
Figure 19 The Result
22 | P a g e
Programming
C- By Event – Driven Programming:
After setting up the buttons and dialog boxes as in the page:
Figure 20 Designing the Interface
We wright the code in Calculate BMI button as follow:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
h,w,m; String s;
double
h= Double.parseDouble(jTextField1.getText());
w= Double.parseDouble(jTextField2.getText());
m=w/(h*h);
if (m< 18.5)
s= "\" You are ''Underweight''\"";
else if (m>=18.5 && m<=25)
s= " Your Body Is Normal";
else if (m>25 && m<=30)
s=" You are ''Overweight''";
else
s= " Take care of your health because you are ''Obese''";
jTextField3.setText(String.valueOf(m)+ String.valueOf(s));
}
Now in the main structure we wright the following code:
public static void main(String[] args) {
BMI_interface bmi= new BMI_interface();
23 | P a g e
Programming
bmi.show();
}
The result will show as follow:
Figure 21 The result
24 | P a g e
Programming
As we can see, in Procedural Programming it takes 9 seconds from running the
application to end it:
Figure 22 Time Taken in PP
In Object-Oriented Programming it takes less time, 7 seconds:
Figure 23 Time Taken in O.O.P
But in Event-Driven Programming it takes more less time, 5 seconds:
Figure 24 Time Taken in E-D
In my opinion, the Event-Driven programming is more comprehensive and simpler
. As it is faster in connecting between its methods and classes.
25 | P a g e
Programming

Implement basic algorithms in code using an IDE.
Write a program that implements an algorithm using an IDE.
Use the IDE to manage the development process of the program.
Evaluate the use of an IDE for development of applications contrasted with not
using an IDE.
We will explain Insertion sorting algorithm as one of the most popular sorting
algorithms.
.1 Creating a Sorting algorithm By NetBeans:
We will start from creating the sorting algorithm by NetBeans IDE.
Figure 25 Creating new project
We press at New Project button.
26 | P a g e
Programming
Figure 27 creating new project
Figure 26 naming the project
27 | P a g e
Programming
Then we will create a new Java Class by pressing right click on Source Packages then
New then Java Class.
Figure 28 creating a class
Figure 29 naming the class
28 | P a g e
Programming
Then we create the Java Interface by clicking right click on Source Packages then New
then Java Interface.
Figure 30 creating Interface
Figure 31 Naming the interface
29 | P a g e
Programming
Then we write the class code
30 | P a g e
Programming
Then we write the Main code for interface:
31 | P a g e
Programming
Then we design the interface apperance:
Figure 32 Designing the Interface
32 | P a g e
Programming
Then we write the interface code at the (SORT THEM) button.
33 | P a g e
Programming
Then when we run the application:
Before clicking
Figure 33 Before clicking
After clicking
Figure 34 After clicking
34 | P a g e
Programming
Here is the time taking from writing the array to the end of sorting them:
Figure 35Time taken
As we can see, it takes a very short time to do everything.
But if we want to do it by ourselves, and sort the same array by our hands, it will take
a very longer time:
Before
99
88
77
55
66
33
44
11
22
Step1
11
88
77
55
66
33
44
99
22
Step2
11
22
77
55
66
33
44
99
88
Step3
11
22
33
55
66
77
44
99
88
Step4
11
22
33
44
66
77
55
99
88
Step5
11
22
33
44
55
77
66
99
88
Step6
11
22
33
44
55
66
77
99
88
Step7
11
22
33
44
55
66
77
88
99
And there is how it takes to be done.
As we can see, this sorting algorithm has
saved time for us, and for more sorting arrays
it will save time and effort.
Figure 36 Time of sorting by hand
35 | P a g e
Programming



.2 Features of NetBeans:
Write Bug-Free Code: NetBeans tools up a static analysis tools, especially
combination with the widely used Find Bugs tool.
Support for multi-Languages: NetBeans IDE supports C/C++ and PHP
developers by suppling comprehensive editors and tools for their frameworks.
Cross Platform Support: NetBeans can be installed in all operation systems that
support Java from Windows to Linux to MacOs Systems.
.3 Evaluating NetBeans IDE
7.3.1 File Menu of NetBeans IDE
Here we can start a new project or open an old project.
Figure 37 File Menu
36 | P a g e
Programming
7.3.2
Edit Menu of NetBeans IDE
Here we can edit the object that we are working on like undo or cut or copy.
Figure 38 Edit menu
37 | P a g e
Programming
7.3.3
View Menu of NetBeans IDE
Figure 39 View Menu
7.3.4
Navigate Menu of NetBeans IDE
Figure 40 Navigate Menu
38 | P a g e
Programming
7.3.5
Source Menu of NetBeans IDE
Figure 41 Source Menu
7.3.6
Refactor Menu of NetBeans IDE
Figure 42 Refactor Menu
39 | P a g e
Programming
7.3.7
Run Menu of NetBeans IDE
Figure 43 Run Menu
7.3.8
Debug Menu of NetBeans IDE
Figure 44 Debug Menu
40 | P a g e
Programming
7.3.9
Profile Menu of NetBeans IDE
Figure 45 Profile Menu
7.3.10 Team Menu of NetBeans IDE
Figure 46 Team Menu
41 | P a g e
Programming
7.3.11 Tools Menu of NetBeans IDE
Figure 47 Tools Menu
7.3.12 Window Menu of NetBeans IDE
Figure 48 Window Menu
42 | P a g e
Programming
7.3.13 Help Menu of NetBeans IDE
Figure 49 Help Menu
7.3.14 An example of running a Program of NetBeans IDE
Figure 50 Example
43 | P a g e
Programming
Determine the debugging process and explain the importance of a coding
standard.
Outline the coding standard you have used in your code.
Evaluate how the debugging process can be used to help develop more secure,
robust applications.

Introduction to Debugging
Debugging is the process of finding bugs in a code. For example, finding an error in a
software or an application and fixing it.
Any software program or product which is being developed undergoes through three
steps, testing, troubleshooting and maintenance in a different environment. These
software programs or product contains some errors or bugs. These bugs need to be fixed
to develop a bug-free software. Debugging refers to finding bugs, analyzing, and fixings
them. This process takes place when the software fails due to some errors or software
performs an unwanted thing. Debugging looks simple, but it is an important task to fix
all errors at every stage of debugging.

Why do we need Debugging? Any software which is developed needs to be
bug-free before releasing or going into the market. As there is much
competition in the market, every organization wants to be at the top. It is
possible if your software is bug-free and the customer is happy with your
software. The customer becomes happy if the program is free from error
while using it. This is the reason every programming developer must do the
debugging process before releasing the program to the market.
.1 Process of Debugging:
There are many stages involved in the process of debugging:
1. Identify Error: identifying errors at an early stage can save lot of time. If
we make a mistake in identifying an error, it leads to a lot of time wastage.
2. Identify the Error Location: After identifying an error, we need to identify
its exact location in the code where an error occurs. Identifying an exact
location that leads to the error can help to fix the problem faster.
3. Analyses Error: by analyzing error we have to use an appropriate approach
to analyze the error. This will help us to understand the problem. This stage
is very critical, because solving one error may lead to another error finding
and solve it.
4. Prove the Analysis: once the identified error has been analyzed, we have
to focus on other errors of the software. This process involves test
automation where you need to write the test cases through the test
framework.
5. Cover Lateral Damage: In this stage, we have to do unit testing of all the
code where we make the changes. If all test cases pass the test, then we can
move to the next stage or we have to resolve the test case that doesn't pass
the test.
44 | P a g e
Programming
6. Fix and validate: this is the final stage of the debugging process, where we
need to fix all the bugs and test all test script.
.2 Advantages of Debugging:
.1 Saves Time: Performing debugging at the initial stage saves the time of
software developers as they can avoid the use of complex codes in software
development. It not only saves the time of software developers but also
saves their energy.
.2 Reports Errors: It gives error report immediately as soon as they occur.
This allows the detection of error at an early stage and makes the software
development process a stress free.
.3 Easy Interpretations: It provides easy interpretations by providing more
information about data structures.
.4 Release bug-free software: By finding errors in software, it allows
developers to fix them before releasing them and provides bug-free software
to the customers.
45 | P a g e
Programming
.3 As an example for debugging an error in a code:
Figure 51 Example Of Debugging
We can use the Debug Project button
Or we can use the Step Into button which debugging the codes line by line.
Figure 52 Using Debug Menu
46 | P a g e
Programming
Figure 53 Starting Debug Step by Step
47 | P a g e
Programming
Figure 54 Step By Step Debugging
If we click on the step over button it will move to the next row thin the next until it
stops at the error row.
Figure 55 Showing The Error Line
48 | P a g e
Programming
And as we can see below, how the debugger shows in the variables box how it deals
with the code step by step and how it shows the entered number.
Figure 56 Debug Shows Variables box
49 | P a g e
Programming
9. Coding Standard and its Importance in Software Development
Coding standards are a series of procedures that can be defined for a particular
programming language specifying a programming style, the methods and different
procedures. These procedures can be for various aspects of the program written in that
language.
They can be considered as essential attributes of software development.
A coding standard makes sure that all the developers working on the project are
following certain specified guidelines. The code can be easily understood and proper
consistency is maintained.
Consistency has a positive impact on the quality of the program and one should
maintain it while coding. Also, it should be taken cared that the guidelines are
homogeneously followed across different levels of the system and they do not conflict
each other. The final program code should look like that it has been written by a single
developer, in a single session.
Why coding standards are important in Software Development?
If the coding standards are not defined, developers could be using any of their own
methods, which might lead to certain negative effects such as:


Security Concerns: software becomes vulnerable to attacks if it is
inconsistent, contains bugs and errors in logic. Most of the aforesaid
problems arise due to the faulty programming code that might have resulted
from poor coding practices.
Performance Issues: poor coding has an adverse effect on the performance
of the site. The performance issues comprise a multitude of things like when
the user is interacting with the site, server response issues, reusability &
flow of the code, etc.
When the coding standards are implemented, these problems can be easily overcome
giving you a secure site with minimum or no performance issues.
50 | P a g e
Programming
Below we will provide how we used coding standards in our lo3 project:
Figure 58 Showing coding standards
Figure 57 Showing coding standards
Figure 59 Showing coding standards
51 | P a g e
Programming
10. Critically evaluate why a coding standard is necessary in a team as well as
for the individual.
Requirement of using coding standard in a team as well as for the individual:
•
Enhanced Efficiency: It is often seen that the software developers spend a
larger part of their time in solving those issues that could have been prevented.
Implementing the coding standards would help the team to detect the problems
early or even prevent them completely. This will increase efficiency throughout
the software process.
•
Risk of project failure is reduced: IT projects may fail due to problems while
developing software. Implementing the coding standards reduces many
problems and the risk of project failures.
•
Minimal Complexity: If a code is complex, there are higher chances of it being
vulnerable to errors. Coding standards help in the development of software
programs that are less complex and thereby reduce the errors.
•
Easy to Maintain: If the coding standards are followed, the code is consistent
and can be easily maintained. This is because anyone can understand it and can
modify it at any point in time.
•
Bug Rectification: It becomes really easy to locate and correct bugs in the
software if the source code is written in a consistent manner.
•
A Comprehensive Look: If the source code maintains consistency, a clear view
of how code fits in the larger application or fits into the company as a whole.
•
Cost-Efficient: A clear code gives the developers an opportunity to reuse the
code whenever required. This can radically reduce the cost along with the efforts
put in the development.
10.1 Coding Standard in Team:
In addition to all of the above, for the team, working according to standards makes it
easier for the team to work on one project if all the team adheres to the same standards,
and this makes it easier for them to read each other’s codes.
10.2 Coding Standard by Individual:
As for the individual person, it is easy for the same person to return to programs that he
has previously written them and develop them if they were written by standards.
52 | P a g e
Programming
11. Conclusion:
In the above content we explained the importance of Flowchart and how it simplify the
developers job. And how we can write a code in defernite Programming methods.
And how to use the IDE in the best way.
In this unit we learned a lot of things in programming that will help us later in
developing Programming.
53 | P a g e
Programming
Download