Wednesday, October 27, 2010

'ARRAYS' in C LANGUAGE



'ARRAYS' in C LANGUAGE


'ARRAYS' in C LANGUAGE

HIGH-LEVEL LANGUAGES

So far, it has been necessary to know how many items are to be stored and to declare a variable for each item. Further more, if a large amount of data is to be stored, would be a long and tedious task to think of a separate variable name for each data, and then to type the declaration for each one of these variables.

Arrays are the solution to this problem. They are such an important part of the art of programming that they are included in every

What is an Array?
In C, as in other computer languages, it is possible to assign a single name to a whole group of similar data. For example, if we are interested in a large number of recorded Celsius temperature, we can assign a common name such as C_temp to all of the data. Then we can refer to each element in terms of its position within the list of items. This is done in mathematics, as well as in computer programming, using an entity called an array.

An array is a group of elements that share a common name and that are differentiated from one another by their positions within the array. For example, if we have five numbers, all of which are named x, they may be listed:

X
58
63
49
18
7

The position of each of these elements can be indicated by means of a subscript:

X1 = 58
X2 = 63
X3 = 49
X4 = 18
X5 = 7

In mathematics, a subscript is a number written to the right of the variable name, slightly below the line, and usually in small type. The subscript indicates the position of the particular element with respect to the rest of the elements.

For those movie buffs who are fans of the old Charlie Chan detective movies, you will remember that whenever it became necessary for Mr. Chan to introduce his sons to clients, he would always introduce them as: “This is my number one son…my number two son….” Etc. It is clear from this that even though computers were made, Mr. Chan actually resorted to the method of introducing his sons by their subscripts!

Since it is impossible to display subscripted numbers on the standard computer terminal, the usual recourse is to enclose the subscript in parentheses or brackets. In C (as in Pascal), square brackets are used. The following five statements are valid in C.
X[1] = 58;
X[2] = 63;
X[3] = 49;
X[4] = 18;
X[5] = 7;
HOW ARRAYS ARE USEFUL
To see the usefulness of arrays, consider the problem of reading the age of 5 persons, printing them out individually and computing the average. Here is a solution that does not use arrays.

#include
main()
{
int a1, a2, a3, a4, a5;
float sum=0;
printf (“Age:”);
scanf(“%d”, &a1);
sum += a1;
printf (“Age:”);
scanf(“%d”, &a2);
sum += a2;
printf (“Age:”);
scanf(“%d”, &a3);
sum += a3;
printf (“Age:”);
scanf(“%d”, &a4);
sum += a4;
printf (“Age:”);
scanf(“%d”, &a5);
sum += a5;
printf (“The ages that were input are:\n”);
printf(“%d\n”, a1);
printf(“%d\n”, a2);
printf(“%d\n”, a3);
printf(“%d\n”, a4);
printf(“%d\n”, a5);
printf (“Average =%f\n”, sum /5);
}
The program is very simple. It reads the ages of 5 persons, adds them up in a variable called sum, and at the end, divides sum by 5 to get the average age. Needless to say, this is a very clumsy way to write a program. If there are a large number of persons, the number of statements increases proportionately. To avoid this, use a loop. But the problem is that different variables are needed to store the ages of different persons and hence, the loop will have to store and print different variables each time. A more elegant way is to use an array of integers to store the ages, as shown in the example below. Notice the declaration of the array variable in the first line of main().

