How To Exam?

a knowledge trading engine...


Birla Institute of Technology (BIT Mesra) 2006 MS Software Engineering Comprehensive (Regular) - Question Paper

Saturday, 19 January 2013 06:35Web

Birla Institute of Technology and Science, Pilani
Distance Learning Programmes Division
MS Software Engineering in Collaboration with Wipro Technologies
2nd Semester 2005 – 2006
Comprehensive exam
Regular


Course No. : SEWP ZC221
Course Name : Structured Programming
Nature of examination : Open Book Exam
Weightage : 60 %
Duration : three Hours
Date : May seven , 2006 (AN)

Note: Attempt all ques.. begin every ans from a fresh page


1) On the standard telephone every of the digits two through nine is associated with a group of three letters. For example, the number two is associated with the letters A, B and C, three with letter D, E and F, and nine with W, X, and Y. The letters Q and Z are not used. This it is possible to translate telephone numbers into words. For example, the number 776-4726 can be represented by the word PROGRAM, since P and R appear above the digit seven on the telephone, O appears above the digit 6, G appears above 4, and so on. Such words often make it easier to remember a telephone number.
Not all phone numbers can be translated in this fashion; since no letters are associated with one and 0, a phone number must not contain these digits if it is to be converted to a word.
Write a program that reads in a seven-digit telephone number, tests to ensure that it does not contain either a 0 or a 1, and if it does not contain these digits, display a list of all possible words that can be formed from the number. The program cannot be made to discriminate ranging from real and "phony" words, so you are needed only to display all possible combinations of the associated letters. For example, the list for 776-4726 begins: PPMGPAM PPMGPAN PPMGPAO PPMGPBM PPMGPBN PPMGPBO PPMGPCM ... [12 m]



2a) what is a pointer? elaborate the advantages of using pointers? discuss in steps. [3m]


2b) Write a function that accepts a string of 'n' characters and exchanges the 1st character with the last, the 2nd with the next-to-last, and so forth until 'n' exchanges have been made. What will the final string look like? Write a dry run for the 'c' code. [9m]




3a) Predict and discuss the output [6 * 2]
(2m for accurate output, 4m for explanation of output)
float a = 3.14;
float **z;
float **y;
float ***x;
float ****v;
float ****w;
float **fun1(float *);
float ****fun2(float ***);
main()
{
clrscr();
z = fun1(&a);
printf("%u %f", z, **z);
}
float **fun1(float *z)
{
y = &z;
v = fun2(&y);
return (**v);
}
float ****fun2(float ***x)
{
w = &x;
return(w);
}




3b)
main()
{
int n[25];
n[0] = 100;
n[24] = 200;
printf("\n%d %d", *n, *(n + 24) + *(n + 0));
}





4a) Predict the output and discuss every line of the code (6*2)
(5 m for explanation of program, 1m for output)

#include "stdio.h"
void main()
{
register int i;
printf("%pF", &i);
}







4b)
#include
#include
main()
{
int cho = 1, ans = 2;
clrscr();
switch(cho)
{
case one : switch(ans)
{
case one : printf("Bye");
break;
case two : printf("Hi" );
break;
};
break;
case 2: printf("Hello");
break;
}
getche();
getch();
getchar();
}






5a) Write a C program that, provide 2 strings a and b, returns the position at which a occurs in b. For example, if a is “cat” and b is “concatenate”, the value returned is 4, since the substring “cat” is obtained starting at the 4th character of “concatenate”. If a does not occur at all in b, the value zero should be returned. This value also should be returned if a is longer than b. If a occurs more than once in b, only the 1st occurrence need be considered. [7 m]





5b) As an enhancement of the previous exercise, write a function that accepts 3 strings , a, b, and c. If a occurs in c, not only is its position returned, but the 1st occurrence of a is changed by b. For example, if the string passed are [5 m]
a: “cat”
b: “dog”
c: “concatenate”
then after the function returns, the string c will contain

“condogenate”



************************************************


( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Birla Institute of Technology (BIT Mesra) 2006 MS Software Engineering Comprehensive (Regular) - Question Paper