Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Sunday, 4 January 2015

Difference between Procedure Oriented Programming(POP) and Object Oriented Programming(OOP)


Characteristics
POP
OOP
Acronym for
Procedure Oriented Programming
Object Oriented Programming
Program Division
Program is divided into small parts that are called functions.
Program is divided into small parts that are called objects.
Importance
Importance is given to functions and sequence of actions rather than data.
Importance is given to Data rather than procedures or objects.
Approach Type
It is a top down approach.
It is bottom up approach.
Access Specifier
It does not have access specifiers.
It has access specifiers named as: Public, Private and Protected.
Expansion of Data and functions
Tough Task
Easy Task

Monday, 12 May 2014

Difference Between Blackbox and Whitebox Testing

Parameter
Black Box Testing
White Box Testing
Definition
It is a Software Testing Technique that examines the functionality of an Application without peering into its working or coding.
It is a Software Testing Technique to test internal structure and working of an Application Software.
Technique Applied in
This Technique Applied in Unit, Integration, System and Acceptance levels of Software Testing Process.
This Technique Applied in Unit, Integration and system levels of Software Testing Process.
Test Procedures
For Black box Testing Specific knowledge of the application's coding/internal structure and programming in general is not required.
For White box Testing Specific knowledge of the application's coding/internal structure and programming is required.
Test Design Techniques
Black box test design techniques include:
Decision Table Testing
All Pairs Testing
State Transition Analysis
Equivalence Transition
Boundary Value Analysis
Cause Effect Graph
       Error Guessing
White box test design techniques include:
Control Flow testing
Data flow testing
Branch testing
Path testing

Wednesday, 17 July 2013

User Defined Data Types in C++


The third type of data type in C++ is user defined. Following are some user defined data types:
Structure:  Collection of data elements grouped under one name is called Structure. Different data elements are called members and can have different data type of different length.
Declaration
Struct Student
{
Int roll_no;
Float marks;
} BA, BSC, BCOM;
In this example Student is declared as Structure with members roll_no and marks. BA, BSC, BCOM are the objects of structure Student. Here roll_no is declared as integer and marks as float, which are fundamental data types.

Class: Extended version of Structure is called Class. Structure holds only data whereas class can hold both data and functions. Another concept of access specifier is also added to it which uses three keywords Public, Private, Protected. Access Specifier modifies access rights as:
Public: Public members can be accessed anywhere where object is visible.
Private:Private members can be accessed only by other members of same class or by their friend functions.
Protected:Protected members can be accessed by other members or same class, their friend functions and by elements of derived classes of same class.

Tuesday, 9 July 2013

Derived Data Type in C++

The Data type that is derived from fundamental data types is called derived data type. Some of them are explained below:

 Array:  An array is a collection of homogeneous type of data. It is a named list of finite numbers of data elements. In array each data element is referenced by a set of consecutive numbers i.e. 1, 2, 3……n. If TECH is an array of five elements than its elements will be referenced as: TECH [1], TECH [2], TECH [3], TECH [4], TECH[5]. An Array can either be one dimensional, two dimensional or multidimensional.

Functions: Self contained block of program that performs a coherent task of some type is called Function. These are used because of following reasons:

Thursday, 4 July 2013

Fundamental Data Types in C++

These are those data types that are not composed of any other data types. C++ makes use of following five fundamental data types
1) Char
: This data type is used to store basic character sets. It is sometimes referred to as integer type because letters and symbols are represented in memory by the associated number codes. Table given below illustrates various types of character types along with their range.

Character Type
Size in Bytes
Minimal Range
Char
1
-128 to 127
Unsigned Char
1
0 to 255
Signed Char
1
-128 to 127

2) Int:These are whole numbers and do not

Wednesday, 19 June 2013

Selection Sort

It is the sorting technique with O (n2) Complexity. Hence this technique can’t be used for sorting large lists. This sorting technique finds maximum Value from the list and swaps it with first element. This process is repeated for the remaining list until list is not sorted.

Only n swaps are required to swap n number of elements.

Example: Consider the following unordered list   

10
40
7
3
25
33
                                                               

First Pass: Highest element in the list is 40 swap it with first element

40
10
7
3
25
33

40 is now first

Bubble Sort

It is the simplest type of sorting technique. In this sorting technique, first two elements are compared and if first element is greater than second, they are swapped. This process is repeated for each pair of adjacent elements to the end of the data set. It again starts with first two elements and repeat the process until no swap occurs.
This sorting technique can only be used for sorting small lists. This technique can also be used for the large lists if only few elements require sorting.

Important: Average and worst case performance of this sorting technique is O (n2).


Example: Consider the following unordered list 


5              10           3              1              9              0

First Pass

 5 <10 so there is no need of swapping.

Thursday, 11 April 2013

Difference Between Structure and Union



Characteristics
Structure
Union
Definition
A structure is a collection of variables under a single name. These variables can be of different types, and each has a name which is used to select it from the structure.
A union is a special data type that enables to store different data types in the same memory location. You can define a union with many members, but only one member can contain a value at any given time
Declaration
typedef struct {
          char name[64];
          char course[128];
          int age;
          int year;
  } student;
union Data
{
   int i;
   float f;
   char  str[20];
} data;  
Memory Allocation
In a structure, all of its data members are stored in contiguous memory locations. The size of an object of a struct is, therefore, the size of the sum of all its data members.

Example for Structure:

struct tech
{
char p;
int x;
float Q;
int y;
}D;

memory allocated for D will be  1+2+4+2= 9 bytes

A union is a class all of whose data members are mapped to the same address within its object. The size of an object of a union is, therefore, the size of its largest data member.