#include
void main()
{
int age[5]; /* Array of 5 ages, declaration for an array */
int i, n;
float sum = 0;
printf (“Number of persons:”);
scanf(“%d”, &n);
if (n<=0 || n>5)
printf (“Invalid number of persons entered.\n”);
else
{
for (i=0; i {
printf (“Age:”);
scanf(“%d”, &age[i]);
sum += age[i];
}
printf (“the ages input are :\n”);
for (i=0; i printf (“%d\n”, age[i]);
printf (“The average is : %f\n:, sum /n);
} /* end main */
Run
Number of persons: 5
Age: 10
Age: 20
Age: 30
Age: 40
Age: 50
The ages input are:
10
20
30
40
50
The average is : 30.000000

(i) Declaration
The previous program is examined now. Recall that all variables in C must be declared before use. Hence, we must first declare the array. It is done at the beginning of the function main() with the statement
int age[5];

This statement states that age is an array of 5 integers. Note the use of square braces after the array name (i.e., age) enclosing the integer 5 that gives the number of elements in the array. This statement reserves enough memory for age to hold 5 integers. Once the declaration is made, ag [0] refers to the first integer in the array, age [1] refers to the second integer and so on. Finally, age [4] refers to the last integer in the array. In C, array indices always begin with zero. Figure 7.1 shows the declaration of an array.

Fig. 7.1 Array definition

(ii) Accessing array elements
To access a particular element in an array, specify the array name, followed by square braces enclosing an integer, which is called array index. The array index indicates the particular element of the array which we want to access. The numbering of elements starts from zero (i.e. age[0] is the age of the first person). Figure 7.2 depicts the elements of an array in memory. It is assumed that each element of the array (i.e., each integer) occupies two bytes.

Next, observe the loop used to input the elements. It is reproduced here for convenience.

for (i=0; i {
printf (“Age:”);
scanf(“%d”, &age[i]);
sum += age[i];
}

The variable i was from 0 to n-1 (0 to 4 in the above sample run). The function scanf is called to input an integer value. The address of the ith element is passed to scanf. This makes scanf store the integer input into successive integer positions each time the loop is executed. Note that
&age[i];
in the scanf statement refers to the memory location of the integer at the ith position.

The statement
sum+= age[I];
adds the value of the ith integer to sum.

The rest of the program illustrates the use of the array variable in various situations. The first for loop is used to add to the variable sum, and in the second, to print out the values of age that are input.

An element such as age[i] can be used just like any other ordinary integer. Statements such as





Fig 7.2 Elements of the array age

age[i]++; (to increment the value of the ith integer in the array age) and age [i]=11; are perfectly valid.

(iii) Initialization of single dimensional array
Arrays can be initialized once they are declared. The declaration of an array can be done as follows:

int a[5] = { 13, 34, 2, 6, 234 };

Here, a is an array of 5 integers. The initial value of the five integers are specified in order, between the curly braces, separated by commas. The above declaration causes a [0] to be initialized to 13, a[1] to 34 and so on, till a [4], which is initialized to 234. A semicolon always follows the closing brace.

The array size may be omitted during declaration, as shown below.

int a[] = {13, 34, 2, 6, 234};

This declaration is equivalent to the first one. In this case, the subscript is assumed to be equal to the number of elements in the array (5 in this case). Figure 7.3 shows the initialization of an array.

Fig. 7.3 Array Initialization
(iv) Warning
C does not check the validity of the subscript when you use arrays. For example, take a look at the program below:

void main()
{
int a[40];
a[50] = 11;
a[50]++;
}

In essence, the program declares a as an array of 40 integers, and then modifies the 51st element! When you compile the above program, you do not get any error. The executable code is produced. When it is run, the results are unpredictable. Hence, we must be very careful while using array subscripts. A wrong subscript in a large program can cause it to behave erratically, demanding a lot of debugging time.

Similar to an array of integers, we can have an array of any data type. For example, the declaration for an array of 50 floating-point numbers is:
float f[50];
The individual floating-point numbers in this array are accessed as before, i.e., f[0] is the first floating-point number and f(49) the last.

(v) Name of the array
Take the case where f is an array of floating point numbers. It is declared as:

float f[50];

The name of the array is f. If it is used as it is, without any subscript, then it refers to the memory location of the first floating-point number in the array. Recall that placing an ampersand (&) before a variable name refers to its memory location. Thus, the array name f is equivalent to &f[0]. The statement

scanf(“%f”, &f[0]);
is equivalent to
scanf(“%f”, f);

Perhaps, this may not seem to be very useful now. But its potential will be made evident later, in the chapter on pointers.



SUCCESS FOR CAREER





Example 7.1
An example to find out the largest and smallest element in an array is illustrated below:

/* large1.c: largest and smallest element in the vector */
#include
main()
{
int i,n;
float a[50], large, small;
printf (“Size of vector ?”);
scanf (“%d, &n);
printf (“\n Vector elements?\n”);
for (i=0; i scanf (“%f”, &a[i]);

/* Initialization */
large = a[0];
small = a[0];
/* largest and smallest elements */
for (i=l; i {
if(a[i] > large)
large = a[i];
else if (a[i] < small)
small = a[i];
}
printf (“\n Largest element in vector is %8.2f\n”, large);
printf(“\n Smallest element in vector is %8.2f\n”, small);
}

Run:
Size of vector ? 7
Vector elements ?
3.400 -9.00 12.00 10.00 -6.00 0.00 36.00
Largest element in vector is 36.00
Smallest element in vector is -9.00

Example
/* sort.c: sorting the vector elements in ascending order */
#include
main ()
{
int i,j,k,n;
float a[50], temp;
printf (“Size of vector ?”);
scanf(“%d”, &n);
printf (“\n Vecntor elements ?\n”);
for (i=0; i scanf(“%f”, &a[i]);
/* sorting vector A using selection sort */
for (i=0; I for(j=i+l;j {
/* To sort in descending order change the ‘>’ */
/* operator to ‘<’ in the IF structure */
if (a[I] < a[j])
{
temp = a[i];
a [i] = a[j]
a[j] = temp;
}
}
printf (“\n Vector elements in ascending order: \n”);
for (i=0; i printf (“%8.2f’,a(i]);
}
Run:
Size of vector ? 8
Vector elements ?
91.00 20.00 1.00 7.00 34.00 11.00 -2.00 6.00
Vector elements in ascending order:
-2.00 1.00 6.00 7.00 11.00 20.00 34.00 91.00

Example

/* insert.c: inserting an element into an vector */
#include
main()
{
Int i,j,k,n,pos;
float a[50], item;
printf (“size of vector ?”);
scanf(“%d”,&n);
printf(\n vector elements ? \n”);
for (i=0; i scanf (%f”, &a[i];
printf (“\n element to be inserted ?”);
scanf (“%f”, &item);
printf (“\n position of insertion ? “);
scanf (“%d”, &pos);
/ * Pushing down elements */
n++;
for (k=n; k>=pos; k--_
a[k] = a[k-1];
a[--pos] = item; /* item inserted */
printf (“\n Vector after insertion : \n”);
for (i=0; i printf (“%6.2f”, a[i]);
printf (“\n”);
}

Run:
Size of vector? 6
Vector elements ?
1.00 2.00 3.00 4.00 5.00 6.00
Element to be inserted ? 10.00
Position of insertion ? 1
Vector after insertion :
10.00 1.00 2.00 3.00 4.00 5.00 6.00

Run 2:
Size of vector? 5
Vector elements ?
1.00 2.00 4.00 5.00 6.00
Element to be inserted ? 3.00
Position of insertion ? 3
Vector after insertion :
1.00 2.00 3.00 4.00 5.00 6.00

7.3 MULTIDIMENSIONAL ARRAYS
Often, there is a need to store and manipulate two-dimensional data structures such as matrices and tables. Here, the array has two subscripts. One subscript denotes the row, and the other, the column. As before, all subscripts (row and column) start with 0.

(i) Declaration
The declaration of a two-dimensional array is as follows:
float m[10][20];
Here, m is declared as a matrix having 10 rows (numbered 0 through 9) and 20 columns (numbered 0 through 19). The first element in the matrix (the element at the first row and first column) is:
m[0] [0]
and that at the last row and last column is:
m[9] [19]

(ii) Elements of multidimensional arrays
A two dimensional array marks [4] [3] is shown Figure 7.4. The first element is given by marks [0] [0] which contains 35.5, the second element is marks [0] [1] and contains 40.5 and so on. Figure 7.5 is a pictorial representation of the two dimensional array marks as stored in the memory.


Fig 7.4 Two dimensional matrix: marks [4] [3]




Fig 7.5 Two dimensional array to store marks

Note: The declaration of a two dimensional array, for example, m[10] [20] may be confusing to those who are familiar with other languages such as FORTRAN, where the array subscripts are separated by a comma. Consider the following program typed by a confused programmer.



# include
void main( )
{
int m[10] [20];
m[5] [16] = 13;
printf (“%d\n”, m[5,16]);
}

The first two lines in main() are fine, but the third line wrongly uses a comma inside the square braces, instead of enclosing the two subscripts separately. The danger lies in the fact that comma is an operator in C. Recall that the comma operator causes the expressions to be evaluated from left to right, and the value of the right most expression becomes the value of the entire expression containing the comma operators. In this case, the result of the expression with 5,16 inside the square braces, evaluates to 16 and hence, the printf statement shown above is equivalent to:
printf(“%d\n”, m[16]);

But since the array m is two dimensional, one would feel that m[16] would give a compile time error. But this is not so, since m[16] actually refers to the memory location of the first element in the 17th row. Even though there is no 17th row, C does not check this fact. So there will be no compile time errors on this account. At run time, instead of 13, some other number may get printed, or the program may crash. Needless to say, such errors made in a large program are difficult to detect.

(iii) Accessing two dimensional array elements
The elements of a two dimensional array can be accessed by the following expression:
marks [i][j]
where i refers to the row number and j, the column number.

(iv) Initializing two dimensional arrays
Initialization of a two-dimensional array during declaration is done by specifying the elements in row major order (i.e., with the elements of the first row in a sequence, followed by those of the second, and so on). An example is given below:

int two_dim_int[3] [4] =
{
{1, 2, 3, 4},
{2, 3, 4, 5},
{5, 6, 7, 8}
};

The variable two_dim_int is declared as a two dimensional integer array with certain initial values. The first subscript can be omitted. For example, the declaration below wherein the number of rows(3) is not explicitly specified, is equivalent to the previous one.
int two_dim_int[ ] [4] =
{
{1, 2, 3, 4},
{2, 3, 4, 5},
{5, 6, 7, 8}
};

Also, the inner braces can be omitted, giving the numbers in one continuous sequence. For example, has the same effect as the previous example, but is not as readable as before.

(v) Passing arrays to functions
Arrays can be passed as arguments to functions. Consider the following example:

/* arrfunc.c: passing arrays to functions */
#include
const int Rollno =4;
const int Subject = 3;

/* function declaration */
void display (float marks [Rollno] [Subjects]);

main()
{
float marks [Rollno] [Subjects] =

/* array initialization */
{
{35.5, 40.5, 45.5},
{50.5, 55.5, 60.5},
{65.0, 70.0, 75.5}
{80.0, 85.0, 90.0}
};
/* function call with array as an argument */
display (marks);
} /* end main */
/* function definition to display elements */
void display (float Studentmarks [Rollno] [Subjects])
{
int r,s;
for (r=0; r {
printf (“\n Rollno %d”);
for (s=0; s printf (“%10.24”, Studentmarks [r] [s]);
} /* end for */
} /* end display */

The function declaration in the above program,
void display (float marks [Rollno] [Subjects]);
can also be written as,

void display (float marks [ ] [Subjects]);

The function display visualizes marks as an array, where the number of columns is Subjects. While calling the function, the name of the array is sufficient as an argument. Hence, the function call in main is of the form:
display (marks); /* function call */

The name marks represents the memory address of the array and is similar to using a reference argument. Elements of an array are not copied but the function works with a different name, on the original array itself. Hence, any modifications done to the array in the function are reflected in the array of the caller too. Passing by reference is efficient, as arrays can be very large and copying the entire array into a function consumes time and memory.

The function definition.
void display (float StudentMarks [Rollno] [Subject])
uses the name of the array, datatype and their sizes. Inside the function the elements of the array are accessed by:
studentmarks [r][s]

Example

/* addmat.c: program to add tow matrices */
#include
main()
{
int a[10] [10], vb[10] [10], c[10] [10], i,j,m,n,p,q;
printf (“Input row and column of A matrix \n”);
scanf(“%d %d”, &n, &m);
printf (“Input row and column of B matrix \n”);
scanf(“%d %d”, &p, &q);
/* checks if matrices can be added */
if(n==p)&&(m==q))
{
printf(“matrices can be added\n”);
printf(“Input A-matrix\n”);
for(i=0; i for(j=0; j scanf(“%d”, &a[i][j]);
pritnf (“Input B-matrix \n”);
for(i=0; i for(j=0; j /* Addition of two matrices */
for(i=0; i for(j=0; j c[i][j] = a[i][j] + b[i][j];
printf (“sum of A and B matrices :\n”);
for (i=0, i {
for (j=-; j printf (“%5d”,c[i][j]);
printf(“\n”);
}
} /* endif */
else
printf (“matrices cannot be added \n”);
} /* main */

Run 1:
Input row and column of A matrix
3 3
Input row and column of B matrix
1 2
Matrices cannot be added

Run 2:
Input row and column of A matrix
3 3
Input row and column of B matrix
3 3
Matrices can be added

Input A-matrix
1 2 3
4 5 6
7 8 9

Input B-matrix
1 2 3
4 5 6
7 8 9

Input A and B-matrix
2 4 6
8 10 12
14 16 18

Example
/* trace.c: Trace of the matrix */
#include
main()
{
int a[10] [10], i,j, n, trace;
printf (“Enter the order of A matrix \n”);
scanf (“%d”, &n);
printf (“Input A-matrix\n”);
for (i=0; i for (j=0; j scanf (“%d”, &a[i[ [j]);
/* Trace = Sum of the diagonal elements of the matrix */
trace = 0;
for (i=0; i trace += a[i] [i];
printf (“trace = %d \n”, trace);
} /* main */

Run:
Enter the order of A matrix
3
Input A-matrix
1 2 3
4 5 6
7 8 9
Trace = 15

Example

/* mult.c: program to multiply tow matrixes */
#include
main()
{
int a [10] [10], b [10] [10], c[10] [10], i,j, m,n,ip,k,p,q;
printf (“Input row and column of A matrix :”);
scanf (“%d %d”, &m,&n);
printf (“Input row and column of B matrix:”);
scanf (“% %d, &k, &q);
if (n==k)
{
printf (“matrices can be multiplied \n”);
printf (“resultant matrix is %d X %d\n”,m,q);
printf (“input A-matx \n”);
read_mat (a,m,n);
printf(“Input B-matrix \n”);
/* function call to read the matrix */
read_mat(b,k,q);
/* Multiplication of two matrices */
for (i=0; i for )j=0; j {
c[i] [j] = 0;
for(ip=0; ip c[i] [j] = c[i] [j] + a[i] [ip] * b[ip] [j];
}
printf (“Resultant of A and B matrices :\n”);
write_mat (c,m,q);
} /* end if */
else
{
printf (“Col of matrix A must be equal to row of matrix B \n”);
printf (“matrices cannot be multiplied \n”);
} /* end else */
} /* End of main */
/* function re ad matrix */
read_mat(a,m,n)
int a[10] [10], m,n;
{
int i,j;
for (i=0; i for (j=0; j scanf (“%d”, &a[i] [j]);
}
/* function tow rite the matrix */
write_mat (a,m,n)
int a [10] [10], m,n;
{
int i,j;
for (i=0; i {
for (j=0; j printf (“%5d”, a[i] [j]);
printf (“\n”);
}
}

Run 1:
Input row and column of A matrix: 3 3
Input row and column of B matrix: 3 3
Matrices can be multiplied
Resultant matrix ix 3 X3
Input A-matrix
1 2 3
4 5 6
7 8 9

Input B-matrix
1 2 3
4 5 6
7 8 9
Resultant of A B matrices :
30 36 42
66 81 96
102 126 150
Run 2:
Input row and column of A matrix: 1 2
Input row and column of B matrix: 3 4
Col of matrix A must be equal to row of matrix B
Matrices cannot be multiplied
Example
/* trans.c: Transpose of a matrix */
#include
main()
{
int a [10] [10], b[10] [10], i,j,m,n;
printf (“Input row and column of A matrix:”);
scanf (“%d %d”, &n, &m);
printf (“\n Inpute A-matrix \n”);
for (i=0; i for (j=0; j scanf (“%d”, &a[i] [j]);
/* the rows and columns are interchanged: transpose */
for (i=0; i for (j=0; j b[i] [j] = a[j] [i];
printf (“\n Transpose of matrix A is :\n”);
for (i=0; i {
for (j=0; j printf (“%6d”, b[i] [j]);
printf (“\n”);
}
} /* main */

Run:
Input row and column of A matrix : 3 4
Input A-matrix
1 2 3 4
5 6 7 8
9 6 7 8

Transpose of matrix A is :
1 5 9
2 6 6
3 7 7
4 8 9

STRINGS
Strings are arrays of characters, i.e., they are characters arranged on e after another in memory. To mark the end of the string. C uses the null character. Strings in C are enclosed within double quotes. So, for example,
“My age is 2 (two)”
is a string. The string is stored in memory as ASCII codes of the characters that make up the string appended with 0 (ASCII value of null). ASCII values of all characters are given in Chapter 14, with the help of which we will examine the memory occupied by the string.

Normally, each character is stored in one byte, and successive characters of the string are stored in successive bytes.

Character: M Y a g e i s 2
ASCII Code: 77 121 32 97 103 101 32 105 115 32 50 32

( t w 0 ) \0
40 116 119 111 41 0

The last character, as you can see, is the null character, having the ASCII value zero.

(i) Initializing strings
Following the discussion on character arrays (i.e., a string), the initialization of a string must have the following form, (this is similar to initializing a one dimensional array):

Char month 1[] = (‘J’, ‘a’, ‘n’, ‘u’, ‘a’, ‘r’, ‘y’, 0);
Then the string month is initialized to January. This is perfectly valid, but C offers a special way to initialize strings. The above string can be initialized as:

Char month1 [] = “January”;

The characters of the string are enclosed within a pair of double quotes. The compiles takes care of storing the ASCII codes of the characters of the string in memory and also stores the null terminator in the end. A simple program to display a string is listed below.

/* string.c: string variable */
#include
main
{
char month [15];
printf (“Enter the string”);
gets (month);
printf (“the string entered is %s”, month);
}

In this example, a string is stored in the character string variable month. The string is displayed by the statement:
printf (“The string entered is %s”, = month)

It is a one dimensional array. Each character occupies a byte. A null character (‘\0’) that has the ASCII value 0 terminates the string. Figure 7.6 shows the storage of the string January in the memory. Recall that \0 specifies a single character whose ASCII value is zero.

Fig. 7.6 String stored in a string vairable month
Example:
/* string2.c: illustration using a string literal */
#include
main ()
{
char strc [] = “This is a string literal”;
printf (“%s”, strc);
}
Run:
This is a string literal

7.5 ARRAYS OF STRINGS
An array of strings is a two dimensional array. Consider an example that initializes 5 names in an array of strings and prints them.

/* starray.c: array of strings */
#include
const int NUM = 5;
const int LENGTH = 9;
main ()
{
int j;
char Name [NUM] [LENGTH] =
(“Tejaswi”, “Prasad”, “Prasanth”, “Prakash”, “Anand”};
for (j=0; j printf (“%s\n”, Name [j]);
}
run:
Tejaswi
Prasad
Prasanth
Prakash
Anand



Fig. 7.7 Array of strings

A string is an array; and Name is an array of strings. It can be represented by a two dimensional array of size [5] [9] as shown in Figure 7.7. The second dimension LENGTH specifies the length of the longest array string (9 characters for Prasanth including the terminal character ‘\0’) and each name is accessed by Names[j]. Here, we do not need the second index. Name [j] is sufficient to access string number j in array.

7.6 FUNCTIONS IN string.h

This section describes the functions that help in manipulating strings. To use these functions, the header file string.h must be included in the program with the statement:
#include
strcat
This function concatenates two strings, i.e., it appends one string at the end of another. The function accepts two strings as parameters and stores the contents of the second string at the end of the first. An example is given below.

/* stract.c: Example program for stract */
#include
#include
void main()
{

/* Declare two strings */
char oneString [10] = “Fish”;
char twoString [] = “face”;
/* Put twoString at the end of onestring. */
strcat (oneString, twoString);
printf (oneString);
}

The output of this program is:

Fish face

The central part of the program is the statement,
Strcat (oneString, twoString);
Which places the characters of twostring at the end ofoneString.

Observe that the declaration of oneString has the subscript 10 specifying the size of the string, while the declaration of twoString does not have any size specified. Recall that in the declaration of arrays, if the subscript is omitted, it is assumed to be size of the data with which the array is initialized. So, while the size of the string oneString is 10 (which means that oneString can hold a maximum of 10 characters), the size of twoString is equal to the size of the string face. This string has 4 characters plus a null character, which makes a total of 5. So, the size of the string twoString is 5.

If we declare oneString with the statement,
Char oneString [] = “Fish”;
then oneString will be able to hold a maximum of 6 characters only. When the statement,
strcat (oneString, twoString);
appends the characters of twoString at the end of oneString, the size of oneString would not suffice. This leads to unpredictable results at run time. Hence, in the above program, onestring is declared by the statement,

char oneString[10] = “fish”;
which is safe, since after concatenation, oneString becomes Fish face, which is 10 characters in length, including the null terminator. In general, whenever you use the stract function, check to see whether the first string is large enough to hold the resultant concatenated string. Note, there is no ‘+’ operator in C that can be applied to strings in order to concatenate them. The function strcat described here exists for that purpose.

Strcomp
The function strcmp compares two strings. This function is useful while writing programs for constructing and searching strings as arranged in a dictionary. The function accepts two strings as parameters and returns an integer, whose value is:
* Less than 0 if the first string is less than the second
* Equal to 0 if both are identical
* Greater than 0 if the first string is greater than the second

The function strcmp compares the two strings, character by character, to decide the greater one. Whenever two characters in the string differ, the string which has the character with a higher ASCII value is greater. For example, consider the strings hello and Hello!!. The first character itself differs. The ASCII code for h is 104, while that for H is 72. Since the ASCII code of h is greater, the string hello is greater than the string Hello!!. Once a differing character is found, there is no need to compare the other characters of the strings. The following code fragment compares two strings and output the result.

char str[30], str2[30];
int cmpResult;
scanf(“%s %s”, str1, str2);
cmpResult = strcmp (str1, str2);
if (cmpResult<0 br=""> printf (“str1 else if (cmpResult == 0)
printf (“str1 ==2”);
else
printf (“str1 > str2”);

A sample run is shown below:

azcd abzzi
str1 > str2

Again, note that the operators <, > and == cannot be used directly with strings. To compare strings, use strcmp.

Strcpy
The strcpy function copies one string to another. The function accepts two strings as parameters and copies the second string character by character into the first one, upto and including the null character of the second string. As in the function strcat, you need to be careful to make sure that the size of the string is greater or equal to the second.

For example the following code:
char str1[] = “Will be overwritten”;
char str2[] = “Will overwrite”;
printf (“Before strcpy str1 is \n”);
printf (“%s \n”, str1);
strcpy(“str1, str2);
printf (“After strcpy str1 is \n”);
printf (“%s\n”, str1);

will output:
before strcpy stril is
Will be overwritten
After strcpy strl is
Will overwrite

The operator = cannot be used to assign one string to another. Use strcpy for this purpose.
strlen
This function returns an integer which denotes the length of the string passed. The length of a string is the number of characters present in it, excluding the terminating null character. For example,

char str[] = “Hello”;
printf (“%d\n”, strlen (str));
will output 5, since there are 5 characters in the string Hello.
More on string library functions is given in the chapter on pointers.

7.7 PROGRAMMIN EXAMPLES

Example

/* dup.c: Deleting duplicates in a Vector */
#include
main()
{
int i,j,k,n,num,flag = 0;
float a[50];
printf (“Size of vector ? “);
scanf (“%d”, &n);
num = n;
printf (“\n Vector elements ? \n”)
for (i=0; i scanf (“%f”, &a[i]);
/* removing duplicates */
for (i=0; i for (j=I+1; j {
if (a[i] == a[j])
{
n=n – 1;
for (k=j; k a[k] = a[k+1];
flag = 1;
j=j-1;
}
}
/* use of IF and ELSE statement */
if (flag == 0)
printf (“\n No duplicates found in vector \n”);
else
{
printf (“\n Vector has %d duplicates”, num –n);
printf (“Vector after deleting duplicates : \n”);
for (i=0; i printf (“% 6.2f”, a[i]);
printf (“\n”);
}
}

Run:
Size of vector 7 6
Vector elements ?
1.00 2.00 1.00 3.00 2.00 4.00
Vector has 2 duplicates
Vector after deleting duplicates:
1.00 2.00 3.00 4.00

Example
/* grade.c: Calculating grades of ‘N’ students from 3 tests */
#include
main()
{
int i,j,k,n,m;
float a[50] [10], sum, avg;
char grade [50];
printf (“Number of students ?”);
scanf (“%d”, &n);
for (i=0; i {
sum = 0.0;
printf (“\n Enter 3 scores of student-%d \n”, i+1);
for (j=0; j<3 br="" i=""> {
scanf (“%f”, &a[i][j]);
sum += a[i] [j];
}
avg = sum / 3.0;
a [i] [3] = avg;
if (avg <30 .0="" br="" else="" if..="" of="" use=""> grade [i] = ‘E’;
else if (avg <45 .0="" br=""> grade [i] = ‘D’;
else if (avg <60 .0="" br=""> grade [i] = ‘C’;
else if (avg <75 .0="" br=""> grade [i] = ‘B’;
else
grade [i] = ‘A’;
}

printf (“\n Sl.no. Scores Average Grade \n”);
printf (“\n--------------------------------------\n\n”);
for (i=0; i {
printf (“%d.”, i+1);
for (j=0; j<4 br="" j=""> printf (“%82f”, a[i] [j]);
printf (“%6c”, grade [i]);
printf (“\n”);
printf (“\n--------------------------------------\n\n”);
}
}

Run:
Number of students ? 5
Enter 3 scores of student –1
67.00 86.00 58.00
Enter 3 scores of student –2
20.00 30.00 23.90
Enter 3 scores of student –3
80.00 97.00 73.00
Enter 3 scores of student –4
56.80 47.90 62.00
Enter 3 scores of student –5
45.00 35.00 40.00

Sl.No. SCORES AVERAGE GRADE
------------------------------------------------------------------------------------------------
1. 67.00 86.00 58.00 70.33 B
2. 20.00 30.00 23.00 24.63 E
3. 80.00 97.00 73.00 83.33 A
4. 56.80 47.90 62.00 55.57 C
5. 45.00 35.00 58.00 70.33 B
------------------------------------------------------------------------------------------------

Example

/* var.c: Calculating Mean, Variance and standard deviation */
#include
#include
main()
{
int i,n;
float x[50], mean, variance, sdn;
float sumsq = 0.0, sum = 0.0;
printf (“Calculating standard deviation of a\n”);
printf (“\n Enter size of the list:”);
scanf (“%d”, &n);
printf (“\n Enter the %d items \n”, n);
for (i=0; i {
scanf (“%f”, &x[i]);
sum += x[i]);
}
mean = sum/(float) n;
/* Computing variance */
for (i=0; i sumsq = sumsq + (mean – x[i])* (mean – x[i]);
variance = sumsq/(float)n;
sdn = sqrt (variance); /* Standard deviation */
printf (“\n\n Mean of %5d items : %10.6f\n”,n,mean);
printf (“\n variance : %10.6f\n”,varaince);
printf (“\n Standard Deviation : % 10.6f\n”,sdn);
}
Run:
Calculating standard deviation of a
Enter size of the list : 7
Enter the 7 items
32.00 11.00 90.00 34.00 52.00 24.00 7.00
Mean of 7 items : 35.714287
Variance : 685.918396
Standard Deviation : 26.190044

Example

/* norm.c: Program to compute the norm of the matrix */
#include
#include
main()
{
int i,j,m,n;
float norm, a[10] [10];
float nrm (float [] [], int, int);
printf (“Input row and column of A matrix:”);
scanf (“%d %d”, &n, &m);
printf (“%d %d n”, n,m);
printf (“Input A-matrix \n”);
for (i=0; i for (j=0; j scanf (“%f”, &a[i] [j]);
norm = nrm (a,n,m);
printf (“Norm = %6.2f \n”, norm);
} /* End of main */
/* norm of a matrix = sqsuareroot of the sum of the */
/* squares of the elements of the matrix */
float nrm
(float a[] [], int n, int m)
{
int i,j;
float sum = 0.0;
for (i=0; i for (j=0; j sum = sum + a[i] [j] * a[i] [j];
printf (“Sum = %6.24\n”, sum);
return (sqrt ((double)sum));
}
Run:
Input row and column of A matrix : 3 3
Input A-marix

1.00 2.00 3.00
4.00 5.00 6.00
7.00 8.00 9.00

Sum = 285.00
Norm – 16.88

Example

/* saddle.c: Program to find saddle point in a matrix */
#include
main()
{
int a[5] [5], i,j,min,max,n,m,flag=1,p,q;
printf (“Input the size of matrix:”);
scanf (“%d %d”, &n, &m);
printf (“Enter the elements of the matrix \n”);
for (i=0; i for (j=0; j scanf (“%d”, &a[i] [j]);
/* Find minimum element in row */
for (i=0; i {
min = a[i] [0];
p=i;
q = 0;
/* To check whether ‘min’ is the maximum in column */
for (j=0; j {
if (min>a[i] [j])
{
min=a[i] [j];
p = i;
q = j;
}
}
for (j=0; j{
if(j ! = q)
{
if (a[j] [q] > a[p] [q])
flag = 0;
}
}
if (flag)
printf (“Saddle point a [%d] [%d] = %d\n”, p+1, q+1, a[p] [q]);
else
printf (“No saddle point in row %d\n”, i+1);
flag = 1;
}
}

Run:
Input the size of matrix : 3 3
Enter the elements of the matrix

7 5 5
10 5 8
6 3 3
Saddle point a[1] [2] = 5
Saddle point a [2] [2] = 5
No saddle point in row 3

Example

/* sym.c: Program to find the symmetry of the matrix */
#include
main()
{
int a[10] [10], b[10] [10],i,j,n, flag;
printf (“Input order of the A matrix);
scanf (“%d”, &n);
printf (“Input A-matrix\n”);
for (i=0; i for (j=0; j scanf (“%d”, &a[i] [j]);
/* Transpose of the given Matrix */
for (i=0; i for (j=0; j b[i][j] = a[j] [i];
printf (“Transpose of A matrix : \n”);
for (i=0; i {
for (j=0; j printf (“%5d”, b[i] [j]);
printf (“\n”);
}
/* Find symmetry of a matrix */
for (i=0; i if (a[i] [j] != b[i] [j])
flag = 1;
}
if (flag)
printf (“Matrix is not symmetric \n”);
else
printf (“Matrix is symmetric \n”);
} /* main */

Run 1:
Input order of A matrix : 2 2
Input A-matirx
1 2
3 4
Transpose of A matrix:
1 2
3 4
Matrix is not symmetric

Run 2:
Input order of A matrix : 3 3
Input A – Matrix
1 2 5
2 3 4
5 4 9
Transpose of A – Matrix
1 2 5
2 3 4
5 4 9
Matrix is symmetric


{
min = a[i] [0];
p=i;
q = 0;
/* To check whether ‘min’ is the maximum in column */
for (j=0; j {
if (min>a[i] [j])
{
min=a[i] [j];
p = i;
q = j;
}
}
for (j=0; j{
if(j ! = q)
{
if (a[j] [q] > a[p] [q])
flag = 0;
}
}
if (flag)
printf (“Saddle point a [%d] [%d] = %d\n”, p+1, q+1, a[p] [q]);
else
printf (“No saddle point in row %d\n”, i+1);
flag = 1;
}
}

Run:
Input the size of matrix : 3 3
Enter the elements of the matrix

7 5 5
10 5 8
6 3 3
Saddle point a[1] [2] = 5
Saddle point a [2] [2] = 5
No saddle point in row 3


Tutorial
1. What is an array?
2. How is the integer array a, containing 100 elements, declared in C?
3. What is the subscript of the first element of an array in C?
4. What are the rules for naming arrays?
5. How would you declare an array x containing 50 integer elements followed immediately by 50 real elements?
6. What is the purpose of initializing an array?
7. Is it possible to declare and initialize an array in C simultaneously? If, so, how?
8. If array1 and array2 are dimensioned as follows:
Char array1 [10], array2[10];
and array1 has been initialized, what is the effect of the following?
array2 = array1;
9. What purpose is served by the break statement?
10. What criticism can be leveled against the break statement?
11. Explain the operation of the following expression (assume y has the value 5):
x = (y *=2) + (z=a=4);
12. How is a string stored in an array in C?
13. What declaration would be used for the array bingo, into which the string “I love C” is to be stored?
14. What conversion specification usually is used to read in a string?
15. When the conversion specification %s is used in a scanf statement to read in a string, what is unusual about the way the name of the array is specified?
16. How can one ensure that a scanf statement used to read in a string does not read in more characters than the corresponding character array can hold?
17. Is it obligatory to use all the elements of an array?
18. When a one-dimensional array is being declared, under what condition may the dimension be omitted, with the array name followed by an empty pair of square brackets?
19. What happens if an array is being initialized within its declaration, and too few initialization values are specified within the curly braces?
20. What happens if the number of initializing values is greater than the dimension specified for the array?
21. Must the elements of an array be read in or printed out in order or subscript?
22. When sorting the elements of an array, is it necessary to use another array to store the sorted elements?
23. Where is it legal to declare a new variable?
24. What is the name of the construct used in the following statement, ad how does it operator?
A = (b>c) ? b : c;
25. What is the maximum number of dimensions an array in C may have?
26. True or false: If all the elements of a two-dimensional array are initialized in the declaration of the array, both subscriptions may be omitted.

ANSWERS TO C TUTORIAL

1. An array is an ordered collection of elements that share the same name.
2. int a[100]
3. 0 (zero)
4. The same as for naming regular variables or functions. An array cannot have the same name as a variable or function within the same program.
5. It can’t be done. (All elements of a single array must be of the same type).
6. Before any element of an array can be used, it must have a value. Initializing an array gives a value to each of its elements.
7. Yes. The array declaration is followed immediately by an equal sign. This is followed by the list of values to be assigned (separated by commas) enclosed in braces.
8. A syntax error is fledged by the compiler. One array cannot be assigned to another using the assignment operator. Each element must be assigned individually.
9. It provides a means of immediately terminating the execution of a loop.
10. It violates the tenets of structured programming, in that it permits a jump to another part of the program.
11. The first set of parentheses is evaluated first, multiplying the value of y by 2; the new value of y, 10, is returned by the sub-expression. The second set of parentheses is then evaluated, assigning 4 to a and z and returning that value. The values returned by the two sub-expressions (10 and 4) then are added together to produce the result of 14, which is assigned to x.
12. It is terminated by the null character, which has the ASCII value 0 and is written in C as ‘\0’.
13. Char bingo [9]; /* One element is reserved for the null
Character, ‘\0’ */
14. %s
15. The ampersand (&) is not used, and the array is not subscripted.
16. A maximum field width specifier should be used with the 1%s conversion specification; for example, %10s.
17. No, but the program must keep track of how many elements are are being used, and which ones.
18. If the entire array is being initialized within the declaration.
19. This is perfectly acceptable, as long as the dimension is specified explicitly in the declaration. The initialization values that are specified are assigned to consecutive elements of the array, starting with element 0. The remaining elements are initialized to zero.
20. A syntax error occurs during compilation of the program, and the compilation is aborted.
21. No. the elements of an array (even a character array) may be accessed in any order at all.
22. Not always. In this chapter, the method employed did not use another array. The advantage to using another array is that the original array is retained. Its advantage is that it uses extra memory.
23. At the beginning of the body of a function, and at the beginning of a compound statement.
24. The statement makes use of the conditional expression. If b is greater than c, the conditional expression returns the value of b (the value following the ?); otherwise, it returns the value of c (the value following the :). The returned value is assigned to a. The overall effect is that the larger of the two variables b and c is assigned to a.
25. Theoretically, there is no limit. The only practical limits are memory size and the restrictions imposed by the compiler being used.
26. False. Only the first (row) subscript can be omitted, with the first pair of square brackets left empty. The second subscript must always be explicitly specified.

Keywords
break char do double else float
for if int long return short
unsigned

Exercises
1. What are the arrays? In C, can you have arrays of any data type?
2. In C, what is the index of the first element in an array?
3. What does the name of the array signify?
4. Can array indexes be negative?
5. Illustrate the initialization of a one dimensional array with an example.
6. Illustrate the initialization of a two dimensional array with an example.
7. Show the storage of a two dimensional array in memory with the help of a diagram.
8. Write a program to determine whether a matrix singular or not (solution 4).
9. Write a program to find the inverse of a square matrix (solution 5).
10. Write a program to test for the orthogonality of a square matrix (solution 6).
11. Write a program to maintain a circular queue in an array (solution 7).
12. Implement the following sorting techniques:
(i) bubble sort (solution 8)
(ii) selection sort (solution 9)
(iii) merge sort (solution 10)
(iv) quick sort (solution 11)
(v) heap sort (solution 12)
13. Write a program to find the minimum cost spanning tree by using:
(i) Prim’s algorithm (solution 13)
(ii) Krushkal’s algorithm (solution 14).
14. Solve the 8 queens problem using backtracking (solution 15).
15. Write a program to perform polynomial addition (solution 29).
16. What is the null character and what is it used for, in the context of strings?
17. Point out the difference between:
(i) strcat and strncat
(ii) strcmp and strncmp
18. Write the name of the function in string.h which:
(i) performs case insensitive string comparison
(ii) searches for a character inside a string
(iii) searches for a string inside another string.
19. What happens if the total size of the string after strcat becomes greater than the array size of the string used to hold the concatenated string? Does the compiler report an error?
20. Write a program to concatenate two strings (solution 1).
21. Write a program to count the number of vowels, consonants and spaces in a line (solution 2).





EXAMAPERS123.BLOGSPOT.COM


Tuesday, October 26, 2010

INFOSYS PLACEMENT PAPER





INFOSYS PLACEMENT PAPER ON 10 th SEPTEMBER2006 AT CHENNAI :





SUCCESS FOR CAREER

INFOSYS PLACEMENT PAPER 
Exercise 1:
The passage given below is followed by questions based on its content. Read the passage & choose the best answer 4 the questions
The Death Car
It was cold night in September. The rain was drumming on the car roof as George & Marie Winston drove through the empty country roads towards the house of their friends, the Harrison’s, where they were going to attend a party to celebrate the engagement of the Harrison’s daughter, Lisa. As they drove, they listened to the local radio station, which was playing classical music. They were about 5 miles from the destination when the music on the radio was interrupted by a news announcement: “The Cheshire police have issued a serious warning after a man escaped from Colford Mental Hospital earlier this evening. The man, John Downey, is murderer who killed 6 people before he was captured 2 years ago. He is described as large, very strong & extremely dangerous. People in the Cheshire area are warned to keep their doors & windows locked, & to call the police immediately if they se anyone acting strangely.” Marie shivered, “A crazy killer. And he’s out there somewhere. That’s scary.” Don’t worry about it,” said her husband. “We’re nearly there now. Anyway, we have more important things to worry about. This car is losing power for some reason—it must be that old problem with the carburetor, If it gets any worse, we’ll have to stay at the Harrison’s’ tonight & get it fixed before we travel back tomorrow,” As he spoke, the car began to slow down, George pressed the accelerator, but the engine only coughed. Finally they rolled to a halt, as the engine died completely, Just as they stopped, George pulled the car off the road, & it came to rest under a large tree. “Blast!” said George angrily. “Now we’ll have to walk in the rain.” “But that’ll take us an hour at least,” said Marie. “And I have my high-held shoes & my nice clothes on. They’ll be ruined!” “Well, you’ll have to wait while I run to the nearest house & call the Harrison’s. Someone can come out & picks us up,” said George. “But George! Have you forgotten what the radio said? There’s a homicidal maniac out there! You can’t leave me alone here!” “You’ll have to hide in the back of the car. Lock all the doors & lie on the floor in the back, under this blanket. No-one will see you, when I come back, I’ll knock 3 times on the door. Then you can get up & open it. Don’t open it unless you here 3 knocks.” George opened the door & slipped out into the rain. He quickly disappeared into the blackness. Marie quickly locked the doors & settled down under the blanket in the back for a long wait. She was frightened & worried, but she was a strong-minded woman. She had not been waiting long, however, when she heard a strange scratching noise. It seemed to be coming from the roof of the car. Marie was terrified. She listened, holding her breath. Then she heard 3 slow knocks, one after the other, also on the roof of the car. Was it her husband? Should she open the door? Then she heard another knock, and another. This was not her husband. It was somebody--or something--else. She was shaking with fear. But she forced herself to lie still. The knocking continued-- bump, bump, bump, bump many hours later, as the sun rose, she was still lying there. She had not slept for a moment. The knocking had never stopped, all night long. She did not know what to do. Where was George? Why had he not come for her?
Suddenly, she heard the sound of 3 or 4 vehicles, racing quickly down the road. All of them pulled up around her, their tires screeching on the road. At last! Some one had come! Marie sat up quickly & looked out the window.
The 3 vehicles were all police cars, & 2 still had their lights flashing. Several policemen leap out. One of them rushed towards the car as Marie opened the door. He took her by the hand.
“Get out of the car & walk with me to the police vehicle. Miss. You’re safe now. Look straight ahead. Keep looking at police car. Don’t look back. Just don’t look back.”
Something in the way he spoke filled Marie with cold horror. She could not help herself. After 10 yards from the police car, she stopped, turned & looked back at the empty vehicle.
George was hanging from the tree above the car, a rope tied around his neck. As the wind blew his body back & forth, his feet were bumping gently on the roof of the car-- bump, bump, bump, bump

1) What was the reason for the news announcement on the radio?
a) 6 people. Including John Downey, had been murdered?
b) A dangerous prisoner had escaped
c) The police were warning of accidents on the roads in the bad weather
d) Some people had bens en acting strangely in the Cheshire area

2) What did George think was causing trouble with the car?
a) The carburetor
b) The rain drumming on the roof
c) The accelerator
d) He had no idea

3) Why did he pull the car off the road?
a) To have a rest
b) To go for a walk
c) To walk to the nearest house
d) It broke down

4) Why did Marie stay in the car when George left?
a) She was afraid to go out in the dark
b) So no one could steel the car
c) Her clothes weren’t suitable for the rain
d) She wanted to get some sleep

5) Where did George set off to walk?
a) The mental hospital
b) The nearest house
c) The Harrison’s house
d) The police station

6) What made Marie as frightened as she waited in the car?
a) There was a strange sound coming from the roof
b) She could see a man strangely outside the car
c) Some police cars came racing down the road
d) She was afraid of the rain and the dark

Exercise 2:
Each sentence below has 1 or 2 blanks – each blank indicating that something has been omitted. Beneath the sentence are some words. Choose the word for each blank that best fits the meaning of the sentence as a whole

7) Athletes have so perfected their techniques in track and field events that the _________ becomes _________ before record books
a) Announcement …………public
b) Meet…………………….official
c) Time…………………….authentic
d) Fantastic………………...common place

8) A________ child, she was soon bored in class; she already knew more mathematics than her junior school teachers
a) Obdurate
b) Precocious
c) Recalcitrant
d) Contemporary

9) The subtle shades of meaning, & still subtler echoes of association, make language an instrument which scarcely anything short of genius can wield with ____________ & ________________
a) Confidence----------aloofness
b) Definiteness---------certainty
c) Sincerity--------------hope
d) Eloquence------------ruthlessness

10) Unwilling to admit that they had been in error, the researchers tried to_______ tried case with more data obtained from dubious sources
a) Ascertain
b) Buttress
c) Refute
d) Dispute

11) His one vice was gluttony & so it is not surprising that as he aged he became increasingly_______________
a) Despondent
b) Corpulent
c) Carping
d) Lithe
Exercise 3:
Please read all the questions in the table below (12-21) as one continuous passage. Tick the verb with right tense or the correct word to fill in the gaps in each of the sentences.

Statement Options
12) A famous singer had been contracted to sign at a Paris opera house & ticket sales_______________ booming. a) is
b) are
c) were
d) have been
13) In fact, the night of the concert, the house was packed; every ticket ________________ a) is selling
b) was selling
c) sold
d) had been sold

14) The feeling of anticipation & excitement was in the air as the house manager__________ the stage & said, “Ladies & gentlemen, thank you for your enthusiastic support! a) took
b) takes
c) had taken
d) was taking
15) I am afraid that due to illness, the man whom you’ve all come to hear________________ performing tonight a) will not be
b) has not been
c) had not been
d) was not
16) However, we _________ a suitable substitute who, we hope, will provide you with comparable entertainment.” a) are finding
b) were finding
c) had found
d) have found
17) The crowd____________ in disappointment & failed to hear the announcer mention the stand-in’s name a) groans
b) groaned
c) had groaned
d) were groaning

