My Cs504 PAPer 7/3/14
50% of Mcqs were from past papers .
Subjective Part:
Questions Of 2 marks
Q. which design pattern would you suggest for an application where hang in one object state is immediately notified to linked objects? (2)
Ans: Observer Pattern pg n0 140
Q. write the following C statement according to the AnSI standard (2)
int factorial ();
Q. how names representing global variables in C++ should be in coding style guide?
Ans: Global variables in C++ should always be referred to by using the :: operator.
::mainWindow.open() , ::applicationContext.getName() pg no 150
Q. what is Software debugging?
Answer: Software debugging is the process by which developers attempt to remove coding defects from a computer program.
Questions of 3 marks:
Write any three attributes of a program that contribute towards making the program
self documented? (3)
Answer: There are a number of attributes that contributes towards making the program
self documented. These include, the size of each function, choice of variable and other identifier names, style of writing expressions, structure of programming statements, comments, modularity, and issues relating to performance and portability.
Q, How many level of exception safety are there? NAme those levels.
Anwer : Levels of Exception Safety pg no 188
Basic Guarantee: Ensures that temporaries are destroyed properly and there are no
memory leaks.
Strong Guarantee: Ensures basic guarantee as well as there is full-commit or rollback.
No-throw Guarantee: Ensure that a function will not throw.
Q. In the context of three-tier architecture, "interface" of an application represents which layer? (3)
Answer : presentations, application , database (not sure)
Questions of 5 marks :
Q. As a programmes you are instructed to write potable code in order to increase the modality of the software by your team lead . Which points you have to keep in mind to developing a portable code ? (5)
Ans: pg no 179
Q. the code given below contains a bud , identify the bug class and also explain the reason for the bug (5)
char s1[]= "This is a sentence" ;
char *s2;
s2 = (char*) malloc (strlen(s1) +1);
strcpy(s2,s);
Q. Consider the given below statement
*x +=(*xp=2*k<(n-m) ? c [k+1] : d[k--1]));
The above statement is complex ans difficult to read. Re-write the above statement by breaking it into multiple statements to make it more readable .(5) pg no 164
Ans: This statement liberally uses a number of operators and hence is very difficult to follow and understand. If it is broken down into simple set of statements, the logic becomes easier to follow as shown below:
if (2*k < n-m)
*xp = c[k+1];
else
*xp = d[k--];
*x = *x + *xp;
Q. Let's assume we have a system for stock market which provides data for several types of client. We want to have a client implemented as a web based application but in near future we need to add clients for mobile devices , Palm or Pocket Pc , or to have a system to notify the users with SMS alerts Which design pattern is best suited for the above scenario and why ? (5)
50% of Mcqs were from past papers .
Subjective Part:
Questions Of 2 marks
Q. which design pattern would you suggest for an application where hang in one object state is immediately notified to linked objects? (2)
Ans: Observer Pattern pg n0 140
Q. write the following C statement according to the AnSI standard (2)
int factorial ();
Q. how names representing global variables in C++ should be in coding style guide?
Ans: Global variables in C++ should always be referred to by using the :: operator.
::mainWindow.open() , ::applicationContext.getName() pg no 150
Q. what is Software debugging?
Answer: Software debugging is the process by which developers attempt to remove coding defects from a computer program.
Questions of 3 marks:
Write any three attributes of a program that contribute towards making the program
self documented? (3)
Answer: There are a number of attributes that contributes towards making the program
self documented. These include, the size of each function, choice of variable and other identifier names, style of writing expressions, structure of programming statements, comments, modularity, and issues relating to performance and portability.
Q, How many level of exception safety are there? NAme those levels.
Anwer : Levels of Exception Safety pg no 188
Basic Guarantee: Ensures that temporaries are destroyed properly and there are no
memory leaks.
Strong Guarantee: Ensures basic guarantee as well as there is full-commit or rollback.
No-throw Guarantee: Ensure that a function will not throw.
Q. In the context of three-tier architecture, "interface" of an application represents which layer? (3)
Answer : presentations, application , database (not sure)
Questions of 5 marks :
Q. As a programmes you are instructed to write potable code in order to increase the modality of the software by your team lead . Which points you have to keep in mind to developing a portable code ? (5)
Ans: pg no 179
Q. the code given below contains a bud , identify the bug class and also explain the reason for the bug (5)
char s1[]= "This is a sentence" ;
char *s2;
s2 = (char*) malloc (strlen(s1) +1);
strcpy(s2,s);
Q. Consider the given below statement
*x +=(*xp=2*k<(n-m) ? c [k+1] : d[k--1]));
The above statement is complex ans difficult to read. Re-write the above statement by breaking it into multiple statements to make it more readable .(5) pg no 164
Ans: This statement liberally uses a number of operators and hence is very difficult to follow and understand. If it is broken down into simple set of statements, the logic becomes easier to follow as shown below:
if (2*k < n-m)
*xp = c[k+1];
else
*xp = d[k--];
*x = *x + *xp;
Q. Let's assume we have a system for stock market which provides data for several types of client. We want to have a client implemented as a web based application but in near future we need to add clients for mobile devices , Palm or Pocket Pc , or to have a system to notify the users with SMS alerts Which design pattern is best suited for the above scenario and why ? (5)
Answer: Observer pattern pg no 140
Comments
Post a Comment
Please give us your feedback & help us to improve this site.