18) The environment turned from excitement to frustration
The stand-in performer__________ the performance everything he had. a) will give
b) had given
c) gave
d) gives
19) When he had finished, there was nothing but an uncomfortable silence. No one _____________ a) Applauded
b) Applauds
c) Was applauding
d) Has applauded
20) Suddenly, from the balcony, a little boy stood up and____________, “Daddy, I think you’re wonderful!” a)shouts
b) was shouting
c) had shouted
d) shouted
21) The crowd_________________ into thunderous applause a) breaks
b) broke
c) had broken
d) was breaking
Exercise 4:
From each group of sentences given below, indicate the sentence that contains the error:

22) Group 1
a) Driving long distances causes’ sleepiness & sleepiness causes serious accidents.
b) On a table at the rear of the room were a notebook, a pair of scissors, & biology textbook
c) Finally, there seems to be a growing interest in vegetarianism in this country
d) Either the local chief of police or his officers are guilty of violating the rights of prisoners

23) Group 2
a) Simple cookbooks for inexperienced cooks have become quite popular in recent years they are available at many bookstores
b) Some cookbooks, such as The Joy of cooking, have been classics for generations
c) One popular cookbook is The Art of French Cooking, by Julia Child, a colorful character who charmed television audiences for many years
d) The Art of French Cooking blends classic recipes with meticulous explanation; ordinary cooks find the recipes manageable

24) Group 3
a) Around 50% of the forest is destroyed every year
b) The bus leaves tomorrow morning
c) A tiger is a dangerous animal
d) Can you please the sugar?

25) Group 4
a) There must be some mistake. I should have scored more marks
b) The number of trainees is hundred
c) 50% of the houses need repairs
d) The Commissioner, along with his family members was seen the party

26) Group 5
a) The scissors is very sharp
b) Congratulations are in order
c) One of the cases is open
d) She plays tennis well but she’ll never be a Steffi Graf

Exercise 5:
Please mark the correct statement from the pairs given below:

27) Pair 1
a) Repeated occurrences cannot be ignored
b) Repeated occurrences cannot be ignored

28) Pair 2
a) We need to get a consensus on the decision
b) We need to get a consensus on the decision

29) Pair 3
a) Only authority personnel are allowed in this area
b) Only authorized personnel are allowed in this area

30) Pair 4
a) The actress decided to sue the sleazy tabloid for deformation of her character
b) The actress decided to sue the sleazy tabloid for defamation of her character

31) Pair 5
a) Everyone knows that Hogwarts in the Harry Potter series is a mythical school
b) Everyone knows that Hogwarts in the Harry Potter series is a legendary school

32) Pair 6
a) Most people think caffeine is not good for health
b) Most people think caffeine is not good for health

Exercise 6:
Select the best word/phrase/line to complete each sentence in the most appropriate manner

33) ‘Reema’s bad-mouthing Peter only because she is jealous of him.’ Means______________
a) Peter really is a nice person
b) Peter really is a mean person
c) Peter really is a difficult person
d) Peter really is a tough person

34) If some one is “gung ho”, they are_______
a) stupid
b) Childish
c) Enthusiastic
d) Loud

35) Mr. Hughes has been asked to___________ this difficult project because of his experience working for many years in Iran
a) Undergo
b) Understand
c) Undervalue
d) Undertake

36) ‘Stop talking to those angry men, you are just adding fuel to the fire’ is the same as________
a) Stop talking to those angry men, you are just coming in the way
b) Stop talking to those angry men, you are just making it worse
c) Stop talking to those angry men, you are just adding to the noise
d) Stop talking to those angry men, you are just talking too much

37) ‘Sudhir’s work is behind schedule – I think he bit more than he could chew’ is the same as________
a) Sudhir has taken too much of work
b) Sudhir takes very long breaks
c) Sudhir does not know how to do the work
d) Sudhir is a lazy person

38) There are many__________ to our rules, and I do not think that’s fair.
a) Examples
b) exceptions
c) Instances
d) provisions
Exercise 7:
Choose the correct / most appropriate word/s to fill in the gap in the sentences given below.

39) I didn’t set _________ to do this but I’m pleased with the result.
a) in
b) out
c) on
d) down

40) This looks too heavy,______________ pick it up?
a) Can I
b) may I
c) need I
d) would I

41) I am glad so many people have passed the test. In fact, there were_________ who haven’t.
a) little
b) a little
c) few
d) a few

42) Pope John Paul II ___________ more than 90 countries.
a) has visited
b) was visited
c) visits
d) has been visiting

43) I _____________ Carl since I ______________ a little child.
a) have known, have been
b) have known, was
c) knew, have been
d) knew, was

44) I wonder if _____________ will show up at the meeting?
a) someone
b) anyone
c) one
d) everyone

45) Have you given up______________.
a) to smoke
b) smoke
c) some smoking
d) smoking




EXAMAPERS123.BLOGSPOT.COM

SYNONYMS





SYNONYMS ASKED IN TCS N KANBAY TILL NOW :

SYNONYMS

Admonish= usurp
Adhesive = tenacious, sticky, glue, gum, bonding agent
Alienate = estrange
Bileaf = big screen, big shot, big success
Belief = conviction
Baffle = puzzle
Brim = edge
Covet = to desire
Caprice = whim
Concur = similar, acquiesce
Confiscate = appropriate, to take charge, to annex
Cargo = load, luggage
Dispel = scatter
Divulge = reveal, make known, disclose
Discretion = prudence
Emancipate = liberate
Efface = obliterate
Embrace = hug, hold, cuddle
Furtive = stealthy
Heap = to gather
Hamper = obstruct
Heap = to pile
Hover = linger
Incentive = spur
Instigate = incite
Inert = passive
Latitude = scope
Lethargy = stupor
Lamont = lakes, lamentable
Lament = wail
Latent = potential
Merry = Enjoy
Meager = small, little, scanty
Misery = distress
Momentary = for small time
Merit = to deserve
Miserable = unhappy, sad
Obstinate = stubborn
Overt = obvious, clear, explicit, evident
Pretentious = ostentatious
Potential = ability
Rinaile = rigorous
Renounce= reject
Solicit = Humble, urge
Subside = wane
Stifle = snits
Tranquil = calm, silent, serene
To merit- to deserve
Volume = quantity
Veer = diverge
Wethargy = well wisher

SYNONYMS ASKED IN WIPRO N POLARIS N SATYAM :
1] Depreciation = deflation,depression,devaluation,fall,slump
2] Depricate = feel and express disapproval
3] Incentive = thing one encourages one to do
4] Echelon = level of authority or responsibility
5] Innovation = make changes or introduce new things
6] Intermittant = externally stopping and then starting
7] Detrimental = harmful
8] Mesotiate = ...
9] Conciliation = make less angry or more friendly
10] Orthodox = conventional or superstitious
11] Fallible = liable to err
12] Volatile = ever changing
13] Manifestion = clear or obvious
14] Connotation =
15] Reciprocal = reverse, opposite
16] Agrarian = related to agriculture
17] Vacillate = undecided or dilemma
18] Experdent = fitting proper , desirable
19] Simulate = produce artificially resembling an existing one
20] Access = to approach
21] Compensation= salary
22] Truncate = shorten by cutting
23] Adherance = stick
24] Heterogenous = non-similar things
25] Surplus = excessive
26] Assess = determine the amount or value
27] Cognezance = knowledge
28] Retrospective = review
29] Naive = innocent , rustic
30] Equivocate = tallying on both sides
31] Postulate = frame a theory
32] Latent = dormant,secret
33] Fluctuate = wavering
34] Eliminate = to reduce
35] Affinity = strong liking
36] Expidite = hasten
37] Console = to show sympathy
38] Adversary = opposition
39] Affable = lovable,approchable
40] Decomposable = rotten
41] Agregious = apart from crowd,especially bad
42] Conglomeration = group
43] Aberration = deviation
44] Erudite = wise, profound
45] Augury = prediction
46] Credibility = ability to common belief,quality of being credible



EXAMAPERS123.BLOGSPOT.COM






SYNONYMS ASKED IN HUGHES N ACCENTURE N MBT N INAUTICS :

admonish = usurp (reprove)
merry = gay
alienate = estrange (isolate)
instigate = incite
dispel = dissipate (dismiss)
belief = conviction
covet= crave (desire)
belated = too late
solicit = beseech (seek)
brim = border
subside = wane (drop)
renounce= reject
hover = linger (stay close)
divulge = reveal
heap = to pile (collect)
adhesive = tenacious
veer = diverge (turn)
hamper = obstruct
caprice = whim (impulse)
to merit= to deserve
stifle = suffocate (smother)
inert = passive
latent = potential (inactive)
latitude = scope
concur = acquiesce (accept)
momentary = transient
tranquil = serene (calm)
admonish = cautious
lethargy = stupor (lazy)
volume = quantity
furtive= stealthy (secret)
meager = scanty
cargo = freight(load)
baffle = frustrate
efface = obliterate(wipe out)
misery = distress
pretentious = ostentatious(affected)
discretion = prudence
compunction = remorse (regret)
amiable = friendly
cajole = coax (wheedle – sweet talk)
incentive = provocation
Embrace = hug (hold-cuddle)
latent = potential
Confiscate = appropriate (to take charge)
emancipate = liberate
lament = mourn
confiscate = appropriate
obstinate = stubborn
acumen = exactness
metamorphosis = transform
scrutiny = close examination
annihilate = to destroy
fuse = combine
whet = sharpen
behest = request
adage = proverb
penitence = to repeat



EXAMAPERS123.BLOGSPOT.COM

Software QA and Testing



Software QA and Testing Frequently-Asked-Questions

Software QA and Testing


1. What is 'Software Quality Assurance'?

Software QA involves the entire software development PROCESS - monitoring and improving the process, making sure that any agreed- upon standards and procedures are followed, and ensuring that problems are found and dealt with. It is oriented to 'prevention'.

2.What is 'Software Testing'?

Testing involves operation of a system or application under controlled conditions and evaluating the results (eg, 'if the user is in interface A of the application while using hardware B, and does C, then D should happen'). The controlled conditions should include both normal and abnormal conditions. Testing should intentionally attempt to make things go wrong to determine if things happen when they shouldn't or things don't happen when they should. It is oriented to 'detection'.

3.What are some recent major computer system failures caused by software bugs?

In April of 2003 it was announced that the largest student loan company in the U.S. made a software error in calculating the monthly payments on 800,000 loans. Although borrowers were to be notified of an increase in their required payments, the company will still reportedly lose $8 million in interest. The error was uncovered when borrowers began reporting inconsistencies in their bills.

News reports in February of 2003 revealed that the U.S. Treasury Department mailed 50,000 Social Security checks without any beneficiary names. A spokesperson indicated that the missing names were due to an error in a software change. Replacement checks were subsequently mailed out with the problem corrected, and recipients were then able to cash their Social Security checks.

In March of 2002 it was reported that software bugs in Britain's national tax system resulted in more than 100,000 erroneous tax overcharges. The problem was partly attibuted to the difficulty of testing the integration of multiple systems.

A newspaper columnist reported in July 2001 that a serious flaw was found in off-the-shelf software that had long been used in systems for tracking certain U.S. nuclear materials. The same software had been recently donated to another country to be used in tracking their own nuclear materials, and it was not until scientists in that country discovered the problem, and shared the information, that U.S. officials became aware of the problems. According to newspaper stories in mid-2001, a major systems development contractor was fired and sued over problems with a large retirement plan management system. According to the reports, the client claimed that system deliveries were late, the software had excessive defects, and it caused other systems to crash.






In January of 2001 newspapers reported that a major European railroad was hit by the aftereffects of the Y2K bug. The company found that many of their newer trains would not run due to their inability to recognize the date '31/12/2000'; the trains were started by altering the control system's date settings.News reports in September of 2000 told of a software vendor settling a lawsuit with a large mortgage lender; the vendor had reportedly delivered an online mortgage processing system that did not meet specifications, was delivered late, and didn't work.
In early 2000, major problems were reported with a new computer system in a large suburban U.S. public school district with 100,000+ students; problems included 10,000 erroneous report cards and students left stranded by failed class registration systems; the district's CIO was fired. The school district decided to reinstate it's original 25-year old system for at least a year until the bugs were worked out of the new system by the software vendors.

In October of 1999 the $125 million NASA Mars Climate Orbiter spacecraft was believed to be lost in space due to a simple data conversion error. It was determined that spacecraft software used certain data in English units that should have been in metric units. Among other tasks, the orbiter was to serve as a communications relay for the Mars Polar Lander mission, which failed for unknown reasons in December 1999. Several investigating panels were convened to determine the process failures that allowed the error to go undetected.

Bugs in software supporting a large commercial high-speed data network affected 70,000 business customers over a period of 8 days in August of 1999. Among those affected was the electronic trading system of the largest U.S. futures exchange, which was shut down for most of a week as a result of the outages.

In April of 1999 a software bug caused the failure of a $1.2 billion military satellite launch, the costliest unmanned accident in the history of Cape Canaveral launches. The failure was the latest in a string of launch failures, triggering a complete military and industry review of U.S. space launch programs, including software integration and testing processes. Congressional oversight hearings were requested.

A small town in Illinois received an unusually large monthly electric bill of $7 million in March of 1999. This was about 700 times larger than its normal bill. It turned out to be due to bugs in new software that had been purchased by the local power company to deal with Y2K software issues.














4.Why is it often hard for management to get serious about quality assurance?

Solving problems is a high-visibility process; preventing problems is low-visibility. This is illustrated by an old parable:

In ancient China there was a family of healers, one of whom was known throughout the land and employed as a physician to a great lord. The physician was asked which of his family was the most skillful healer. He replied,"I tend to the sick and dying with drastic and dramatic treatments, and on occasion someone is cured and my name gets out among the lords." "My elder brother cures sickness when it just begins to take root, and his skills are known among the local peasants and neighbors." "My eldest brother is able to sense the spirit of sickness and eradicate it before it takes form. His name is unknown outside our home."

5.Why does software have bugs?

Miscommunication or no communication - as to specifics of what an application should or shouldn't do (the application's requirements).software complexity - the complexity of current software applications can be difficult to comprehend for anyone without experience in modern-day software development. Windows-type interfaces, client-server and distributed applications, data communications, enormous relational databases, and sheer size of
applications have all contributed to the exponential growth in software/system complexity. And the use of object-oriented techniques can complicate instead of simplify a project unless it is well-engineered.

Programming errors - programmers, like anyone else, can make mistakes.

Changing requirements - the customer may not understand the effects of changes, or may understand and request them anyway - redesign, rescheduling of engineers, effects on other projects, work already completed that may have to be redone or thrown out, hardware requirements that may be affected, etc. If there are many minor changes or any major changes, known and unknown dependencies among parts of the project are likely to interact and cause
problems, and the complexity of keeping track of changes may result in errors. Enthusiasm of engineering staff may be affected. In some fast-changing business environments, continuously modified requirements may be a fact of life. In this case, management must understand the resulting risks, and QA and test engineers must adapt and plan for continuous extensive testing to keep the inevitable bugs from running out of control

Time pressures - scheduling of software projects is difficult at best, often requiring a lot of guesswork. When deadlines loom and the crunch comes, mistakes will be made.





Egos - people prefer to say things like:
'no problem'
'piece of cake'
'I can whip that out in a few hours'
'it should be easy to update that old code'
Instead of:
'that adds a lot of complexity and we could end up making a lot of mistakes'
'we have no idea if we can do that; we'll wing it'
'I can't estimate how long it will take, until I
take a close look at it'
'we can't figure out what that old spaghetti code did in the first place'
If there are too many unrealistic 'no problem's', the result is bugs.

Poorly documented code - it's tough to maintain and modify code that is badly written or poorly documented; the result is bugs. In many organizations management provides no incentive for programmers to document their code or write clear, understandable code. In fact, it's usually the opposite: they get points mostly for quickly turning out code, and there's job security if nobody else can understand it ('if it was hard to write, it should be hard to read').

Software development tools - visual tools, class libraries, compilers, scripting tools, etc. often introduce their own bugs or are poorly documented, resulting in added bugs .


6.How can new Software QA processes be introduced in an existing organization?

A lot depends on the size of the organization and the risks involved. For large organizations with high-risk (in terms of lives or property) projects, serious management buy-in is required and a formalized QA process is necessary.
Where the risk is lower, management and organizational buy-in and QA implementation may be a slower, step-at-a-time process. QA processes should be balanced with productivity so as to keep bureaucracy from getting out of hand.
For small groups or projects, a more ad-hoc process may be appropriate, depending on the type of customers and projects. A lot will depend on team leads or managers, feedback to developers, and ensuring adequate communications among customers, managers, developers, and testers.
In all cases the most value for effort will be in requirements management processes, with a goal of clear, complete, testable requirement specifications or expectations .










7.What is verification? validation?

Verification typically involves reviews and meetings to evaluate documents, plans, code, requirements, and specifications. This can be done with checklists, issues lists, walkthroughs, and inspection meetings. Validation typically involves actual testing and takes place after verifications are completed. The term 'IV & V' refers to Independent Verification and Validation.

8.What is a 'walkthrough'?

A 'walkthrough' is an informal meeting for evaluation or informational purposes. Little or no preparation is usually required .

9.What's an 'inspection'?

An inspection is more formalized than a 'walkthrough', typically with 3-8 people including a moderator, reader, and a recorder to take notes. The subject of the inspection is typically a document such as a requirements spec or a test plan, and the purpose is to find problems and see what's missing, not to fix anything. Attendees should prepare for this type of meeting by reading thru The document; most problems will be found during this preparation. The result of the inspection meeting should be a written report. Thorough preparation for inspections is difficult, pain staking work but is one of the most cost effective methods of ensuring quality. Employees who are most skilled at inspections are like the 'eldest brother' in the parable in 'Why is it often hard for management to get serious about quality assurance?'. Their skill may have low visibility but they are extremely valuable to any software development organization, since bug prevention is far more cost- effective than bug detection .


10. What kinds of testing should be considered?

Black box testing - not based on any knowledge of internal design or code. Tests are based on requirements and functionality.

White box testing - based on knowledge of the internal logic of an application's code. Tests are based on coverage of code statements, branches, paths, conditions.

Unit testing - the most 'micro' scale of testing; to test particular functions or code modules. Typically done by the programmer and not by testers, as it requires detailed knowledge of the internal program design and code. Not always easily done unless the application has a well-designed architecture with tight code; may require developing test driver modules or test harnesses.






Incremental integration testing - continuous testing of an application as new functionality is added; requires that various aspects of an application's functionality be independent enough to work separately before all parts of the program are completed, or that test drivers be developed as needed; done by programmers or by testers.

Integration testing - testing of combined parts of an application to determine if they function together correctly. The 'parts' can be code modules, individual applications, client and server applications on a network, etc. This type of testing is especially relevant to client/server and distributed systems.

Functional testing - black-box type testing geared to functional requirements of an application; this type of testing should be done by testers. This doesn't mean that the programmers shouldn't check that their code works before releasing it (which of course applies to any stage of testing.)

System testing - black-box type testing that is based on overall requirements specifications; covers all combined parts of a system.

End-to-end testing - similar to system testing; the 'macro' end of the test scale; involves testing of a complete application environment in a situation that mimics real-world use, such as interacting with a database, using network communications, or interacting with other hardware, applications, or systems if appropriate.

Sanity testing - typically an initial testing effort to determine if a new software version is performing well enough to accept it for a major testing effort. For example, if the new software is crashing systems every 5 minutes, bogging down systems to a crawl, or destroying databases, the software may not be in a 'sane' enough condition to warrant further testing in its current state.

Regression testing - re-testing after fixes or modifications of the software or its environment. It can be difficult to determine how much re-testing is needed, especially near the end of the development cycle. Automated testing tools can be especially useful for this type of testing.

Acceptance testing - final testing based on specifications of the end-user or customer, or based on use by end-users/customers over some limited period of time.Load testing - testing an application under heavy loads, such as testing of a web site under a range of loads to determine at what point the system's response time degrades or fails.

Stress testing - term often used interchangeably with 'load' and 'performance' testing. Also used to describe such tests as system functional testing while under unusually heavy loads, heavy repetition of certain actions or inputs, input of large numerical values, large complex queries to a database system, etc.






Performance testing - term often used interchangeably with 'stress' and 'load' testing. Ideally 'performance' testing (and any other 'type' of testing) is defined in requirements documentation or QA or Test Plans.

Usability testing - testing for 'user-friendliness'. Clearly this is subjective, and will depend on the targeted end-user or customer. User interviews, surveys, video recording of user sessions, and other techniques can be used. Programmers and testers are usually not appropriate as usability testers.

Install/uninstall testing - testing of full, partial, or upgrade install/uninstall processes.

Recovery testing - testing how well a system recovers from crashes, hardware failures, or other catastrophic problems.

Security testing - testing how well the system protects against unauthorized internal or external access, willful damage, etc; may require sophisticated testing techniques.

Compatability testing - testing how well software performs in a particular hardware/software/operating system/network/etc. environment.

Exploratory testing - often taken to mean a creative, informal software test that is not based on formal test plans or test cases; testers may be learning the software as they test it.

Ad-hoc testing - similar to exploratory testing, but often taken to mean that the testers have significant understanding of the software before testing it.

User acceptance testing - determining if software is satisfactory to an end-user or customer.

Comparison testing - comparing software weaknesses and strengths to competing products.

Alpha testing - testing of an application when development is nearing completion; minor design
changes may still be made as a result of such testing. Typically done by end-users or others, not by programmers or testers.

Beta testing - testing when development and testing are essentially completed and final bugs and problems need to be found before final release. Typically done by end-users or others, not by programmers or testers.

Mutation testing - a method for determining if a set of test data or test cases is useful, by deliberately introducing various code changes ('bugs') and retesting with the original test data/cases to determine if the 'bugs' are detected. Proper implementation requires large computational resources .




11.What are 5 common problems in the software development process?

Poor requirements - if requirements are unclear, incomplete, too general, or not testable, there will be problems.

Unrealistic schedule - if too much work is crammed in too little time, problems are inevitable.

Inadequate testing - no one will know whether or not the program is any good until the
customer complains or systems crash.

Featuritis - requests to pile on new features after development is underway; extremely common.

Miscommunication - if developers don't know what's needed or customer's have erroneous expectations, problems are guaranteed .

12.What are 5 common solutions to software development problems?

Solid requirements - clear, complete, detailed, cohesive, attainable, testable requirements that are agreed to by all players. Use prototypes to help nail down requirements.Realistic schedules - allow adequate time for planning, design, testing, bug fixing, re-testing, changes, and documentation; personnel should be able to complete the project without burning out.

Adequate testing - start testing early on, re-test after fixes or changes, plan for adequate time for
testing and bug-fixing.

Stick to initial requirements as much as possible - be prepared to defend against changes and additions once development has begun, and be prepared to explain consequences. If changes are necessary, they should be adequately reflected in related schedule changes. If possible, use rapid prototyping during the design phase so that customers can see what to expect. This will provide them a higher comfort level with their requirements decisions and minimize changes later on .

Communication - require walkthroughs and inspections when appropriate; make extensive use of group communication tools - e-mail, groupware, networked bug-tracking tools and change management tools, intranet capabilities, etc.; insure that documentation is available and up-to- date - preferably electronic, not paper; promote teamwork and cooperation; use protoypes early on so that customers' expectations are clarified .










13.What is software 'quality'?

Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and/or expectations, and is maintainable. However, quality is obviously a subjective term. It will depend on who the 'customer' is and their overall influence in the scheme of things. A wide-angle view of the 'customers' of a software development project might include end-users, customer acceptance testers, customer contract officers, customer management, the development organization's management/accountants/testers/salespeople, future software maintenance engineers, stockholders, magazine columnists, etc. Each type of 'customer' will have their own slant on 'quality' - the accounting department might define quality in terms of profits while an end-user might define quality as user-friendly and bug-free. (See the Bookstore section's 'Software QA' category for useful books with more information.)

14.What is 'good code'?

'Good code' is code that works, is bug free, and is readable and maintainable. Some organizations have coding 'standards' that all developers are supposed to adhere to, but everyone has different ideas about what's best, or what is too many or too few rules. There are also various theories and metrics, such as McCabe Complexity metrics. It should be kept in mind that excessive use of standards and rules can stifle productivity and creativity. 'Peer reviews', 'buddy checks' code analysis tools, etc. can be used to check for problems and enforce standards. For C and C++ coding, here are some typical ideas to consider in setting rules/standards; these may or may not apply to a particular situation:
Minimize or eliminate use of global variables.
Use descriptive function and method names - use both upper and lower case, avoid abbreviations, use as many characters as necessary to be adequately descriptive (use of more than 20 characters is not out of line); be consistent in naming conventions.
Use descriptive variable names - use both upper and lower case, avoid abbreviations, use as many characters as necessary to be adequately descriptive (use of more than 20 characters is not out of line); be consistent in naming conventions.
Function and method sizes should be minimized; less than 100 lines of code is good, less than 50 lines is preferable.
Function descriptions should be clearly spelled out in comments preceding a function's code.
Organize code for readability.
Use whitespace generously - vertically and horizontally
Each line of code should contain 70 characters max.
One code statement per line.
Coding style should be consistent throught a program (eg, use of brackets, indentations, naming conventions, etc.)
In adding comments, err on the side of too many rather than too few comments; a common rule of thumb is that there should be at least as many lines of comments (including header blocks) as lines of code.
No matter how small, an application should include documentaion of the overall program function and flow (even a few paragraphs is better than nothing); or if possible a separate flow chart and detailed program documentation.
Make extensive use of error handling procedures and status and error logging.
For C++, to minimize complexity and increase maintainability, avoid too many levels of inheritance in class heirarchies
(relative to the size and complexity of the application). Minimize use of multiple inheritance, and minimize use of operator overloading (note that the Java programming language eliminates multiple inheritance and operator overloading.)
Cor C++, keep class methods small, less than 50 lines of code per method is preferable.For C++, make liberal use of exception handlers
15. What is 'good design'?
'Design' could refer to many things, but often refers to 'functional design' or 'internal design'. Good internal design is
indicated by software code whose overall structure is clear, understandable, easily modifiable, and maintainable; is robust with sufficient error-handling and status logging capability; and works correctly when implemented. Good functional design is indicated by an application whose functionality can be traced back to customer and end-user requirements. (See further discussion of functional and internal design in 'What's the big deal about requirements?' in FAQ #2.) For programs that have a user interface, it's often a good idea to assume that the end user will have little computer knowledge and may not read a user manual or even the on-line help; some common rules-of-thumb
include:
The program should act in a way that least surprises the user
It should always be evident to the user what can be done next and how to exit
The program shouldn't let the users do something stupid without warning them.


16. What is SEI? CMM? ISO? IEEE? ANSI? Will it help?
SEI = 'Software Engineering Institute' at Carnegie-Mellon University; initiated by the U.S. Defense Department to help improve software development processes.
CMM = 'Capability Maturity Model', developed by the SEI. It's a model of 5 levels of organizational 'maturity' that determine effectiveness in delivering quality software. It is geared to large organizations such as large U.S. Defense Department contractors. However, many of the QA processes involved are appropriate to any organization, and if reasonably applied can be helpful. Organizations can receive CMM ratings by undergoing assessments by qualified auditors.
Level 1 - characterized by chaos, periodic panics, and eroic efforts required by individuals to successfully complete projects. Few if any processes in place; successes may not be repeatable.
Level 2 - software project tracking, requirements management, realistic planning, and configuration management processes are in place; successful practices can be repeated.
Level 3 - standard software development and maintenance rocesses are integrated throughout an organization; a Software Engineering Process Group is is in place to oversee software processes, and training programs are used to ensure understanding and compliance.
Level 4 - metrics are used to track productivity, processes, and products. Project performance is predictable, and quality is consistently high.
Level 5 - the focus is on continouous process improvement. The impact of new processes and technologies can be predicted and effectively implemented when required.
Perspective on CMM ratings: During 1997-2001, 1018 organizations were assessed. Of those, 27% were rated at Level 1, 39% at 2, 23% at 3, 6% at 4, and 5% at 5. (For ratings during the period 1992-96, 62% were at Level 1, 23% at 2, 13% at 3, 2% at 4, and 0.4% at 5.) The median size of organizations was 100 software engineering/maintenance personnel; 32% of organizations were U.S. federal contractors or agencies. For those rated at Level 1, the most problematical key process area was in Software Quality Assurance.ISO = 'International Organisation for Standardization' - The ISO 9001:2000 standard (which replaces the previous standard of 1994)
concerns quality systems that are assessed by outside auditors, and it applies to many kinds of production and manufacturing organizations, not just software. It covers documentation, design, development, production, testing, installation, servicing, and other processes. The full set of standards consists of: (a)Q9001-2000 - Quality Management Systems: Requirements; (b)Q9000-2000 - Quality Management Systems: Fundamentals and
Vocabulary; (c)Q9004-2000 - Quality Management Systems: Guidelines for Performance Improvements. To be ISO 9001 certified, a third-party auditor assesses an organization, and certification is typically good for about 3 years, after which a complete reassessment is required. Note that ISO certification does not necessarily indicate quality products - it indicates only that documented processes are followed. Also see http://www.iso.ch/ for the latest information. In the U.S. the standards can be purchased via the ASQ web site at http://e- standards.asq.org/
IEEE = 'Institute of Electrical and Electronics Engineers' - among other things, creates standards such as 'IEEE Standard for Software Test Documentation' (IEEE/ANSI Standard 829), 'IEEE Standard of Software Unit Testing (IEEE/ANSI Standard 1008), 'IEEE Standard for Software Quality Assurance Plans' (IEEE/ANSI Standard 730), and others.
ANSI = 'American National Standards Institute', the primary industrial standards body in the U.S.; publishes some software- related standards in conjunction with the IEEE and ASQ (American Society for Quality).
Other software development process assessment methods besides CMM and ISO 9000 include SPICE, Trillium, TickIT. and Bootstrap. See the 'Other Resources' section for further information available on the web.






16.What is the 'software life cycle'?
The life cycle begins when an application is first conceived and ends when it is no longer in use. It includes aspects such as initial concept, requirements analysis, functional design, internal design, documentation planning, test planning, coding, document preparation, integration, testing, maintenance, updates, retesting, phase-out, and other aspects. (See the Bookstore section's 'Software QA', 'Software Engineering', and 'Project Management' categories for
useful books with more information.)
17. Will automated testing tools make testing easier?
Possibly. For small projects, the time needed to learn and implement them may not be worth it. For larger projects, or on- going long-term projects they can be valuable.
A common type of automated tool is the 'record/playback' type. For example, a tester could click through all combinations of menu choices, dialog box choices, buttons, etc. in an application GUI and have them 'recorded' and the results logged by a tool. The 'recording' is typically in the form of text based on a scripting language that is interpretable by the testing tool. If new buttons are added, or some underlying code in the application is changed, etc. the application can then be retested by just 'playing back' the 'recorded' actions, and comparing the logging
results to check effects of the changes. The problem with such tools is that if there are continual changes to the system being tested, the 'recordings' may have to be changed so much that it becomes very time-consuming to continuously update the scripts. Additionally, interpretation of results (screens, data, logs, etc.) can be a difficult task. Note that there are record/playback tools for text-based interfaces also, and for all types of platforms.
Other automated tools can include :
Code analyzers - monitor code complexity, adherence to standards, etc .
Coverage analyzers - these tools check which parts of the code have been exercised by a test, and may be oriented to code statement coverage,condition coverage, path coverage, etc.Memory analyzers - such as bounds-checkers and leak detectors .
Load/performance test tools - for testing client/server and web applications under various load levels.
Web test tools - to check that links are valid, HTML code usage is correct, client-side and server-side programs work, a web site's interactions are secure.
Other tools - for test case management, documentation management, bug reporting, and configuration management.



SUCCESS FOR CAREER



18. What makes a good test engineer?
A good test engineer has a 'test to break' attitude, an ability to take the point of view of the customer, a strong desire for quality, and an attention to detail. Tact and diplomacy are useful in maintaining a cooperative relationship with developers, and an ability to communicate with both technical (developers) and non-technical (customers, management) people is useful. Previous software development experience can be helpful as it provides a deeper understanding of the software development process, gives the tester an appreciation for the developers' point of view, and reduce the learning curve in automated test tool programming. Judgement skills are needed to assess high-risk areas of an application on which to focus testing efforts when time is limited.
19. What makes a good Software QA engineer?
The same qualities a good tester has are useful for a QA engineer. Additionally, they must be able to understand the entire software development process and how it can fit into the business approach and goals of the organization. Communication skills and the ability to understand various sides of issues are important. In organizations in the early stages of implementing QA processes, patience and diplomacy are especially needed. An ability to find problems as well as to see 'what's missing' is important for inspections and reviews.


20. What makes a good QA or Test manager?
A good QA, test, or QA/Test(combined) manager should:
> Be familiar with the software development process
>Be able to maintain enthusiasm of their team and promote a positive atmosphere, despite what is a somewhat 'negative' process (e.g., looking for or preventing problems)
> Be able to promote teamwork to increase productivity
>Be able to promote cooperation between software, test, and QA engineers
>Have the diplomatic skills needed to promote improvements in QA processes
> Have the ability to withstand pressures and say 'no' to other managers when quality is insufficient or QA processes are not being adhered to
>Have people judgement skills for hiring and keeping skilled personnel
>Be able to communicate with technical and non-technical people, engineers, managers, and customers.
>Be able to run meetings and keep them focused
21. What's the role of documentation in QA?
Critical. (Note that documentation can be electronic, not necessarily paper.) QA practices should be documented such that they are repeatable. Specifications, designs, business rules, inspection reports, configurations, code changes, test plans, test cases, bug reports, user manuals, etc. should all be documented. There should ideally be a system for easily finding and obtaining documents and determining what documentation will have a particular piece of information. Change management for documentation should be used if possible.
22. What's the big deal about 'requirements'?
One of the most reliable methods of insuring problems, or failure, in a complex software project is to have poorly
documented requirements specifications. Requirements are the details describing an application's externally-perceived functionality and properties. Requirements should be clear, complete, reasonably detailed, cohesive, attainable, and testable. A non-testable requirement would be, for example, 'user-friendly' (too subjective). A testable requirement would be something like 'the user must enter their previously-assigned password to access the application'. etermining
and organizing requirements details in a useful and efficient way can be a difficult effort; different methods are available
depending on the particular project. Many books are available that describe various approaches to
Care should be taken to involve ALL of a project's significant 'customers' in the requirements process. 'Customers' could be in-house personnel or out, and could include end-users, customer acceptance testers, customer contract officers, customer management, future software maintenance engineers, salespeople, etc. Anyone who could later derail the project if their expectations aren't met should be included if possible.
Organizations vary considerably in their handling of requirements specifications. Ideally, the requirements are spelled out in a document with statements such as 'The product shall.....'. 'Design' specifications should not be confused with 'requirements'; design specifications should be traceable back to the requirements.
In some organizations requirements may end up in high level project plans, functional specification documents, in design documents, or in other documents at various levels of detail. No matter what they are called, some type of documentation with detailed requirements will be needed by testers in order to properly plan and execute tests. Without such documentation, there will be no clear-cut way to determine if a software application is performing correctly.
23.What steps are needed to develop and run software tests?
The following are some of the steps to consider:
Obtain requirements, functional design, and internal design specifications and other necessary documents
Obtain budget and schedule requirements
Determine project-related personnel and their responsibilities, reporting requirements, required standards and processes (such as release processes, change processes, etc.)
Identify application's higher-risk aspects, set priorities, and determine scope and limitations of tests
Determine test approaches and methods - unit, integration, functional, system, load, usability tests, etc.
Determine test environment requirements (hardware, software communications, etc.)
Determine testware requirements (record/playback tools, coverage analyzers, test tracking, problem/bug tracking, etc.)
Determine test input data requirements
Identify tasks, those responsible for tasks, and labor requirements
Set schedule estimates, timelines, milestones
Determine input equivalence classes, boundary value analyses, error classes
Prepare test plan document and have needed reviews/approvals
Write test cases
Have needed reviews/inspections/approvals of test cases
Prepare test environment and testware, obtain needed user manuals/reference documents/configuration guides/installation guides, set up test tracking processes, set up logging and archiving processes, set up or obtain test input data Obtain and install software releases
Perform tests
Evaluate and report results
Track problems/bugs and fixes
Retest as needed
Maintain and update test plans, test cases, test environment, and testware through life cycle





EXAMAPERS123.BLOGSPOT.COM





23. What's a 'test plan'?
A software project test plan is a document that describes the objectives, scope, approach, and focus of a software testing effort. The process of preparing a test plan is a useful way to think through the efforts needed to validate the acceptability of a software product. The completed document will help people outside the test group understand the 'why' and 'how' of product validation. It should be thorough enough to be useful but not so thorough that no one outside the test group will read it. The following are some of the items that might be included in a test plan, depending on the particular project:
Title
Identification of software including version/release numbers
Revision history of document including authors, dates, approvals
Table of Contents
Purpose of document, intended audience
Objective of testing effort
Software product overview
Relevant related document list, such as requirements, design documents, other test plans, etc.
Relevant standards or legal requirements
Traceability requirements
Relevant naming conventions and identifier conventions
Overall software project organization and personnel/contact- info/responsibilties
Test organization and personnel/contact-info/responsibilities
Assumptions and dependencies
Project risk analysis
Testing priorities and focus
Scope and limitations of testing
Test outline - a decomposition of the test approach by test type, feature, functionality, process, system, module, etc. as applicable
Outline of data input equivalence classes, boundary value analysis, error classes
Test environment - hardware, operating systems, other required software, data configurations, interfaces to other systems
Test environment validity analysis - differences between the test and production systems and their impact on test validity.
Test environment setup and configuration issues Software migration processes Software CM processes
Test data setup requirements
Database setup requirements
Outline of system-logging/error-logging/other capabilities, and tools such as screen capture software, that will be used to help describe and report bugs
Discussion of any specialized software or hardware tools that will be used by testers to help track the cause or source of bugs
Test automation - justification and overview
Test tools to be used, including versions, patches, etc.
Test script/test code maintenance processes and version control
Problem tracking and resolution - tools and processes
Project test metrics to be used
Reporting requirements and testing deliverables
Software entrance and exit criteria
Initial sanity testing period and criteria
Test suspension and restart criteria
Personnel allocation
Personnel pre-training needs
Test site/location
Outside test organizations to be utilized and their purpose, responsibilties, deliverables, contact persons, and coordination issues
Relevant proprietary, classified, security, and licensing issues. Open issues
Appendix - glossary, acronyms, etc.



24. What's a 'test case'?
A test case is a document that describes an input, action, or event and an expected response, to determine if a feature of an application is working correctly. A test case should contain particulars such as test case identifier, test case name, objective, test conditions/setup, input data requirements, steps, and expected results.
Note that the process of developing test cases can help find problems in the requirements or design of an application, since it requires completely thinking through the operation of the application. For this reason, it's useful to prepare test cases early in the development cycle if possible.
25. What should be done after a bug is found?
The bug needs to be communicated and assigned to developers that can fix it. After the problem is resolved, fixes should be re-tested, and determinations made regarding requirements for regression testing to check that fixes didn't create problems elsewhere. If a problem- tracking system is in place, it should encapsulate these processes. A variety of commercial problem-tracking/management software tools are available (see the 'Tools' section for web resources with listings of such tools). The following are items to consider in the tracking process:
Complete information such that developers can understand the bug, get an idea of it's severity, and reproduce it if necessary. Bug identifier (number, ID, etc.) Current bug status (e.g., 'Released for Retest', 'New', etc.) The application name or identifier and version The function, module, feature, object, screen, etc. where the bug occurred
Environment specifics, system, platform, relevant hardware specifics
Test case name/number/identifier
One-line bug description
Full bug description
Description of steps needed to reproduce the bug if not covered by a test case or if the developer doesn't have easy access to the test case/test script/test tool
Names and/or descriptions of file/data/messages/etc. used in test
File excerpts/error messages/log file excerpts/screen shots/test tool logs that would be helpful in finding the cause of the problem Severity estimate (a 5-level range such as 1-5 or 'critical'-to- 'low' is common)
26. Was the bug reproducible?
Tester name
Test date
Bug reporting date
Name of developer/group/organization the problem is assigned to
Description of problem cause
Description of fix
Code section/file/module/class/method that was fixed
Date of fix
Application version that contains the fix
Tester responsible for retest
Retest date
Retest results
Regression testing requirements
Tester responsible for regression tests
Regression testing results
A reporting or tracking process should enable notification of appropriate personnel at various stages. For instance, testers need to know when retesting is needed, developers need to know when bugs are found and how to get the needed information, and reporting/summary capabilities are needed for managers.
27. What is 'configuration management'?
Configuration management covers the processes used to control, coordinate, and track: code, requirements, documentation, problems, change requests, designs, tools/compilers/libraries/patches, changes made to them, and who makes the changes. (See the 'Tools' section for web resources with listings of configuration management
tools. Also see the Bookstore section's 'Configuration Management' category for useful books with more information.)




27. What if the software is so buggy it can't really be tested at all?
The best bet in this situation is for the testers to go through the process of reporting whatever bugs or blocking-type problems initially show up, with the focus being on critical bugs. Since this type of problem can severely affect schedules, and indicates deeper problems in the software development process (such as insufficient unit testing or insufficient integration testing, poor design, improper build or release procedures, etc.) managers should be notified, and provided with some documentation as evidence of the problem.
28. How can it be known when to stop testing?
This can be difficult to determine. Many modern software applications are so complex, and run in such an interdependent environment, that complete testing can never be done. Common factors in deciding when to stop are:
Deadlines (release deadlines, testing deadlines, etc.) Test cases completed with certain percentage passed
Test budget depleted Coverage of code/functionality/requirements reaches a specified point Bug rate falls below a certain level Beta or alpha testing period ends
29. What if there isn't enough time for thorough testing?
Use risk analysis to determine where testing should be focused. Since it's rarely possible to test every possible aspect of an application, every possible combination of events, every dependency, or everything that could go wrong, risk analysis is appropriate to most software development projects. This requires judgement skills, common sense, and experience. (If warranted, formal methods are also available.) Considerations can include:
Which functionality is most important to the project's intended purpose?
Which functionality is most visible to the user?
Which functionality has the largest safety impact?
Which functionality has the largest financial impact on users?
Which aspects of the application are most important to the customer?
Which aspects of the application can be tested early in the development cycle?
Which parts of the code are most complex, and thus most subject to errors?
Which parts of the application were developed in rush or panic mode?
Which aspects of similar/related previous projects caused problems?
Which aspects of similar/related previous projects had large maintenance expenses?
Which parts of the requirements and design are unclear or poorly thought out?
What do the developers think are the highest-risk aspects of the application?
What kinds of problems would cause the worst publicity?
What kinds of problems would cause the most customer service complaints?
What kinds of tests could easily cover multiple functionalities?
Which tests will have the best high-risk-coverage to time- required ratio?
What if the project isn't big enough to justify extensive testing?
Consider the impact of project errors, not the size of the project. However, if extensive testing is still not justified,
risk analysis is again needed and the same considerations as described previously in 'What if there isn't enough time for thorough testing?' apply.

The tester might then do ad hoc testing, or write up a limited test plan based on the risk analysis.



30. What can be done if requirements are changing continuously?
A common problem and a major headache.
Work with the project's stakeholders early on to understand how requirements might change so that alternate test plans and strategies can be worked out in advance, if possible.
It's helpful if the application's initial design allows for some adaptability so that later changes do not require redoing the
application from scratch.
If the code is well-commented and well-documented this makes changes easier for the developers.
Use rapid prototyping whenever possible to help customers feel sure of their requirements and minimize changes.
The project's initial schedule should allow for some extra time commensurate with the possibility of changes.
Try to move new requirements to a 'Phase 2' version of an application, while using the original requirements for the 'Phase 1' version.
Negotiate to allow only easily-implemented new requirements into the project, while moving more difficult new requirements into future versions of the application.
Be sure that customers and management understand the scheduling impacts, inherent risks, and costs of significant requirements changes. Then let management or the customers (not the developers or testers) decide if the changes are warranted - after all, that's their job.
Balance the effort put into setting up automated testing with the expected effort required to re-do them to deal with changes.
Try to design some flexibility into automated test scripts.
Focus initial automated testing on application aspects that are most likely to remain unchanged.
Devote appropriate effort to risk analysis of changes to minimize regression testing needs.
Design some flexibility into test cases (this is not easily done; the best bet might be to minimize the detail in the test cases, or set up only higher-level generic-type test plans)
Focus less on detailed test plans and test cases and more on ad hoc testing (with an understanding of the added risk that this entails).
31. What if the application has functionality that wasn't in the requirements?
It may take serious effort to determine if an application has significant unexpected or hidden functionality, and it would
indicate deeper problems in the software development process. If the functionality isn't necessary to the purpose of the application, it should be removed, as it may have unknown impacts or dependencies that were not taken into account by the designer or the customer. If not removed, design information will be needed to determine added testing needs or regression testing needs. Management should be made aware of any significant added risks as a result of the unexpected functionality. If the functionality only effects areas such as minor improvements in the user interface,
for example, it may not be a significant risk


32. How can Software QA processes be implemented without stifling productivity?
By implementing QA processes slowly over time, using consensus to reach agreement on processes, and adjusting and experimenting as an organization grows and matures, productivity will be improved instead of stifled. Problem prevention will lessen the need for problem detection, panics and burn-out will decrease, and there will be improved focus and less wasted effort. At the same time, attempts should be made to keep processes simple and efficient, minimize paperwork, promote computer-based processes and automated tracking and reporting, minimize time required in meetings, and promote training as part of the QA process. However, no one - especially talented technical types - likes rules or bureacracy, and in the short run things may slow down a bit. A typical scenario would be that
more days of planning and development will be needed, but less time will be required for late- night bug-fixing and calming of irate customers. (See the Bookstore section's 'Software QA', 'Software Engineering',
And 'Project Management' categories for useful books with more information.)
33. What if an organization is growing so fast that fixed QA processes are impossible?
This is a common problem in the software industry, especially in new technology areas. There is no easy solution in this situation, other than:
Hire good people
Management should 'ruthlessly prioritize' quality issues and maintain focus on the customer
Everyone in the organization should be clear on what 'quality' means to the customer
34. How does a client/server environment affect testing?
Client/server applications can be quite complex due to the multiple dependencies among clients, data communications, hardware, and servers. Thus testing requirements can be extensive. When time is limited (as it usually is) the focus should be on integration and system testing. Additionally, load/stress/performance testing may be useful in determining client/server application limitations and capabilities. There are commercial tools to assist with such testing. (See the 'Tools' section for web resources with listings that include these kinds of test tools.)
35. How can World Wide Web sites be tested?
Web sites are essentially client/server applications - with web servers and 'browser' clients. Consideration should be given to the interactions between html pages, TCP/IP communications, Internet connections, firewalls, applications that run in web pages (such as applets, javascript, plug-in applications), and applications that run on the server side (such as cgi scripts, database interfaces, logging applications, dynamic page generators, asp, etc.). Additionally, there are a wide variety of servers and browsers, various versions of each, small but sometimes significant differences between them, variations in connection speeds, rapidly changing technologies, and multiple standards and protocols. The end result is that testing for web sites can become a major ongoing effort. Other considerations might include:
What are the expected loads on the server (e.g., number of hits per unit time?), and what kind of performance is required under such loads (such as web server response time, database query response times). What kinds of tools will be needed for performance testing (such as web load testing tools, other tools already in house that can be adapted, web robot downloading tools, etc.)?
Who is the target audience? What kind of browsers will they be using? What kind of connection speeds will they by using? Are they intra- organization (thus with likely high connection speeds and similar browsers) or Internet-wide (thus with a wide variety of connection speeds and browser types)?
What kind of performance is expected on the client side (e.g., how fast should pages appear, how fast should animations, applets, etc. load and run)?
Will down time for server and content maintenance/upgrades be allowed? how much?
What kinds of security (firewalls, encryptions, passwords, etc.) will be required and what is it expected to do? How can it be tested?


How reliable are the site's Internet connections required to be?
And how does that affect backup system or redundant connection requirements and testing?
What processes will be required to manage updates to the web site's content, and what are the requirements for maintaining, tracking, and controlling page content, graphics, links, etc.?
Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?
Will there be any standards or requirements for page appearance and/or graphics throughout a site or parts of a site??
How will internal and external links be validated and updated? how often?
Can testing be done on the production system, or will a separate test system be required? How are browser caching,
variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be accounted for in testing?
How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?
How are cgi programs, applets, javascripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?
Some sources of site security information include the Usenet Newsgroup 'comp.security.announce' and links concerning web site security in The 'Other Resources' section.
Some usability guidelines to consider - these are subjective and may or may not apply to a given situation (Note: more information on usability testing issues can be found in articles about web site usability in the 'Other Resources' section):
Pages should be 3-5 screens max unless content is tightly focused on a single topic. If larger, provide internal links
within the page.
The page layouts and design elements should be consistent throughout a site, so that it's clear to the user that they're
still within a site.
Pages should be as browser-independent as possible, or pages should be provided or generated based on the browser-type.
All pages should have links external to the page; there should be no dead-end pages.
The page owner, revision date, and a link to a contact person or organization should be included on each page.
35. How is testing affected by object-oriented designs?
Well-engineered object-oriented design can make it easier to trace from code to internal design to functional design to requirements.
While there will be little affect on black box testing (where an understanding of the internal design of the application is
unnecessary), white-box testing can be oriented to the application's objects. If the application was well-designed this can simplify test design.
What is Extreme Programming and what's it got to do with testing? Extreme Programming (XP) is a software development approach for small teams on risk-prone projects with unstable requirements.
It was created by Kent Beck who described the approach in his book 'Extreme Programming Explained' (See the Softwareqatest.com Books page.).
Testing ('extreme testing') is a core aspect of Extreme Programming.
Programmers are expected to write unit and functional test code first - before the application is developed. Test code is under source control along with the rest of the code. Customers are expected to be an integral part of the project team and to help develope scenarios for acceptance/black box testing. Acceptance tests are preferably automated, and are modified and rerun for each of the frequent development iterations. QA and test personnel are also required to be an integral part of the project team. Detailed requirements documentation is not used, and frequent re-scheduling,
re-estimating, and re-prioritizing is expected. For more info see the XP-related listings in the Softwareqatest.com 'Other Resources' section.






EXAMAPERS123.BLOGSPOT.COM







EXAMAPERS123.BLOGSPOT.COM